Content Page #19

Merged
an.di merged 48 commits from adilallo/feature/Blog into main 2025-09-18 15:44:46 +00:00
2 changed files with 19 additions and 4 deletions
Showing only changes of commit 9ca35b8c02 - Show all commits
+9 -3
View File
@@ -18,8 +18,8 @@ jobs:
VITEST_MAX_CONCURRENCY: 1
VITEST_MAX_THREADS: 1
VITEST_MIN_THREADS: 1
VITEST_POOL: "threads"
VITEST_POOL_OPTIONS: '{"threads":{"singleThread":true}}'
VITEST_POOL: "vmThreads"
VITEST_POOL_OPTIONS: '{"vmThreads":{"singleThread":true}}'
VITEST_LOG_LEVEL: "info"
DEBUG: "vitest:*"
VITEST_WORKER_TIMEOUT: "300000"
@@ -40,7 +40,13 @@ jobs:
echo "CPU info: $(sysctl -n machdep.cpu.brand_string || uname -m)"
- run: |
echo "Running tests with CI optimizations..."
npm test -- --reporter=verbose --no-coverage --run
# Run tests in smaller batches to reduce memory pressure
echo "Running unit tests..."
npm test -- tests/unit/ --reporter=verbose --run --bail=1
echo "Running integration tests..."
npm test -- tests/integration/ --reporter=verbose --run --bail=1
echo "Running accessibility tests..."
npm test -- tests/accessibility/ --reporter=verbose --run --bail=1
# If the Codecov Action fails on Gitea, replace this with the bash uploader below
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
+10 -1
View File
@@ -41,8 +41,10 @@ export default defineConfig({
"**/build/**",
],
thresholds: { lines: 50, functions: 50, statements: 50, branches: 50 },
// Disable coverage collection in CI to prevent test failures
enabled: !process.env.CI,
},
pool: process.env.CI ? "forks" : "threads", // Use forks in CI for better stability
pool: process.env.CI ? "vmThreads" : "threads", // Use vmThreads in CI for better isolation
testTimeout: process.env.CI ? 180000 : 30000, // 180s for CI, 30s for local
hookTimeout: process.env.CI ? 180000 : 30000, // 180s for CI, 30s for local
teardownTimeout: process.env.CI ? 180000 : 30000, // 180s for CI, 30s for local
@@ -51,8 +53,15 @@ export default defineConfig({
maxThreads: process.env.CI ? 1 : 4, // Single thread in CI
minThreads: process.env.CI ? 1 : 2, // Minimum threads in CI
retry: process.env.CI ? 3 : 0, // More retries in CI
// Additional stability measures
isolate: process.env.CI ? true : false, // Better isolation in CI
passWithNoTests: true, // Don't fail if no tests found
// Additional CI timeout settings
workerTimeout: process.env.CI ? 300000 : 60000, // 5min for CI, 1min for local
poolTimeout: process.env.CI ? 300000 : 60000, // 5min for CI, 1min for local
// Disable problematic features in CI
deps: {
inline: process.env.CI ? [] : undefined, // Don't inline dependencies in CI
},
},
});