Skip to content

CI: CI-Test-Result should fail depending on unit tests#33643

Merged
yatinappsmith merged 2 commits intoreleasefrom
CI/ci-test-result-check
May 27, 2024
Merged

CI: CI-Test-Result should fail depending on unit tests#33643
yatinappsmith merged 2 commits intoreleasefrom
CI/ci-test-result-check

Conversation

@yatinappsmith
Copy link
Contributor

CI-Test-Result should fail depending on unit tests

@yatinappsmith yatinappsmith requested a review from trishaanand May 22, 2024 07:19
@yatinappsmith yatinappsmith requested a review from sharat87 as a code owner May 22, 2024 07:19
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 22, 2024

Walkthrough

Walkthrough

The 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

Files Change Summary
.github/workflows/test-build-docker-image.yml Expanded conditional checks to encompass client and server unit test results, enriching status messages based on test outcomes.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 064ef06 and 8d1f86e.
Files selected for processing (1)
  • .github/workflows/test-build-docker-image.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test-build-docker-image.yml

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Comment on lines +266 to +283
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@yatinappsmith yatinappsmith requested a review from trishaanand May 23, 2024 05:07
@yatinappsmith yatinappsmith merged commit cf5b36a into release May 27, 2024
@yatinappsmith yatinappsmith deleted the CI/ci-test-result-check branch May 27, 2024 09:50
@coderabbitai coderabbitai bot mentioned this pull request Mar 4, 2025
2 tasks
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.

3 participants