Skip to content

Commit 0d14679

Browse files
feat(atlas-local): Split Atlas Local tests from Atlas (#552)
1 parent bb717ab commit 0d14679

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

.github/workflows/code_health.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
run: npm ci
3030
- name: Run tests
3131
run: npm test
32+
env:
33+
SKIP_ATLAS_LOCAL_TESTS: "true"
3234
- name: Upload test results
3335
if: always() && matrix.os == 'ubuntu-latest'
3436
uses: actions/upload-artifact@v4
@@ -54,19 +56,41 @@ jobs:
5456
MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }}
5557
MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
5658
MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }}
57-
run: npm test -- tests/integration/tools/atlas
59+
run: npm test -- tests/integration/tools/atlas/
5860
- name: Upload test results
5961
uses: actions/upload-artifact@v4
6062
if: always()
6163
with:
6264
name: atlas-test-results
6365
path: coverage/lcov.info
6466

67+
run-atlas-local-tests:
68+
name: Run Atlas Local tests
69+
if: github.event_name == 'push' || (github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository)
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
73+
- uses: actions/checkout@v5
74+
- uses: actions/setup-node@v4
75+
with:
76+
node-version-file: package.json
77+
cache: "npm"
78+
- name: Install dependencies
79+
run: npm ci
80+
- name: Run tests
81+
run: npm test -- tests/integration/tools/atlas-local/
82+
- name: Upload test results
83+
uses: actions/upload-artifact@v4
84+
if: always()
85+
with:
86+
name: atlas-local-test-results
87+
path: coverage/lcov.info
88+
6589
coverage:
6690
name: Report Coverage
6791
if: always() && (github.event_name == 'push' || (github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository))
6892
runs-on: ubuntu-latest
69-
needs: [run-tests, run-atlas-tests]
93+
needs: [run-tests, run-atlas-tests, run-atlas-local-tests]
7094
steps:
7195
- uses: actions/checkout@v5
7296
- uses: actions/setup-node@v4
@@ -85,6 +109,11 @@ jobs:
85109
with:
86110
name: atlas-test-results
87111
path: coverage/atlas
112+
- name: Download atlas local test results
113+
uses: actions/download-artifact@v5
114+
with:
115+
name: atlas-local-test-results
116+
path: coverage/atlas-local
88117
- name: Merge coverage reports
89118
run: |
90119
npx -y [email protected] "coverage/*/lcov.info" "coverage/lcov.info"

vitest.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const vitestDefaultExcludes = [
1010
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*",
1111
];
1212

13+
if (process.env.SKIP_ATLAS_LOCAL_TESTS === "true") {
14+
vitestDefaultExcludes.push("**/atlas-local/**");
15+
}
16+
1317
export default defineConfig({
1418
test: {
1519
environment: "node",

0 commit comments

Comments
 (0)