Skip to content

Commit 3bddbf5

Browse files
committed
test: split tests on ci
1 parent fa2fdd6 commit 3bddbf5

File tree

3 files changed

+98
-3
lines changed

3 files changed

+98
-3
lines changed

.github/workflows/code_health.yaml

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,26 @@ jobs:
4444
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
4545
if: matrix.os != 'windows-latest'
4646
- uses: actions/checkout@v4
47+
- uses: actions/setup-node@v4
48+
with:
49+
node-version-file: package.json
50+
cache: "npm"
51+
- name: Install dependencies
52+
run: npm ci
53+
- name: Run tests
54+
run: npm test
55+
- name: Upload test results
56+
if: matrix.os == 'ubuntu-latest'
57+
uses: actions/upload-artifact@v3
58+
with:
59+
name: test-results
60+
path: coverage/lcov.info
61+
62+
run-atlas-tests:
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
66+
- uses: actions/checkout@v4
4767
- uses: actions/setup-node@v4
4868
with:
4969
node-version-file: package.json
@@ -55,11 +75,38 @@ jobs:
5575
MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }}
5676
MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
5777
MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }}
58-
run: npm test
78+
run: npm test -- --testPathIgnorePatterns "mongodb"
79+
- name: Upload test results
80+
uses: actions/upload-artifact@v3
81+
with:
82+
name: atlas-test-results
83+
path: coverage/lcov.info
84+
coverage:
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v4
88+
- uses: actions/setup-node@v4
89+
with:
90+
node-version-file: package.json
91+
cache: "npm"
92+
- name: Install dependencies
93+
run: npm ci
94+
- name: Download test results
95+
uses: actions/download-artifact@v4
96+
with:
97+
name: test-results
98+
path: coverage/mongodb
99+
- name: Download atlas test results
100+
uses: actions/download-artifact@v4
101+
with:
102+
name: atlas-test-results
103+
path: coverage/atlas
104+
- name: Merge coverage reports
105+
run: |
106+
lcov-result-merger coverage/mongodb/lcov.info coverage/atlas/lcov.info coverage/lcov.info
59107
- name: Coveralls GitHub Action
60108
uses: coverallsapp/github-action@v2.3.6
61-
if: matrix.os == 'ubuntu-latest'
62109
with:
63110
file: coverage/lcov.info
64111
git-branch: ${{ github.head_ref || github.ref_name }}
65-
git-commit: ${{ github.event.pull_request.head.sha || github.sha }}
112+
git-commit: ${{ github.event.pull_request.head.sha || github.sha }}

package-lock.json

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"jest": "^29.7.0",
4747
"jest-environment-node": "^29.7.0",
4848
"jest-extended": "^4.0.2",
49+
"lcov-result-merger": "^5.0.1",
4950
"mongodb-runner": "^5.8.2",
5051
"openapi-types": "^12.1.3",
5152
"openapi-typescript": "^7.6.1",

0 commit comments

Comments
 (0)