Skip to content
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

Fix: CircleCI check should fail if unit tests fail #709

Merged
merged 2 commits into from
Dec 23, 2022

Conversation

willvedd
Copy link
Contributor

@willvedd willvedd commented Dec 23, 2022

🔧 Changes

Currently, our unit test suite is failing but gets marked as a pass in CircleCi. The npm run test:coverage is a composition of two commands, running unit tests and generating test coverage. These two commands are joined by a semicolon (;) which means that the exit code of the first command is essentially ignored in favor of the test coverage command, which rarely exits with a non-zero code. Instead, these commands should be joined with && to signal an error if either two of the commands returns a non-zero exit code. Example of tests failing in CI but passing the stage.

📚 References

Example

🔬 Testing

Running npm run test:coverage followed by echo $? to verify the exit code of the resulting change.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@willvedd willvedd requested a review from a team as a code owner December 23, 2022 16:16
@willvedd willvedd changed the title Joining commands in test:coverage script by && instead of ; Fix: CircleCI check should fail if unit tests fail Dec 23, 2022
@willvedd
Copy link
Contributor Author

Because the current master branch has a couple of failing tests, this PR should now fail the CircleCI unit test stage. It should pass once the corrections of unit tests are fixed with #708 .

@willvedd willvedd enabled auto-merge (squash) December 23, 2022 21:06
@willvedd willvedd merged commit 8d44582 into master Dec 23, 2022
@willvedd willvedd deleted the fix-circle-should-fail-if-tests-fail branch December 23, 2022 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants