Explorar o código

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
Andrew Rumble hai 9 meses
pai
achega
c7c15b2066

+ 0 - 0
services/web/test/unit/src/History/HistoryManager.test.mjs → services/web/test/unit/src/History/HistoryManager.sequential.test.mjs


+ 25 - 4
services/web/vitest.config.js

@@ -17,13 +17,34 @@ if (process.env.CI && process.env.MOCHA_ROOT_SUITE_NAME) {
 }
 }
 module.exports = defineConfig({
 module.exports = defineConfig({
   test: {
   test: {
-    include: [
-      'modules/*/test/unit/**/*.test.mjs',
-      'test/unit/src/**/*.test.mjs',
-    ],
     setupFiles: ['./test/unit/vitest_bootstrap.mjs'],
     setupFiles: ['./test/unit/vitest_bootstrap.mjs'],
     globals: true,
     globals: true,
     isolate: false,
     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,
     ...reporterOptions,
   },
   },
 })
 })