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

Problem: fail test is not reported in ci #1622

Merged
merged 1 commit into from
Oct 4, 2024
Merged

Conversation

mmsqe
Copy link
Collaborator

@mmsqe mmsqe commented Oct 4, 2024

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

For more info

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Summary by CodeRabbit

  • New Features
    • Introduced new testing targets for improved modularity: test-memiavl and test-store.
  • Improvements
    • Enhanced build and testing processes with additional commands and conditional execution based on file changes.
    • Updated test commands to cover a broader scope, including objstore and rocksdb tags.
  • Bug Fixes
    • Added checks to ensure the working directory is clean before proceeding with builds and tests.

@mmsqe mmsqe requested a review from a team as a code owner October 4, 2024 10:19
@mmsqe mmsqe requested review from calvinaco and devashishdxt and removed request for a team October 4, 2024 10:19
Copy link
Contributor

coderabbitai bot commented Oct 4, 2024

Walkthrough

The pull request introduces modifications to the .github/workflows/build.yml and Makefile to enhance the build and testing processes. The workflow file updates the unittest, gomod2nix, and contracts jobs to include additional test commands and improve conditional execution based on file changes. The Makefile restructures test commands by adding new targets for specific directories and updating existing ones to enhance clarity and modularity.

Changes

File Change Summary
.github/workflows/build.yml Updated unittest job with new test commands; modified gomod2nix job to conditionally run steps based on changes; added checks for clean working directory in gomod2nix and contracts jobs.
Makefile Introduced new test targets test-memiavl and test-store; updated test-versiondb to include -tags=objstore,rocksdb; modified .PHONY declaration to include new targets.

Possibly related PRs

  • Problem: memiavl inefficient code in rare path #1620: The changes in the Makefile to introduce new test targets for test-memiavl and test-store are related to the modifications in the memiavl codebase, specifically the ApplyChangeSets method in memiavl/db.go, as both involve enhancements to testing and functionality within the memiavl component.

Suggested reviewers

  • calvinaco
  • devashishdxt
  • yihuang

Poem

In the garden of code, we hop and play,
New tests sprout up, brightening the day.
With clean checks in place, our builds take flight,
A joyful leap forward, all feels just right! 🐇✨


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.

CodeRabbit Configuration 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

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 17.72%. Comparing base (bd29fdf) to head (957dbbe).
Report is 1 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (bd29fdf) and HEAD (957dbbe). Click for more details.

HEAD has 12 uploads less than BASE
Flag BASE (bd29fdf) HEAD (957dbbe)
2 0
integration_tests 20 10
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1622       +/-   ##
===========================================
- Coverage   36.86%   17.72%   -19.15%     
===========================================
  Files         102       72       -30     
  Lines        8059     5208     -2851     
===========================================
- Hits         2971      923     -2048     
+ Misses       4710     4162      -548     
+ Partials      378      123      -255     

see 47 files with indirect coverage changes

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: 0

🧹 Outside diff range and nitpick comments (4)
.github/workflows/build.yml (3)

78-79: Excellent addition of new test commands.

The inclusion of test-memiavl and test-store commands enhances the test coverage, which is crucial for identifying and reporting test failures. This aligns well with the PR objective of addressing issues with test reporting in CI.

Consider adding comments to explain the purpose of each test command for better maintainability.


Line range hint 110-128: Improved efficiency and robustness in the gomod2nix job.

The changes in this section are well-thought-out:

  1. The modified if condition for the cachix/install-nix-action step improves efficiency.
  2. The new "check working directory is clean" step helps catch unexpected changes.
  3. The artifact upload and error exit provide better debugging capabilities.

These improvements contribute to a more robust CI process, indirectly supporting the PR objective of better test reporting.

Consider adding a comment explaining the purpose of the gomod2nix.toml artifact for future maintainers.


Line range hint 151-167: Enhanced CI process for contract-related work.

The additions to the contracts job are valuable improvements:

  1. The new test and build steps for contracts ensure proper validation of contract-related changes.
  2. The "check working directory is clean" step helps catch unexpected modifications in the contracts.
  3. The artifact upload provides better debugging capabilities for contract-related issues.

These enhancements contribute to a more comprehensive CI process, indirectly supporting the PR objective of improved test reporting.

Consider adding a brief comment explaining the purpose and contents of the contracts_out artifact for clarity.

Makefile (1)

111-113: LGTM: Comprehensive updates to test targets and .PHONY declaration.

The changes to the test-versiondb target and the .PHONY declaration are well-implemented:

  1. The addition of the rocksdb tag to test-versiondb appropriately reflects its interaction with RocksDB.
  2. The .PHONY declaration has been correctly updated to include all new test targets.

These modifications enhance the testing structure and maintain consistency across the Makefile.

Consider adding a comment above the test-versiondb target to explain why it requires both objstore and rocksdb tags. This would improve the maintainability of the Makefile.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between bd29fdf and 957dbbe.

📒 Files selected for processing (2)
  • .github/workflows/build.yml (1 hunks)
  • Makefile (1 hunks)
🔇 Additional comments (4)
.github/workflows/build.yml (1)

Line range hint 1-167: Overall improvements align with PR objectives, but specific issue needs addressing.

The changes made to this workflow file significantly enhance the CI process:

  1. Additional test commands in the unittest job increase test coverage.
  2. Improved efficiency and robustness in the gomod2nix job.
  3. Enhanced CI process for contract-related work.

These improvements contribute to a more comprehensive and reliable CI environment, which indirectly supports the PR objective of better test reporting. However, it's important to note that the specific issue of failed tests not being reported in CI may not be directly addressed by these changes.

To ensure that failed tests are now being reported correctly, please run the following verification script:

This script will help verify that the CI process is now correctly reporting failed tests, addressing the core issue mentioned in the PR objectives.

Makefile (3)

103-103: LGTM: Consistent tag addition across test targets.

The addition of -tags=objstore to the test target is consistent with the new test targets and aligns with the PR objective of improving test reporting in CI.


104-108: LGTM: Improved test granularity with new targets.

The addition of test-memiavl and test-store targets is a positive change that allows for more focused testing of specific components. This granularity can help isolate issues and potentially speed up the CI process by allowing parallel execution of tests.

The consistent use of -tags=objstore across all test targets is commendable.


103-113: Summary: Excellent improvements to test structure and CI reporting.

The changes made to the Makefile align well with the PR objective of improving test reporting in CI. The additions and modifications:

  1. Introduce more granular testing capabilities with new targets for specific components.
  2. Maintain consistency in tag usage across test targets.
  3. Update the .PHONY declaration appropriately.

These improvements will likely enhance the efficiency of the CI process and make it easier to isolate and address issues. The changes are well-structured and maintain the overall integrity of the Makefile.

@yihuang yihuang enabled auto-merge October 4, 2024 14:01
@yihuang yihuang added this pull request to the merge queue Oct 4, 2024
Merged via the queue into crypto-org-chain:main with commit 766af76 Oct 4, 2024
42 of 43 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 23, 2024
13 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.

2 participants