Skip to content

Commit 064ca88

Browse files
authored
ci: split atlas and mongodb tests (#104)
1 parent 4702e00 commit 064ca88

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

.github/workflows/code_health.yaml

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ jobs:
3131
cache: "npm"
3232
- name: Install dependencies
3333
run: npm ci
34-
- name: Run style check
35-
run: npm run generate
34+
- run: npm run generate
3635

3736
run-tests:
3837
strategy:
@@ -44,6 +43,26 @@ jobs:
4443
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
4544
if: matrix.os != 'windows-latest'
4645
- uses: actions/checkout@v4
46+
- uses: actions/setup-node@v4
47+
with:
48+
node-version-file: package.json
49+
cache: "npm"
50+
- name: Install dependencies
51+
run: npm ci
52+
- name: Run tests
53+
run: npm test
54+
- name: Upload test results
55+
if: always() && matrix.os == 'ubuntu-latest'
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: test-results
59+
path: coverage/lcov.info
60+
61+
run-atlas-tests:
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
65+
- uses: actions/checkout@v4
4766
- uses: actions/setup-node@v4
4867
with:
4968
node-version-file: package.json
@@ -55,10 +74,40 @@ jobs:
5574
MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }}
5675
MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
5776
MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }}
58-
run: npm test
77+
run: npm test -- --testPathIgnorePatterns "tests/integration/tools/mongodb" --testPathIgnorePatterns "tests/integration/[^/]+\.ts"
78+
- name: Upload test results
79+
uses: actions/upload-artifact@v4
80+
if: always()
81+
with:
82+
name: atlas-test-results
83+
path: coverage/lcov.info
84+
coverage:
85+
runs-on: ubuntu-latest
86+
needs: [run-tests, run-atlas-tests]
87+
if: always()
88+
steps:
89+
- uses: actions/checkout@v4
90+
- uses: actions/setup-node@v4
91+
with:
92+
node-version-file: package.json
93+
cache: "npm"
94+
- name: Install dependencies
95+
run: npm ci
96+
- name: Download test results
97+
uses: actions/download-artifact@v4
98+
with:
99+
name: test-results
100+
path: coverage/mongodb
101+
- name: Download atlas test results
102+
uses: actions/download-artifact@v4
103+
with:
104+
name: atlas-test-results
105+
path: coverage/atlas
106+
- name: Merge coverage reports
107+
run: |
108+
npx -y lcov-result-merger "coverage/*/lcov.info" "coverage/lcov.info"
59109
- name: Coveralls GitHub Action
60110
uses: coverallsapp/[email protected]
61-
if: matrix.os == 'ubuntu-latest'
62111
with:
63112
file: coverage/lcov.info
64113
git-branch: ${{ github.head_ref || github.ref_name }}

0 commit comments

Comments
 (0)