-
Notifications
You must be signed in to change notification settings - Fork 41
ci: split atlas and mongodb tests #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3bddbf5
test: split tests on ci
fmenezes e9479c3
fix: ci dependency
fmenezes 2525fef
fix: upload action
fmenezes 748a77f
fix: upload action
fmenezes cbbe04b
fix: patterns
fmenezes d81000d
fix: styles
fmenezes 1efe75b
fix: test name
fmenezes fc2bcc1
fix: install tool
fmenezes 080baae
fix: merge
fmenezes b28a839
fix: address comments
fmenezes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,8 +31,7 @@ jobs: | |
cache: "npm" | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run style check | ||
run: npm run generate | ||
- run: npm run generate | ||
|
||
run-tests: | ||
strategy: | ||
|
@@ -44,6 +43,26 @@ jobs: | |
- uses: GitHubSecurityLab/actions-permissions/monitor@v1 | ||
if: matrix.os != 'windows-latest' | ||
- uses: actions/checkout@v4 | ||
- 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 | ||
- name: Upload test results | ||
if: always() && matrix.os == 'ubuntu-latest' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results | ||
path: coverage/lcov.info | ||
|
||
run-atlas-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: GitHubSecurityLab/actions-permissions/monitor@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: package.json | ||
|
@@ -55,10 +74,40 @@ 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 | ||
run: npm test -- --testPathIgnorePatterns "tests/integration/tools/mongodb" --testPathIgnorePatterns "tests/integration/[^/]+\.ts" | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: atlas-test-results | ||
path: coverage/lcov.info | ||
coverage: | ||
runs-on: ubuntu-latest | ||
needs: [run-tests, run-atlas-tests] | ||
if: always() | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: package.json | ||
cache: "npm" | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Download test results | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: test-results | ||
path: coverage/mongodb | ||
- name: Download atlas test results | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: atlas-test-results | ||
path: coverage/atlas | ||
- name: Merge coverage reports | ||
run: | | ||
npx -y lcov-result-merger "coverage/*/lcov.info" "coverage/lcov.info" | ||
- name: Coveralls GitHub Action | ||
uses: coverallsapp/[email protected] | ||
if: matrix.os == 'ubuntu-latest' | ||
with: | ||
file: coverage/lcov.info | ||
git-branch: ${{ github.head_ref || github.ref_name }} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runs coverage even if one of the tests fails (say mongodb tests pass and altas fails, it will still compute coverage)