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

feat: implement simapp and e2e tests #2

Merged
merged 8 commits into from
May 22, 2024
Merged

feat: implement simapp and e2e tests #2

merged 8 commits into from
May 22, 2024

Conversation

johnletey
Copy link
Member

@johnletey johnletey commented May 17, 2024

Closes #1

Summary by CodeRabbit

  • New Features

    • Introduced GitHub Actions workflow for end-to-end testing with Docker image building and test matrix preparation.
    • Added local authority node setup script for blockchain networks.
    • Enhanced SimApp with new configurations and functionalities for various modules, including IBC modules.
  • Bug Fixes

    • Improved handling of module parameters and upgrade scenarios through new test cases.
  • Chores

    • Updated .gitignore to exclude .authority and build directories.
    • Updated Makefile with new targets for building, local image creation, and end-to-end testing.
  • Tests

    • Added multiple test cases for validating client substitution, ownership transfer, parameter updates, and software upgrades in the blockchain network.

@johnletey johnletey self-assigned this May 17, 2024
Copy link

coderabbitai bot commented May 17, 2024

Important

Review Skipped

Review was skipped due to path filters

Files ignored due to path filters (1)
  • audits/Authority Module Audit.pdf is excluded by !**/*.pdf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The recent updates encompass a comprehensive approach to testing a blockchain application with GitHub Actions, Docker enhancements, and Makefile refinements. These changes elevate the testing framework, validate interchain interactions, parameter updates, and upgrade scheduling, while enhancing the simapp application with IBC features, dynamic versioning, and refined module management for operational efficiency.

Changes

Files/Directories Change Summary
.github/workflows/e2e-tests.yaml Introduced GitHub Actions workflow for end-to-end tests, including Docker image building and testing.
.gitignore Added exclusions for .authority and build directories.
Makefile, simapp/Makefile Added targets for building, local image creation, and end-to-end testing.
chains.yaml Added configuration for noble-authority-simd targeting simd binary in simapp build directory.
e2e/clients.json, e2e/params.json, e2e/upgrade.json Added JSON structures for client recovery, parameters, and upgrade messages.
e2e/clients_test.go, e2e/ownership_test.go, e2e/params_test.go, e2e/upgrade_test.go Added test cases for client substitution, ownership transfer, parameter updates, and upgrade scheduling.
e2e/utils.go Introduced utility functions for setting up test environments and validating blockchain parameters.
local.sh Introduced script for setting up a local authority node environment.
simapp/app.go, simapp/export.go, simapp/ibc.go Added functionalities for app initialization, module management, state export, and IBC module registration.
simapp/app.yaml Introduced configurations for various modules in the SimApp application.
simapp/simd/cmd/commands.go, simapp/simd/cmd/root.go Added command functions and root command setup for simd.
simapp/simd/main.go Set up Bech32 prefixes and initialized configuration for Cosmos SDK application.

🌟 In the realm of code so bright,
Tests and modules take their flight.
End-to-end they run with grace,
Ensuring each blockchain case.
Docker builds and commands new,
SimApp shines with every view.
🐇 CodeRabbit cheers with glee,
For seamless chains, from sea to sea! 🌐


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

codecov bot commented May 17, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@johnletey johnletey marked this pull request as ready for review May 18, 2024 15:53
@johnletey johnletey changed the title feat: implement simapp feat: implement simapp and e2e tests May 18, 2024
@johnletey johnletey requested a review from boojamya May 18, 2024 15:55
Copy link

@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: 2

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between ba89b76 and ad3ef0a.
Files ignored due to path filters (7)
  • e2e/go.mod is excluded by !**/*.mod
  • e2e/go.sum is excluded by !**/*.sum
  • go.mod is excluded by !**/*.mod
  • go.work is excluded by !**/*.work
  • go.work.sum is excluded by !**/*.sum
  • simapp/go.mod is excluded by !**/*.mod
  • simapp/go.sum is excluded by !**/*.sum
Files selected for processing (21)
  • .github/workflows/e2e-tests.yaml (1 hunks)
  • .gitignore (1 hunks)
  • Makefile (2 hunks)
  • chains.yaml (1 hunks)
  • e2e/clients.json (1 hunks)
  • e2e/clients_test.go (1 hunks)
  • e2e/ownership_test.go (1 hunks)
  • e2e/params.json (1 hunks)
  • e2e/params_test.go (1 hunks)
  • e2e/upgrade.json (1 hunks)
  • e2e/upgrade_test.go (1 hunks)
  • e2e/utils.go (1 hunks)
  • local.sh (1 hunks)
  • simapp/Makefile (1 hunks)
  • simapp/app.go (1 hunks)
  • simapp/app.yaml (1 hunks)
  • simapp/export.go (1 hunks)
  • simapp/ibc.go (1 hunks)
  • simapp/simd/cmd/commands.go (1 hunks)
  • simapp/simd/cmd/root.go (1 hunks)
  • simapp/simd/main.go (1 hunks)
Files skipped from review due to trivial changes (5)
  • .gitignore
  • chains.yaml
  • e2e/ownership_test.go
  • e2e/params.json
  • e2e/upgrade.json
Additional Context Used
ShellCheck (3)
local.sh (3)

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.


[warning] 20-20: PENDING_OWNER appears unused. Verify use (or export if used externally).


[info] 24-24: Double quote to prevent globbing and word splitting.

Additional comments not posted (17)
e2e/clients.json (1)

1-26: The JSON structure for IBC client recovery messages is well-formed and correctly defines necessary fields.

e2e/params_test.go (1)

14-32: The test case for parameter updates is implemented correctly, with proper setup and validation steps.

e2e/upgrade_test.go (1)

14-32: The test case for scheduling software upgrades is implemented correctly, ensuring proper functionality.

simapp/Makefile (1)

1-27: The Makefile is well-structured with dynamic version determination and appropriate build flags for the simd binary.

simapp/simd/main.go (1)

1-40: The main function for the simd application is correctly set up with appropriate Bech32 prefix configurations and command initialization.

local.sh (1)

20-20: Verify the usage of PENDING_OWNER to ensure it's utilized appropriately in the script or elsewhere.

simapp/export.go (2)

13-47: The function ExportAppStateAndValidators is implemented correctly with comprehensive error handling and state export logic.


51-53: The prepForZeroHeightGenesis function is marked as unimplemented. Confirm if this is intentional or if it should be implemented.

simapp/app.yaml (1)

1-56: The YAML configurations for SimApp modules are correctly defined, ensuring proper application behavior and module interaction.

e2e/clients_test.go (1)

19-73: The test function TestClientSubstitution is well-structured and covers the necessary steps to validate IBC client substitution effectively.

.github/workflows/e2e-tests.yaml (1)

1-90: The GitHub Actions workflow is correctly set up for end-to-end testing, with well-defined jobs and steps that follow best practices for CI/CD pipelines.

Makefile (1)

Line range hint 1-78: The Makefile is well-structured with clear targets for building, testing, and managing Docker images. It follows best practices for Makefile configuration.

simapp/ibc.go (1)

22-81: The RegisterIBCModules function is correctly implemented for setting up IBC modules and keepers. It follows best practices for error handling and modular code.

simapp/simd/cmd/commands.go (1)

30-100: The functions in commands.go are well-implemented for managing CLI commands of the simd application. They use appropriate Cobra configurations and handle errors effectively.

simapp/simd/cmd/root.go (1)

37-130: The NewRootCmd function is correctly implemented for setting up the root command of the simd application. It handles dependency injection and error scenarios effectively.

simapp/app.go (1)

58-162: The SimApp struct and its initialization function are well-implemented for configuring the application. They use dependency injection effectively and follow best practices for modular configuration.

e2e/utils.go (1)

31-207: The utility functions in e2e/utils.go are well-implemented for supporting end-to-end tests. They use appropriate testing and blockchain APIs and handle errors effectively.

local.sh Show resolved Hide resolved
local.sh Show resolved Hide resolved
Copy link

@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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between ad3ef0a and 97566f0.
Files ignored due to path filters (3)
  • e2e/go.mod is excluded by !**/*.mod
  • e2e/go.sum is excluded by !**/*.sum
  • go.mod is excluded by !**/*.mod
Files selected for processing (1)
  • .github/workflows/e2e-tests.yaml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/e2e-tests.yaml

@johnletey johnletey force-pushed the e2e branch 2 times, most recently from 3291971 to 63133e0 Compare May 20, 2024 16:48
Copy link
Member

@boojamya boojamya left a comment

Choose a reason for hiding this comment

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

This looks great! Clean and easy to read.

Only thought is if you think it is necessary to test non happy paths such as submitting update owner, params and client transactions from non owner account.

e2e/utils.go Outdated Show resolved Hide resolved
e2e/utils.go Show resolved Hide resolved
e2e/clients.json Outdated Show resolved Hide resolved
@johnletey
Copy link
Member Author

Thanks for the review @boojamya!

if you think it is necessary to test non happy paths

We should talk more about this on our internal sync later today, but it comes down to our internal reasoning around Unit vs E2E tests 🤔

Copy link

@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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 97566f0 and e95e3b7.
Files selected for processing (3)
  • .github/workflows/e2e-tests.yaml (1 hunks)
  • .github/workflows/unit-tests.yaml (2 hunks)
  • e2e/utils.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/unit-tests.yaml
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/e2e-tests.yaml
  • e2e/utils.go

@johnletey johnletey merged commit 0ef1a33 into main May 22, 2024
10 checks passed
@johnletey johnletey deleted the e2e branch May 22, 2024 21:38
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.

Implement SimApp + E2E Tests
2 participants