Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fixes and small adjustments #34

Merged
merged 9 commits into from
Mar 27, 2024
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
22 changes: 15 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ jobs:
verify_version:
name: Verify version matches release
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
sdk: [3.0.0]
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Verify release version
run: |
dart pub get
flutter pub get
dart tool/verify_release_version.dart ${{ github.ref_name }}
working-directory: packages/isar

Expand Down Expand Up @@ -56,7 +62,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Set env
Expand All @@ -81,16 +87,18 @@ jobs:
needs: build_binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Build
run: flutter build web --base-href /${{ github.ref_name }}/
working-directory: packages/isar_inspector
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: packages/isar_inspector/build/web
repository-name: isar/inspector
repository-name: isar-community/inspector
token: ${{ secrets.TOKEN }}
target-folder: ${{ github.ref_name }}
clean: false
Expand All @@ -100,7 +108,7 @@ jobs:
# needs: build_inspector
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
# - uses: subosito/flutter-action@v2
# - name: pub get
# run: dart pub get
Expand Down
76 changes: 56 additions & 20 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,26 @@ on:
- v3

jobs:
version:
name: Version Display
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- run: flutter --version

format:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ secrets.FLUTTER_VERSION }}
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Check formatting
run: dart format --set-exit-if-changed .

Expand All @@ -26,11 +37,11 @@ jobs:
runs-on: ubuntu-latest
if: ${{ false }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ secrets.FLUTTER_VERSION }}
flutter-version: ${{ vars.FLUTTER_VERSION }}
- run: flutter pub get
working-directory: packages/isar
- run: flutter pub get
Expand All @@ -39,6 +50,8 @@ jobs:
working-directory: packages/isar_generator
- run: flutter pub get
working-directory: packages/isar_inspector
- run: flutter pub get
working-directory: examples/pub
- run: |
flutter pub get
flutter pub run build_runner build
Expand All @@ -56,8 +69,10 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- run: echo "$OSTYPE"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -73,8 +88,10 @@ jobs:
runs-on: ubuntu-latest
if: ${{ false }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Install valgrind and llvm
Expand All @@ -99,8 +116,10 @@ jobs:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand Down Expand Up @@ -134,8 +153,10 @@ jobs:
name: Generator Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Run Generator Unit tests
run: |
dart pub get
Expand All @@ -146,12 +167,14 @@ jobs:
name: Integration Test iOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Start simulator
uses: futureware-tech/simulator-action@v2
with:
model: iPhone 13
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -168,12 +191,14 @@ jobs:
name: Integration Test Android
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "zulu"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -200,10 +225,11 @@ jobs:
name: Integration Test macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.3.10" # https://github.com/flutter/flutter/issues/118469
# flutter-version: "3.3.10" # https://github.com/flutter/flutter/issues/118469
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -215,16 +241,18 @@ jobs:
run: sh tool/prepare_tests.sh
- name: Run Flutter Driver tests
run: |
flutter config --enable-macos-desktop
flutter config --enable-macos-desktop
flutter test -d macos integration_test/integration_test.dart --dart-define STRESS=true
working-directory: packages/isar_test

integration_test_linux:
name: Integration Test Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Install Linux requirements
Expand All @@ -239,7 +267,7 @@ jobs:
run: sh tool/prepare_tests.sh
- name: Run Flutter Driver tests
run: |
flutter config --enable-linux-desktop
flutter config --enable-linux-desktop
flutter test -d linux integration_test/integration_test.dart --dart-define STRESS=true
working-directory: packages/isar_test

Expand All @@ -248,8 +276,10 @@ jobs:
runs-on: windows-2019
if: ${{ false }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -260,16 +290,18 @@ jobs:
run: sh tool/prepare_tests.sh
- name: Run Flutter Driver tests
run: |
flutter config --enable-windows-desktop
flutter config --enable-windows-desktop
flutter test -d windows integration_test/integration_test.dart --dart-define STRESS=true
working-directory: packages/isar_test

drive_chrome:
runs-on: ubuntu-latest
if: ${{ false }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Install chromedricer
uses: nanasess/setup-chromedriver@v1
- name: Prepare chromedricer
Expand All @@ -287,8 +319,10 @@ jobs:
runs-on: macos-latest
if: ${{ false }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Prepare safaridricer
run: |
sudo safaridriver --enable
Expand All @@ -306,8 +340,10 @@ jobs:
runs-on: ubuntu-latest
if: ${{ false }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Install geckodriver
uses: browser-actions/setup-geckodriver@latest
- name: Prepare geckodriver
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/testlab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ jobs:
name: Firebase Testlab Android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core arm64
Expand Down Expand Up @@ -36,12 +38,12 @@ jobs:
- name: Run tests
run: |
gcloud firebase test android run \
--project honeyy \
--project isar-community \
--type instrumentation \
--timeout 5m \
--device model=hammerhead,version=23 \
--device model=starqlteue,version=26 \
--device model=cheetah,version=33 \
--app build/app/outputs/apk/debug/app-debug.apk \
--test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk
working-directory: packages/isar_test
working-directory: packages/isar_test
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"packages/isar_core",
"packages/isar_core_ffi",
Expand Down
10 changes: 5 additions & 5 deletions packages/isar/lib/src/native/bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2024,8 +2024,8 @@ class IsarCoreBindings {
}

late final _isar_q_aggregate_long_resultPtr = _lookup<
ffi
.NativeFunction<ffi.Int64 Function(ffi.Pointer<CAggregationResult>)>>(
ffi.NativeFunction<
ffi.Int64 Function(ffi.Pointer<CAggregationResult>)>>(
'isar_q_aggregate_long_result');
late final _isar_q_aggregate_long_result = _isar_q_aggregate_long_resultPtr
.asFunction<int Function(ffi.Pointer<CAggregationResult>)>();
Expand Down Expand Up @@ -2088,9 +2088,9 @@ class IsarCoreBindings {
}

late final _isar_txn_finishPtr = _lookup<
ffi
.NativeFunction<ffi.Int64 Function(ffi.Pointer<CIsarTxn>, ffi.Bool)>>(
'isar_txn_finish');
ffi.NativeFunction<
ffi.Int64 Function(
ffi.Pointer<CIsarTxn>, ffi.Bool)>>('isar_txn_finish');
late final _isar_txn_finish = _isar_txn_finishPtr
.asFunction<int Function(ffi.Pointer<CIsarTxn>, bool)>();

Expand Down
7 changes: 5 additions & 2 deletions packages/isar/lib/src/native/isar_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const nullBool = IsarObject_NULL_BOOL;
const falseBool = IsarObject_FALSE_BOOL;
const trueBool = IsarObject_TRUE_BOOL;

const String _githubUrl = 'https://github.com/isar-community/isar/releases/download';
const String _githubUrl =
'https://github.com/isar-community/isar/releases/download';

bool _isarInitialized = false;

Expand Down Expand Up @@ -119,7 +120,9 @@ String _getLibraryDownloadPath(Map<Abi, String> libraries) {
if (Platform.script.path.isEmpty) {
return name;
}
var dir = Platform.script.pathSegments.sublist(0, Platform.script.pathSegments.length - 1).join(Platform.pathSeparator);
var dir = Platform.script.pathSegments
.sublist(0, Platform.script.pathSegments.length - 1)
.join(Platform.pathSeparator);
if (!Platform.isWindows) {
// Not on windows, add leading platform path separator
dir = '${Platform.pathSeparator}$dir';
Expand Down
2 changes: 1 addition & 1 deletion packages/isar/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ dependencies:
meta: ^1.7.0

dev_dependencies:
ffigen: ">=6.1.2 <8.0.0"
ffigen: "^7.0.0"
test: ^1.21.1
very_good_analysis: ^3.0.1
2 changes: 1 addition & 1 deletion packages/isar_flutter_libs/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
sdk: flutter
isar:
version: 3.1.4
hosted: https://isar-community.dev/
hosted: https://isar-community.dev

flutter:
plugin:
Expand Down
4 changes: 2 additions & 2 deletions packages/isar_flutter_libs/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependency_overrides:
isar:
path: ../isar
isar:
path: ../isar
Loading
Loading