Split tests into sequential and parallel projects

Sequential tests need to be run without parallelism because they rely on
a database fixture that can have side effects.

GitOrigin-RevId: b614cbe4dbaf2319e681d5607a0a64cbbed8c021
This commit is contained in:
Andrew Rumble
2025-10-29 11:42:10 +00:00
committed by Copybot
parent 4f02a85aa4
commit c7c15b2066
2 changed files with 25 additions and 4 deletions

View File

@@ -17,13 +17,34 @@ if (process.env.CI && process.env.MOCHA_ROOT_SUITE_NAME) {
}
module.exports = defineConfig({
test: {
include: [
'modules/*/test/unit/**/*.test.mjs',
'test/unit/src/**/*.test.mjs',
],
setupFiles: ['./test/unit/vitest_bootstrap.mjs'],
globals: true,
isolate: false,
projects: [
{
extends: true,
test: {
name: 'Parallel',
include: [
'modules/*/test/unit/**/*.test.mjs',
'test/unit/src/**/*.test.mjs',
],
exclude: ['**/*.sequential.test.mjs'],
fileParallelism: true,
},
},
{
extends: true,
test: {
name: 'Sequential',
include: [
'modules/*/test/unit/**/*.sequential.test.mjs',
'test/unit/src/**/*.sequential.test.mjs',
],
fileParallelism: false,
},
},
],
...reporterOptions,
},
})