Skip to content

Commit e957857

Browse files
authored
Tests: Update to version 3 of package:sqlite3 (#157)
1 parent 40dbd6e commit e957857

16 files changed

+97
-317
lines changed

.github/workflows/tests.yml

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,17 @@ jobs:
121121

122122
- uses: dart-lang/setup-dart@v1
123123

124-
- uses: actions/cache@v4
125-
id: sqlite_build
126-
with:
127-
path: dart/.dart_tool/sqlite3/
128-
key: ${{ matrix.os }}-${{ hashFiles('dart/tool/') }}
129-
130124
- name: Setup Dart tests
131125
working-directory: dart
132126
run: |
133127
dart pub get
134-
dart run tool/download_sqlite3.dart
135128
dart analyze
136-
129+
- uses: actions/cache@v4
130+
with:
131+
path: dart/.dart_tool/hooks_runner/
132+
key: hooks-${{ matrix.os }}-${{ hashFiles('dart/pubspec.lock') }}
133+
restore-keys: hooks-${{ matrix.os }}
134+
137135
- name: Download libs
138136
uses: actions/download-artifact@v5
139137
with:
@@ -155,21 +153,11 @@ jobs:
155153
working-directory: dart
156154
run: |
157155
ls -al assets/
158-
159-
- name: Dart tests on Linux
160-
if: runner.os == 'Linux'
161-
working-directory: dart
162-
run: |
163-
CORE_TEST_SQLITE=.dart_tool/sqlite3/latest/libsqlite3.so dart test
164-
CORE_TEST_SQLITE=.dart_tool/sqlite3/minimum/libsqlite3.so dart test
165156
166-
- name: Dart tests on macOS
167-
if: runner.os == 'macOS'
157+
- name: Dart tests
168158
working-directory: dart
169-
# We skip sync_local_performance_test on macOS because the runners are just so slow...
170159
run: |
171-
CORE_TEST_SQLITE=.dart_tool/sqlite3/latest/libsqlite3.dylib dart test -P skip_slow
172-
CORE_TEST_SQLITE=.dart_tool/sqlite3/minimum/libsqlite3.dylib dart test -P skip_slow
160+
dart test -P ci
173161
174162
build_stable_rust:
175163
runs-on: ubuntu-latest
@@ -180,28 +168,25 @@ jobs:
180168
- name: Install Rust Stable
181169
uses: dtolnay/rust-toolchain@stable
182170

183-
- uses: actions/cache@v4
184-
id: sqlite_build
185-
with:
186-
path: dart/.dart_tool/sqlite3/
187-
key: ${{ matrix.os }}-${{ hashFiles('dart/tool/') }}
188-
189171
- name: Setup Dart tests
190172
working-directory: dart
191173
run: |
192174
dart pub get
193-
dart run tool/download_sqlite3.dart
194175
dart analyze
195176
177+
- uses: actions/cache@v4
178+
with:
179+
path: dart/.dart_tool/hooks_runner/
180+
key: hooks-${{ matrix.os }}-${{ hashFiles('dart/pubspec.lock') }}
181+
restore-keys: hooks-${{ matrix.os }}
182+
196183
- name: Compile with stable Rust
197184
run: |
198185
cargo +stable build -p powersync_loadable
199186
200187
- name: Dart tests with stable Rust
201188
working-directory: dart
202-
run: |
203-
CORE_TEST_SQLITE=.dart_tool/sqlite3/latest/libsqlite3.so dart test
204-
CORE_TEST_SQLITE=.dart_tool/sqlite3/minimum/libsqlite3.so dart test
189+
run: dart test
205190

206191
valgrind:
207192
name: Testing with Valgrind on ${{ matrix.os }}

dart/dart_test.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@ tags:
22
slow:
33

44
presets:
5-
skip_slow:
6-
exclude_tags: slow
5+
ci:
6+
# The macOS runners on GitHub are quite slow, so we only run slow tests on Linux
7+
on_os:
8+
mac-os:
9+
tags:
10+
slow:
11+
skip: "Skipping slow tests on GH actions macOS runners"

dart/pubspec.lock

Lines changed: 50 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,18 @@ packages:
55
dependency: transitive
66
description:
77
name: _fe_analyzer_shared
8-
sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f
8+
sha256: "8d7ff3948166b8ec5da0fbb5962000926b8e02f2ed9b3e51d1738905fbd4c98d"
99
url: "https://pub.dev"
1010
source: hosted
11-
version: "85.0.0"
11+
version: "93.0.0"
1212
analyzer:
1313
dependency: transitive
1414
description:
1515
name: analyzer
16-
sha256: de617bfdc64f3d8b00835ec2957441ceca0a29cdf7881f7ab231bc14f71159c0
16+
sha256: de7148ed2fcec579b19f122c1800933dfa028f6d9fd38a152b04b1516cec120b
1717
url: "https://pub.dev"
1818
source: hosted
19-
version: "7.5.6"
20-
archive:
21-
dependency: "direct dev"
22-
description:
23-
name: archive
24-
sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd"
25-
url: "https://pub.dev"
26-
source: hosted
27-
version: "4.0.7"
19+
version: "10.0.1"
2820
args:
2921
dependency: transitive
3022
description:
@@ -73,6 +65,14 @@ packages:
7365
url: "https://pub.dev"
7466
source: hosted
7567
version: "1.1.2"
68+
code_assets:
69+
dependency: transitive
70+
description:
71+
name: code_assets
72+
sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687"
73+
url: "https://pub.dev"
74+
source: hosted
75+
version: "1.0.0"
7676
collection:
7777
dependency: transitive
7878
description:
@@ -101,10 +101,10 @@ packages:
101101
dependency: transitive
102102
description:
103103
name: crypto
104-
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
104+
sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf
105105
url: "https://pub.dev"
106106
source: hosted
107-
version: "3.0.6"
107+
version: "3.0.7"
108108
decimal:
109109
dependency: transitive
110110
description:
@@ -125,10 +125,10 @@ packages:
125125
dependency: transitive
126126
description:
127127
name: ffi
128-
sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"
128+
sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c
129129
url: "https://pub.dev"
130130
source: hosted
131-
version: "2.1.4"
131+
version: "2.1.5"
132132
file:
133133
dependency: "direct dev"
134134
description:
@@ -161,14 +161,14 @@ packages:
161161
url: "https://pub.dev"
162162
source: hosted
163163
version: "2.1.3"
164-
http:
165-
dependency: "direct dev"
164+
hooks:
165+
dependency: transitive
166166
description:
167-
name: http
168-
sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007
167+
name: hooks
168+
sha256: "5d309c86e7ce34cd8e37aa71cb30cb652d3829b900ab145e4d9da564b31d59f7"
169169
url: "https://pub.dev"
170170
source: hosted
171-
version: "1.5.0"
171+
version: "1.0.0"
172172
http_multi_server:
173173
dependency: transitive
174174
description:
@@ -201,14 +201,6 @@ packages:
201201
url: "https://pub.dev"
202202
source: hosted
203203
version: "1.0.5"
204-
js:
205-
dependency: transitive
206-
description:
207-
name: js
208-
sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc"
209-
url: "https://pub.dev"
210-
source: hosted
211-
version: "0.7.2"
212204
logging:
213205
dependency: transitive
214206
description:
@@ -221,18 +213,18 @@ packages:
221213
dependency: transitive
222214
description:
223215
name: matcher
224-
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
216+
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
225217
url: "https://pub.dev"
226218
source: hosted
227-
version: "0.12.17"
219+
version: "0.12.18"
228220
meta:
229221
dependency: "direct dev"
230222
description:
231223
name: meta
232-
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
224+
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
233225
url: "https://pub.dev"
234226
source: hosted
235-
version: "1.17.0"
227+
version: "1.18.0"
236228
mime:
237229
dependency: transitive
238230
description:
@@ -241,6 +233,14 @@ packages:
241233
url: "https://pub.dev"
242234
source: hosted
243235
version: "2.0.0"
236+
native_toolchain_c:
237+
dependency: transitive
238+
description:
239+
name: native_toolchain_c
240+
sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac"
241+
url: "https://pub.dev"
242+
source: hosted
243+
version: "0.17.4"
244244
node_preamble:
245245
dependency: transitive
246246
description:
@@ -277,18 +277,10 @@ packages:
277277
dependency: transitive
278278
description:
279279
name: pool
280-
sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a"
281-
url: "https://pub.dev"
282-
source: hosted
283-
version: "1.5.1"
284-
posix:
285-
dependency: transitive
286-
description:
287-
name: posix
288-
sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61"
280+
sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d"
289281
url: "https://pub.dev"
290282
source: hosted
291-
version: "6.0.3"
283+
version: "1.5.2"
292284
power_extensions:
293285
dependency: transitive
294286
description:
@@ -369,30 +361,22 @@ packages:
369361
url: "https://pub.dev"
370362
source: hosted
371363
version: "1.10.1"
372-
sprintf:
373-
dependency: transitive
374-
description:
375-
name: sprintf
376-
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
377-
url: "https://pub.dev"
378-
source: hosted
379-
version: "7.0.0"
380364
sqlite3:
381365
dependency: "direct main"
382366
description:
383367
name: sqlite3
384-
sha256: c0503c69b44d5714e6abbf4c1f51a3c3cc42b75ce785f44404765e4635481d38
368+
sha256: c6cfe9b1cc159c9eb8ba174b533a60b5126f9db8c6e34efb127d2bc04bc45034
385369
url: "https://pub.dev"
386370
source: hosted
387-
version: "2.7.6"
371+
version: "3.1.4"
388372
sqlite3_test:
389373
dependency: "direct dev"
390374
description:
391375
name: sqlite3_test
392-
sha256: "0b6f76541385cbe0cebf9454854f78dc9aa18b8cb512d8e597e63385e61d4f45"
376+
sha256: "88ba427a61d6b46f00d942a07615a5a4d0ce8665e38075f92afe6c9ec1c9a3bb"
393377
url: "https://pub.dev"
394378
source: hosted
395-
version: "0.1.1"
379+
version: "0.2.0"
396380
stack_trace:
397381
dependency: transitive
398382
description:
@@ -429,26 +413,26 @@ packages:
429413
dependency: "direct dev"
430414
description:
431415
name: test
432-
sha256: "65e29d831719be0591f7b3b1a32a3cda258ec98c58c7b25f7b84241bc31215bb"
416+
sha256: "54c516bbb7cee2754d327ad4fca637f78abfc3cbcc5ace83b3eda117e42cd71a"
433417
url: "https://pub.dev"
434418
source: hosted
435-
version: "1.26.2"
419+
version: "1.29.0"
436420
test_api:
437421
dependency: transitive
438422
description:
439423
name: test_api
440-
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
424+
sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636"
441425
url: "https://pub.dev"
442426
source: hosted
443-
version: "0.7.6"
427+
version: "0.7.9"
444428
test_core:
445429
dependency: transitive
446430
description:
447431
name: test_core
448-
sha256: "80bf5a02b60af04b09e14f6fe68b921aad119493e26e490deaca5993fef1b05a"
432+
sha256: "394f07d21f0f2255ec9e3989f21e54d3c7dc0e6e9dbce160e5a9c1a6be0e2943"
449433
url: "https://pub.dev"
450434
source: hosted
451-
version: "0.6.11"
435+
version: "0.6.15"
452436
test_descriptor:
453437
dependency: "direct dev"
454438
description:
@@ -469,10 +453,10 @@ packages:
469453
dependency: transitive
470454
description:
471455
name: uuid
472-
sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff
456+
sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8
473457
url: "https://pub.dev"
474458
source: hosted
475-
version: "4.5.1"
459+
version: "4.5.2"
476460
vm_service:
477461
dependency: transitive
478462
description:
@@ -485,10 +469,10 @@ packages:
485469
dependency: transitive
486470
description:
487471
name: watcher
488-
sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a"
472+
sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635"
489473
url: "https://pub.dev"
490474
source: hosted
491-
version: "1.1.2"
475+
version: "1.2.1"
492476
web:
493477
dependency: transitive
494478
description:
@@ -530,4 +514,4 @@ packages:
530514
source: hosted
531515
version: "3.1.3"
532516
sdks:
533-
dart: ">=3.7.0 <4.0.0"
517+
dart: ">=3.9.999 <4.0.0"

dart/pubspec.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,28 @@ version: 0.0.1
44
description: Tests for powersync-sqlite-core
55
environment:
66
sdk: ^3.4.0
7+
78
dependencies:
8-
sqlite3: ^2.7.6
9+
sqlite3: ^3.1.4
910
bson: ^5.0.5
1011

1112
dev_dependencies:
1213
test: ^1.25.0
1314
test_descriptor: ^2.0.2
1415
file: ^7.0.1
15-
sqlite3_test: ^0.1.1
16+
sqlite3_test: ^0.2.0
1617
fake_async: ^1.3.3
1718
convert: ^3.1.2
1819
meta: ^1.16.0
1920
path: ^1.9.1
20-
http: ^1.5.0
21-
archive: ^4.0.7
21+
22+
# See https://pub.dev/documentation/sqlite3/latest/topics/hook-topic.html
23+
hooks:
24+
user_defines:
25+
sqlite3:
26+
source: source
27+
path: ../crates/sqlite/sqlite/sqlite3.c
28+
# Used in sync_test.dart to ensure the core extension dosn't leave any
29+
# busy statements behind.
30+
defines:
31+
- SQLITE_ENABLE_STMTVTAB

0 commit comments

Comments
 (0)