CI: CI-Test-Result should fail depending on unit tests#33643
CI: CI-Test-Result should fail depending on unit tests#33643yatinappsmith merged 2 commits intoreleasefrom
Conversation
WalkthroughWalkthroughThe update improves the GitHub Actions workflow for Docker image building and testing by extending the conditional checks to cover client and server unit test results in addition to integration test results. This enhancement enables more detailed status messages reflecting the test outcomes. Changes
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
| if [[ "${{ needs.ci-test.result }}" == "success" || "${{ needs.client-unit-tests.result }}" == "success" ||"${{ needs.server-unit-tests.result }}" == "success" ]]; then | ||
| echo "Integration, Client unit and Server unit tests completed successfully!"; | ||
| exit 0; | ||
| elif [[ "${{ needs.ci-test.result }}" == "skipped" ]]; then | ||
| echo "Integration tests were skipped"; | ||
| exit 1; | ||
| elif [[ "${{ needs.client-unit-tests.result }}" == "skipped" ]]; then | ||
| echo "Client unit tests were skipped"; | ||
| exit 1; | ||
| elif [[ "${{ needs.server-unit-tests.result }}" == "skipped" ]]; then | ||
| echo "Server unit tests were skipped"; | ||
| exit 1; | ||
| elif [[ "${{ needs.client-unit-tests.result }}" == "failure" ]]; then | ||
| echo "Client unit tests have failed"; | ||
| exit 1; | ||
| elif [[ "${{ needs.server-unit-tests.result }}" == "failure" ]]; then | ||
| echo "Server unit tests have failed"; | ||
| exit 1; |
There was a problem hiding this comment.
Ensure consistent exit codes for skipped and failed tests.
The logic for handling test results in the CI pipeline has been updated to include client and server unit tests. However, the exit codes for skipped and failed tests are inconsistent. For skipped tests, the exit code is 1, which typically indicates a failure in Unix-like systems. This might be misleading as 'skipped' does not necessarily mean 'failed'. It would be more appropriate to use a different exit code or handle skipped tests differently to avoid confusion.
Consider using a distinct exit code for skipped tests or revising the handling logic to better reflect the actual test outcomes.
CI-Test-Result should fail depending on unit tests