mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-17 15:53:23 +02:00
fix(ci): test failures should fail the build (#3019)
The 'Check if tests exist' step was actually running tests with continue-on-error: true. If tests failed, it would set has-tests=false and skip the actual test step, making CI appear green even with failing tests. Simplified to use 'npm test --if-present' which: - Runs tests if a test script exists (and fails if tests fail) - Does nothing and exits 0 if no test script exists - Removes the need for the complex check logic Fixes the issue where PR #3014 had failing tests but CI was green.
This commit is contained in:
14
.github/workflows/typescript.yml
vendored
14
.github/workflows/typescript.yml
vendored
@@ -41,21 +41,9 @@ jobs:
|
||||
working-directory: src/${{ matrix.package }}
|
||||
run: npm ci
|
||||
|
||||
- name: Check if tests exist
|
||||
id: check-tests
|
||||
working-directory: src/${{ matrix.package }}
|
||||
run: |
|
||||
if npm run test --silent 2>/dev/null; then
|
||||
echo "has-tests=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "has-tests=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
continue-on-error: true
|
||||
|
||||
- name: Run tests
|
||||
if: steps.check-tests.outputs.has-tests == 'true'
|
||||
working-directory: src/${{ matrix.package }}
|
||||
run: npm test
|
||||
run: npm test --if-present
|
||||
|
||||
build:
|
||||
needs: [detect-packages, test]
|
||||
|
||||
Reference in New Issue
Block a user