Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/code-health-long-running.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Code Health Long Running Tests
on:
push:
branches:
- main
workflow_dispatch: # Allow manual triggering of the workflow in feature branches

permissions: {}

jobs:
run-long-running-tests:
name: Run long running tests
if: github.event_name == 'push' || (github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run tests
env:
MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }}
MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }}
run: npm test -- tests/integration/tools/atlas --project=long-running-tests
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: atlas-test-results
path: coverage/lcov.info
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"test": "vitest --project eslint-rules --project unit-and-integration --coverage",
"pretest:accuracy": "npm run build",
"test:accuracy": "sh ./scripts/accuracy/runAccuracyTests.sh",
"test:long-running-tests": "vitest --project long-running-tests --coverage",
"atlas:cleanup": "vitest --project atlas-cleanup"
},
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const defaultTestConfig: UserConfig = {
loggers: ["stderr"],
};

export const DEFAULT_LONG_RUNNING_TEST_WAIT_TIMEOUT_MS = 900_000;
export const DEFAULT_LONG_RUNNING_TEST_WAIT_TIMEOUT_MS = 1_200_000;

export function setupIntegrationTest(
getUserConfig: () => UserConfig,
Expand Down
13 changes: 12 additions & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const vitestDefaultExcludes = [
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*",
];

const longRunningTests = ["tests/integration/tools/atlas/performanceAdvisor.test.ts"];

if (process.env.SKIP_ATLAS_TESTS === "true") {
vitestDefaultExcludes.push("**/atlas/**");
}
Expand All @@ -34,7 +36,7 @@ export default defineConfig({
test: {
name: "unit-and-integration",
include: ["**/*.test.ts"],
exclude: [...vitestDefaultExcludes, "scripts/**", "tests/accuracy/**"],
exclude: [...vitestDefaultExcludes, "scripts/**", "tests/accuracy/**", ...longRunningTests],
},
},
{
Expand All @@ -58,6 +60,15 @@ export default defineConfig({
include: ["scripts/cleanupAtlasTestLeftovers.test.ts"],
},
},
{
extends: true,
test: {
name: "long-running-tests",
include: [...longRunningTests],
testTimeout: 7200000, // 2 hours for long-running tests
hookTimeout: 7200000,
},
},
],
},
});
Loading