diff --git a/.github/workflows/code_health.yaml b/.github/workflows/code_health.yaml index 9b79cba0d..897e0bdec 100644 --- a/.github/workflows/code_health.yaml +++ b/.github/workflows/code_health.yaml @@ -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 @@ -54,7 +56,7 @@ 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() @@ -62,11 +64,33 @@ jobs: 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 @@ -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 lcov-result-merger@5.0.1 "coverage/*/lcov.info" "coverage/lcov.info" diff --git a/vitest.config.ts b/vitest.config.ts index 903a174af..388e54792 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -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",