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

ci: split system tests in two job #22080

Merged
merged 1 commit into from
Oct 3, 2024
Merged

ci: split system tests in two job #22080

merged 1 commit into from
Oct 3, 2024

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Oct 3, 2024

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features
    • Introduced a dedicated job for version 2 system tests, enhancing testing capabilities.
  • Bug Fixes
    • Streamlined the testing workflow by removing redundant jobs and clarifying organization.
  • Documentation
    • Updated comments in the workflow to indicate the relocation of version 2 system tests.

@julienrbrt julienrbrt added the backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release label Oct 3, 2024
Copy link
Contributor

coderabbitai bot commented Oct 3, 2024

📝 Walkthrough

Walkthrough

The changes in this pull request involve modifications to the GitHub Actions workflows for testing within the Cosmos SDK. The test-system job has been removed from .github/workflows/test.yml, and a new job, test-system-v2, has been introduced in .github/workflows/v2-test.yml. This new job is designed to run system tests specifically for version 2 and includes steps for dependency management, change detection, and artifact handling. The workflow structure remains intact, focusing on various testing components.

Changes

File Path Change Summary
.github/workflows/test.yml Removed test-system job; added comment indicating v2 system tests are in v2-test.yml.
.github/workflows/v2-test.yml Introduced test-system-v2 job with steps for checking out the repo, setting up Go, and running system tests.

Possibly related PRs

Suggested labels

Type: CI

Suggested reviewers

  • sontrinh16
  • akhilkumarpilli

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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

@testinginprod testinginprod left a comment

Choose a reason for hiding this comment

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

lgtm

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

🧹 Outside diff range and nitpick comments (3)
.github/workflows/v2-test.yml (3)

127-137: LGTM: Comprehensive diff check, with a minor suggestion

The get-diff-action step is well-configured to detect changes in relevant files across the repository. This is crucial for optimizing the workflow by running subsequent steps only when necessary.

Consider adding **/*.proto to the PATTERNS if your project uses Protocol Buffers, as changes in these files might also require running the system tests.


138-141: LGTM: Conditional musl installation looks good

The step to install the musl library is correctly conditioned on detected changes, which is an efficient approach. This is necessary for building the simd binary in a Docker environment.

Consider caching the musl installation to speed up future workflow runs. You can use GitHub Actions' cache action for this purpose.


146-151: LGTM: Artifact upload on failure is a good practice

The artifact upload step is well-configured to run only on failure, which is excellent for debugging purposes. The 3-day retention period for the testnet setup files is reasonable for temporary debug artifacts.

Consider adding a step to notify the team (e.g., via Slack or email) when this artifact is uploaded, as it indicates a test failure that requires attention.

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between adb4c5a and 22cfb91.

📒 Files selected for processing (2)
  • .github/workflows/test.yml (1 hunks)
  • .github/workflows/v2-test.yml (1 hunks)
🔇 Additional comments (3)
.github/workflows/v2-test.yml (2)

113-126: LGTM: Job definition and setup steps are well-configured

The new test-system-v2 job is properly defined with appropriate setup steps. Fetching tags and setting up Go with caching for both simapp/v2 and systemtest are good practices that should improve the workflow's efficiency.


113-151: Summary: Changes align well with PR objectives

The introduction of the test-system-v2 job successfully achieves the PR's objective of splitting system tests into a separate job. This new job is well-structured with appropriate steps for environment setup, test execution, and artifact management. The conditional execution based on detected changes helps optimize the workflow's efficiency.

These changes should improve the organization and potentially the speed of the CI pipeline, especially for PRs that don't affect system test-related files.

To ensure this change doesn't negatively impact other parts of the workflow, please verify that:

  1. The new job is correctly integrated into any workflow dependencies.
  2. The overall workflow completion time is not significantly increased.

You may want to run this workflow a few times on test branches to gather performance metrics.

.github/workflows/test.yml (1)

Line range hint 147-172: Verify the removal of v2 system tests from this job.

The changes to the test-system job appear to remove the v2 system tests from this workflow. A comment has been added indicating that v2 system tests are now in a separate file named v2-test.yml. This change likely aims to improve the organization and potentially the performance of the CI pipeline.

However, to ensure the completeness of the testing process:

  1. Confirm that the v2-test.yml file exists and contains the removed v2 system tests.
  2. Verify that the v2-test.yml workflow is properly configured to run as part of the CI process.
  3. Ensure that any dependencies or setup steps required for v2 system tests are properly migrated to the new file.

To verify these points, you can run the following script:

This script will help verify the existence and basic configuration of the v2-test.yml file.

✅ Verification successful

v2 System Tests Successfully Separated

The v2-test.yml file exists, contains system tests, and is configured to run on similar events as the main workflow. No additional dependencies related to v2 system tests were found in test.yml, indicating a successful separation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash

# Check if v2-test.yml exists
if [ -f ".github/workflows/v2-test.yml" ]; then
    echo "v2-test.yml file exists."
    
    # Check if v2-test.yml contains system tests
    if grep -q "system tests" .github/workflows/v2-test.yml; then
        echo "v2-test.yml contains system tests."
    else
        echo "Warning: v2-test.yml does not seem to contain system tests."
    fi
    
    # Check if v2-test.yml is configured to run on similar events
    if grep -q "pull_request:" .github/workflows/v2-test.yml && \
       grep -q "push:" .github/workflows/v2-test.yml && \
       grep -q "branches:" .github/workflows/v2-test.yml; then
        echo "v2-test.yml is configured to run on similar events."
    else
        echo "Warning: v2-test.yml may not be configured to run on the same events as the main workflow."
    fi
else
    echo "Error: v2-test.yml file not found in .github/workflows/ directory."
fi

Length of output: 498


Script:

#!/bin/bash

# Extract setup steps related to v2 system tests from test.yml
v2_dependencies=$(ast-grep --lang yaml --pattern $'jobs.test-system.steps { $$$ @step }' .github/workflows/test.yml | grep -i 'v2' | grep -i 'setup')

echo "Fetched v2 dependencies from test.yml: $v2_dependencies"

# Check if these dependencies exist in v2-test.yml
if [ -f ".github/workflows/v2-test.yml" ]; then
    for dep in $v2_dependencies; do
        if grep -q "$dep" .github/workflows/v2-test.yml; then
            echo "Dependency '$dep' is present in v2-test.yml."
        else
            echo "Warning: Dependency '$dep' is missing in v2-test.yml."
        fi
    done
else
    echo "Error: v2-test.yml file not found."
fi

Length of output: 281

Comment on lines +142 to +145
- name: system tests v2
if: env.GIT_DIFF
run: |
COSMOS_BUILD_OPTIONS=v2 make test-system
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

LGTM: System tests execution step is well-configured

The system tests execution step is correctly conditioned on detected changes and uses a Makefile target, which is a good practice for managing complex test commands.

However, the purpose of the COSMOS_BUILD_OPTIONS=v2 environment variable is not documented. It is used in scripts/init-simapp-v2.sh to ensure SIMD_BIN is set. Please consider adding comments or documentation to explain its significance for future maintainers.

🔗 Analysis chain

LGTM: System tests execution step is well-configured

The system tests execution step is correctly conditioned on detected changes and uses a Makefile target, which is a good practice for managing complex test commands.

Could you please clarify the purpose of the COSMOS_BUILD_OPTIONS=v2 environment variable? It would be helpful to add a comment explaining its significance for future maintainers.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify if there's any documentation or comments about COSMOS_BUILD_OPTIONS
rg -i "COSMOS_BUILD_OPTIONS.*v2" --type md

Length of output: 44


Script:

#!/bin/bash
# Search for occurrences of COSMOS_BUILD_OPTIONS=v2 in code files excluding documentation
rg -i "COSMOS_BUILD_OPTIONS\s*=\s*v2" --type yaml --type yml --type sh --type bash --type make

Length of output: 124


Script:

#!/bin/bash
# Search for occurrences of COSMOS_BUILD_OPTIONS=v2 in code files excluding documentation
rg -i "COSMOS_BUILD_OPTIONS\s*=\s*v2" --type yaml --type sh --type bash --type make

Length of output: 114


Script:

#!/bin/bash
# Search for occurrences of COSMOS_BUILD_OPTIONS=v2 in code files excluding documentation
rg -i "COSMOS_BUILD_OPTIONS\s*=\s*v2" --type yaml --type sh --type make

Length of output: 230

@julienrbrt julienrbrt added this pull request to the merge queue Oct 3, 2024
Merged via the queue into main with commit 30003f6 Oct 3, 2024
74 of 76 checks passed
@julienrbrt julienrbrt deleted the julien/ci-system branch October 3, 2024 11:28
mergify bot pushed a commit that referenced this pull request Oct 3, 2024
julienrbrt added a commit that referenced this pull request Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release Type: CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants