File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,10 @@ generator-integ-tests:
8484 # Generator tests
8585 - cd generator
8686 - dart pub get
87- - dart test
87+ # generator test suites must not run in parallel (see notes on GeneratorTestEnv):
88+ # Set concurrency=1 to run only one test suite (== test file) at a time.
89+ # Set --reporter expanded to print log for every completed test.
90+ - dart test --concurrency=1 --reporter expanded
8891 # ObjectBox tests
8992 - cd ../objectbox_test
9093 - ../install.sh
Original file line number Diff line number Diff line change @@ -13,6 +13,14 @@ import 'package:test/test.dart';
1313/// Helps testing the generator by running [EntityResolver] on the given
1414/// [source] file and feeding the output directly into [CodeBuilder] and running
1515/// it.
16+ ///
17+ /// Warning: tests that use this or otherwise create files in the `lib` folder
18+ /// should not run in parallel as this might break when reading unexpected
19+ /// files from the `lib` source folder (see [run] which calls
20+ /// `TestReaderWriter.testing.loadIsolateSources()` and reads/deletes the model
21+ /// JSON file). So make sure tests are in the same test suite (`main()` method)
22+ /// and use `dart test --concurrency=1` .
23+ /// See also https://pub.dev/packages/test#test-concurrency.
1624class GeneratorTestEnv {
1725 final EntityResolver resolver;
1826 final Config config;
You can’t perform that action at this time.
0 commit comments