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
33 changes: 31 additions & 2 deletions .github/workflows/code_health.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
run: npm ci
- name: Run tests
run: npm test
env:
SKIP_ATLAS_LOCAL_TESTS: "true"
- name: Upload test results
if: always() && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
Expand All @@ -54,19 +56,41 @@ jobs:
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
run: npm test -- tests/integration/tools/atlas/
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: atlas-test-results
path: coverage/lcov.info

run-atlas-local-tests:
name: Run Atlas Local 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@v4
with:
node-version-file: package.json
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test -- tests/integration/tools/atlas-local/
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: atlas-local-test-results
path: coverage/lcov.info

coverage:
name: Report Coverage
if: always() && (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
needs: [run-tests, run-atlas-tests]
needs: [run-tests, run-atlas-tests, run-atlas-local-tests]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
Expand All @@ -85,6 +109,11 @@ jobs:
with:
name: atlas-test-results
path: coverage/atlas
- name: Download atlas local test results
uses: actions/download-artifact@v5
with:
name: atlas-local-test-results
path: coverage/atlas-local
- name: Merge coverage reports
run: |
npx -y [email protected] "coverage/*/lcov.info" "coverage/lcov.info"
Expand Down
4 changes: 4 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const vitestDefaultExcludes = [
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*",
];

if (process.env.SKIP_ATLAS_LOCAL_TESTS === "true") {
vitestDefaultExcludes.push("**/atlas-local/**");
}

export default defineConfig({
test: {
environment: "node",
Expand Down
Loading