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 20 additions and 20 deletions
Showing only changes of commit 2550eaa9b9 - Show all commits
+4 -4
View File
@@ -40,13 +40,13 @@ jobs:
echo "CPU info: $(sysctl -n machdep.cpu.brand_string || uname -m)"
- run: |
echo "Running tests with CI optimizations..."
# Run tests in smaller batches to reduce memory pressure
# Run tests in smaller batches to avoid resource contention
echo "Running unit tests..."
npm test -- tests/unit/ --reporter=verbose --run --bail=1
npm test -- tests/unit/ --run --reporter=verbose --no-coverage --maxConcurrency=1
echo "Running integration tests..."
npm test -- tests/integration/ --reporter=verbose --run --bail=1
npm test -- tests/integration/ --run --reporter=verbose --no-coverage --maxConcurrency=1
echo "Running accessibility tests..."
npm test -- tests/accessibility/ --reporter=verbose --run --bail=1
npm test -- tests/accessibility/ --run --reporter=verbose --no-coverage --maxConcurrency=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
+16 -16
View File
@@ -44,24 +44,24 @@ export default defineConfig({
// Disable coverage collection in CI to prevent test failures
enabled: !process.env.CI,
},
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
// CI optimizations
maxConcurrency: process.env.CI ? 1 : 5, // Single test at a time in CI
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
pool: "threads", // Use threads for better performance
testTimeout: 60000, // 60s timeout for all tests
hookTimeout: 60000, // 60s timeout for hooks
teardownTimeout: 60000, // 60s timeout for teardown
// Conservative settings for stability
maxConcurrency: 1, // Single test at a time to avoid resource contention
maxThreads: 1, // Single thread to avoid resource contention
minThreads: 1, // Minimum threads
retry: 0, // No retries to avoid masking issues
// Stability measures
isolate: true, // Enable isolation for better test stability
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
// Timeout settings
workerTimeout: 120000, // 2min for worker timeout
poolTimeout: 120000, // 2min for pool timeout
// Optimize dependencies
deps: {
inline: process.env.CI ? [] : undefined, // Don't inline dependencies in CI
inline: ["@testing-library/jest-dom"], // Inline testing library
},
},
});