Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 15 additions & 30 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,17 @@ jobs:

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

- uses: actions/cache@v4
id: sqlite_build
with:
path: dart/.dart_tool/sqlite3/
key: ${{ matrix.os }}-${{ hashFiles('dart/tool/') }}

- name: Setup Dart tests
working-directory: dart
run: |
dart pub get
dart run tool/download_sqlite3.dart
dart analyze

- uses: actions/cache@v4
with:
path: dart/.dart_tool/hooks_runner/
key: hooks-${{ matrix.os }}-${{ hashFiles('dart/pubspec.lock') }}
restore-keys: hooks-${{ matrix.os }}

- name: Download libs
uses: actions/download-artifact@v5
with:
Expand All @@ -155,21 +153,11 @@ jobs:
working-directory: dart
run: |
ls -al assets/

- name: Dart tests on Linux
if: runner.os == 'Linux'
working-directory: dart
run: |
CORE_TEST_SQLITE=.dart_tool/sqlite3/latest/libsqlite3.so dart test
CORE_TEST_SQLITE=.dart_tool/sqlite3/minimum/libsqlite3.so dart test

- name: Dart tests on macOS
if: runner.os == 'macOS'
- name: Dart tests
working-directory: dart
# We skip sync_local_performance_test on macOS because the runners are just so slow...
run: |
CORE_TEST_SQLITE=.dart_tool/sqlite3/latest/libsqlite3.dylib dart test -P skip_slow
CORE_TEST_SQLITE=.dart_tool/sqlite3/minimum/libsqlite3.dylib dart test -P skip_slow
dart test -P ci

build_stable_rust:
runs-on: ubuntu-latest
Expand All @@ -180,28 +168,25 @@ jobs:
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable

- uses: actions/cache@v4
id: sqlite_build
with:
path: dart/.dart_tool/sqlite3/
key: ${{ matrix.os }}-${{ hashFiles('dart/tool/') }}

- name: Setup Dart tests
working-directory: dart
run: |
dart pub get
dart run tool/download_sqlite3.dart
dart analyze

- uses: actions/cache@v4
with:
path: dart/.dart_tool/hooks_runner/
key: hooks-${{ matrix.os }}-${{ hashFiles('dart/pubspec.lock') }}
restore-keys: hooks-${{ matrix.os }}

- name: Compile with stable Rust
run: |
cargo +stable build -p powersync_loadable

- name: Dart tests with stable Rust
working-directory: dart
run: |
CORE_TEST_SQLITE=.dart_tool/sqlite3/latest/libsqlite3.so dart test
CORE_TEST_SQLITE=.dart_tool/sqlite3/minimum/libsqlite3.so dart test
run: dart test

valgrind:
name: Testing with Valgrind on ${{ matrix.os }}
Expand Down
9 changes: 7 additions & 2 deletions dart/dart_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ tags:
slow:

presets:
skip_slow:
exclude_tags: slow
ci:
# The macOS runners on GitHub are quite slow, so we only run slow tests on Linux
on_os:
mac-os:
tags:
slow:
skip: "Skipping slow tests on GH actions macOS runners"
116 changes: 50 additions & 66 deletions dart/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,18 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f
sha256: "8d7ff3948166b8ec5da0fbb5962000926b8e02f2ed9b3e51d1738905fbd4c98d"
url: "https://pub.dev"
source: hosted
version: "85.0.0"
version: "93.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: de617bfdc64f3d8b00835ec2957441ceca0a29cdf7881f7ab231bc14f71159c0
sha256: de7148ed2fcec579b19f122c1800933dfa028f6d9fd38a152b04b1516cec120b
url: "https://pub.dev"
source: hosted
version: "7.5.6"
archive:
dependency: "direct dev"
description:
name: archive
sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd"
url: "https://pub.dev"
source: hosted
version: "4.0.7"
version: "10.0.1"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -73,6 +65,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.2"
code_assets:
dependency: transitive
description:
name: code_assets
sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
collection:
dependency: transitive
description:
Expand Down Expand Up @@ -101,10 +101,10 @@ packages:
dependency: transitive
description:
name: crypto
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf
url: "https://pub.dev"
source: hosted
version: "3.0.6"
version: "3.0.7"
decimal:
dependency: transitive
description:
Expand All @@ -125,10 +125,10 @@ packages:
dependency: transitive
description:
name: ffi
sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"
sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.1.5"
file:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -161,14 +161,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.3"
http:
dependency: "direct dev"
hooks:
dependency: transitive
description:
name: http
sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007
name: hooks
sha256: "5d309c86e7ce34cd8e37aa71cb30cb652d3829b900ab145e4d9da564b31d59f7"
url: "https://pub.dev"
source: hosted
version: "1.5.0"
version: "1.0.0"
http_multi_server:
dependency: transitive
description:
Expand Down Expand Up @@ -201,14 +201,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.5"
js:
dependency: transitive
description:
name: js
sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
logging:
dependency: transitive
description:
Expand All @@ -221,18 +213,18 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.18"
meta:
dependency: "direct dev"
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.18.0"
mime:
dependency: transitive
description:
Expand All @@ -241,6 +233,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.0"
native_toolchain_c:
dependency: transitive
description:
name: native_toolchain_c
sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac"
url: "https://pub.dev"
source: hosted
version: "0.17.4"
node_preamble:
dependency: transitive
description:
Expand Down Expand Up @@ -277,18 +277,10 @@ packages:
dependency: transitive
description:
name: pool
sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a"
url: "https://pub.dev"
source: hosted
version: "1.5.1"
posix:
dependency: transitive
description:
name: posix
sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61"
sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d"
url: "https://pub.dev"
source: hosted
version: "6.0.3"
version: "1.5.2"
power_extensions:
dependency: transitive
description:
Expand Down Expand Up @@ -369,30 +361,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.10.1"
sprintf:
dependency: transitive
description:
name: sprintf
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
url: "https://pub.dev"
source: hosted
version: "7.0.0"
sqlite3:
dependency: "direct main"
description:
name: sqlite3
sha256: c0503c69b44d5714e6abbf4c1f51a3c3cc42b75ce785f44404765e4635481d38
sha256: c6cfe9b1cc159c9eb8ba174b533a60b5126f9db8c6e34efb127d2bc04bc45034
url: "https://pub.dev"
source: hosted
version: "2.7.6"
version: "3.1.4"
sqlite3_test:
dependency: "direct dev"
description:
name: sqlite3_test
sha256: "0b6f76541385cbe0cebf9454854f78dc9aa18b8cb512d8e597e63385e61d4f45"
sha256: "88ba427a61d6b46f00d942a07615a5a4d0ce8665e38075f92afe6c9ec1c9a3bb"
url: "https://pub.dev"
source: hosted
version: "0.1.1"
version: "0.2.0"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -429,26 +413,26 @@ packages:
dependency: "direct dev"
description:
name: test
sha256: "65e29d831719be0591f7b3b1a32a3cda258ec98c58c7b25f7b84241bc31215bb"
sha256: "54c516bbb7cee2754d327ad4fca637f78abfc3cbcc5ace83b3eda117e42cd71a"
url: "https://pub.dev"
source: hosted
version: "1.26.2"
version: "1.29.0"
test_api:
dependency: transitive
description:
name: test_api
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636"
url: "https://pub.dev"
source: hosted
version: "0.7.6"
version: "0.7.9"
test_core:
dependency: transitive
description:
name: test_core
sha256: "80bf5a02b60af04b09e14f6fe68b921aad119493e26e490deaca5993fef1b05a"
sha256: "394f07d21f0f2255ec9e3989f21e54d3c7dc0e6e9dbce160e5a9c1a6be0e2943"
url: "https://pub.dev"
source: hosted
version: "0.6.11"
version: "0.6.15"
test_descriptor:
dependency: "direct dev"
description:
Expand All @@ -469,10 +453,10 @@ packages:
dependency: transitive
description:
name: uuid
sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff
sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8
url: "https://pub.dev"
source: hosted
version: "4.5.1"
version: "4.5.2"
vm_service:
dependency: transitive
description:
Expand All @@ -485,10 +469,10 @@ packages:
dependency: transitive
description:
name: watcher
sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a"
sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635"
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.2.1"
web:
dependency: transitive
description:
Expand Down Expand Up @@ -530,4 +514,4 @@ packages:
source: hosted
version: "3.1.3"
sdks:
dart: ">=3.7.0 <4.0.0"
dart: ">=3.9.999 <4.0.0"
18 changes: 14 additions & 4 deletions dart/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,28 @@ version: 0.0.1
description: Tests for powersync-sqlite-core
environment:
sdk: ^3.4.0

dependencies:
sqlite3: ^2.7.6
sqlite3: ^3.1.4
bson: ^5.0.5

dev_dependencies:
test: ^1.25.0
test_descriptor: ^2.0.2
file: ^7.0.1
sqlite3_test: ^0.1.1
sqlite3_test: ^0.2.0
fake_async: ^1.3.3
convert: ^3.1.2
meta: ^1.16.0
path: ^1.9.1
http: ^1.5.0
archive: ^4.0.7

# See https://pub.dev/documentation/sqlite3/latest/topics/hook-topic.html
hooks:
user_defines:
sqlite3:
source: source
path: ../crates/sqlite/sqlite/sqlite3.c
# Used in sync_test.dart to ensure the core extension dosn't leave any
# busy statements behind.
defines:
- SQLITE_ENABLE_STMTVTAB
Loading