Try splitting up unit and integration tests
CI Pipeline / test (20) (pull_request) Successful in 2m51s
CI Pipeline / test (18) (pull_request) Successful in 3m9s
CI Pipeline / e2e (chromium) (pull_request) Successful in 3m6s
CI Pipeline / e2e (firefox) (pull_request) Successful in 4m13s
CI Pipeline / e2e (webkit) (pull_request) Successful in 3m35s
CI Pipeline / performance (pull_request) Successful in 2m37s
CI Pipeline / storybook (pull_request) Successful in 1m24s
CI Pipeline / lint (pull_request) Successful in 1m9s
CI Pipeline / build (pull_request) Successful in 1m22s
CI Pipeline / visual-regression (pull_request) Successful in 3m51s
CI Pipeline / test (20) (pull_request) Successful in 2m51s
CI Pipeline / test (18) (pull_request) Successful in 3m9s
CI Pipeline / e2e (chromium) (pull_request) Successful in 3m6s
CI Pipeline / e2e (firefox) (pull_request) Successful in 4m13s
CI Pipeline / e2e (webkit) (pull_request) Successful in 3m35s
CI Pipeline / performance (pull_request) Successful in 2m37s
CI Pipeline / storybook (pull_request) Successful in 1m24s
CI Pipeline / lint (pull_request) Successful in 1m9s
CI Pipeline / build (pull_request) Successful in 1m22s
CI Pipeline / visual-regression (pull_request) Successful in 3m51s
This commit is contained in:
@@ -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
@@ -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
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user