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 e2e tests #2

Merged
merged 3 commits into from
Jun 6, 2024
Merged

feat: implement e2e tests #2

merged 3 commits into from
Jun 6, 2024

Conversation

johnletey
Copy link
Contributor

@johnletey johnletey commented May 25, 2024

Closes #1

Summary by CodeRabbit

  • New Features

    • Added GitHub Actions workflow for running end-to-end tests.
    • Introduced environment variables for path and artifact management.
    • Configured concurrency settings and various actions for workflow steps.
  • Bug Fixes

    • Updated branch filters and go-version in unit tests workflow.
    • Enhanced validation logic for blocklist owner address in multiple files.
  • Documentation

    • Updated Makefile targets for building local images and running end-to-end tests.
  • Tests

    • Added end-to-end tests for minting, transferring, and burning a custom token.
    • Introduced functions and types for end-to-end testing in the e2e package.

@johnletey johnletey requested review from fafrd and boojamya May 25, 2024 19:22
@johnletey johnletey self-assigned this May 25, 2024
Copy link

coderabbitai bot commented May 25, 2024

Walkthrough

A flurry of updates dances through the codebase! From end-to-end tests to Makefile enhancements, and blockchain validations, the changes bring new workflows, targets, and test scenarios, enriching the project's testing and build processes.

Changes

File(s) Change Summary
.github/workflows/e2e-tests.yaml Introduces GitHub Actions workflow for end-to-end tests.
.github/workflows/unit-tests.yaml Adds branch filters and updates go-version for unit tests.
Makefile Updates targets for building local images and running end-to-end tests.
chains.yaml Adds configuration for building aura-simd binary.
e2e/main_test.go Introduces end-to-end tests for custom token operations.
e2e/utils.go Adds functions and types for blockchain testing.
x/aura/types/blocklist/genesis.go Validates blocklist owner address in GenesisState.
x/aura/types/genesis.go Enhances validation logic for owner address.

Poem

In code's domain, changes bloom and sway,
End-to-end tests in the light of day.
Docker images rise, tokens dance and burn,
A rabbit's joy in each line and turn. 🐇✨


Note

Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://coderabbit.ai

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.
    • @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 as 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.

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 25, 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 ☂️

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

Outside diff range and nitpick comments (3)
e2e/main_test.go (3)

13-53: Consider adding comments to explain the purpose of each test block for better readability.


55-112: Consider adding comments to explain the purpose of each test block for better readability.


114-193: Consider adding detailed comments, especially around blocklist functionality, to enhance understanding and maintainability.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between f51c30a and e19adfc.
Files ignored due to path filters (6)
  • e2e/go.mod is excluded by !**/*.mod
  • e2e/go.sum is excluded by !**/*.sum
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum
  • go.work is excluded by !**/*.work
  • go.work.sum is excluded by !**/*.sum
Files selected for processing (8)
  • .github/workflows/e2e-tests.yaml (1 hunks)
  • .github/workflows/unit-tests.yaml (2 hunks)
  • Makefile (2 hunks)
  • chains.yaml (1 hunks)
  • e2e/main_test.go (1 hunks)
  • e2e/utils.go (1 hunks)
  • x/aura/types/blocklist/genesis.go (1 hunks)
  • x/aura/types/genesis.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • chains.yaml
Additional comments not posted (6)
.github/workflows/unit-tests.yaml (2)

5-7: Branch filters updated to include main and version tags. This is a good practice to ensure that CI processes are triggered only for significant branches.


20-20: Go version updated to support >=1.21. Ensure that all dependencies are compatible with this version range.

x/aura/types/blocklist/genesis.go (1)

14-17: Added validation for Owner field to check if it is not empty before validating the address. This enhances robustness and prevents potential runtime errors.

x/aura/types/genesis.go (1)

18-21: Added validation for Owner field to check if it is not empty before validating the address, similar to the blocklist module. Good consistency across modules.

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

1-90: Introduced a comprehensive GitHub Actions workflow for end-to-end testing. The workflow is well-organized with separate jobs for building, preparing, and testing. It uses specific GitHub Actions like strangelove-ventures/heighliner-build-action and actions/upload-artifact, and defines necessary environment variables and concurrency settings.

Makefile (1)

2-2: Updated the all target to include local-image and test-e2e. Ensure that these new targets function as expected by running them in different build environments.

Verification successful

The local-image and test-e2e targets are correctly defined in the Makefile. The local-image target checks for the presence of heighliner and builds an image if found, while the test-e2e target runs end-to-end tests using Go.

  • local-image target:
    • Checks for heighliner and builds an image if available.
  • test-e2e target:
    • Runs end-to-end tests using Go.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the functionality of `local-image` and `test-e2e` targets.

# Test: Run the `all` target and check outputs.
make all

Length of output: 82



Script:

#!/bin/bash
# Description: Verify the existence of `local-image` and `test-e2e` targets in the Makefile.

# Search for the `local-image` target in the Makefile
grep -A 5 '^local-image:' Makefile

# Search for the `test-e2e` target in the Makefile
grep -A 5 '^test-e2e:' Makefile

Length of output: 413

e2e/utils.go Show resolved Hide resolved
@johnletey
Copy link
Contributor Author

@boojamya Could you please look into this Heighliner issue?

error building docker image for aura-simd from ref: e2e - error getting mod file: failed to clone go.mod file to determine go version: authentication required

The GitHub Action doesn't have access to the repository (because it's private), and I tried to fix this in noble-assets@7df3813, but doesn't seem to do anything 🤔

e2e/utils.go Show resolved Hide resolved
Copy link
Collaborator

@fafrd fafrd left a comment

Choose a reason for hiding this comment

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

Looking good to me, ty!

@boojamya boojamya force-pushed the e2e branch 2 times, most recently from e07f2d9 to d4df356 Compare May 28, 2024 23:52
@johnletey johnletey requested a review from boojamya June 5, 2024 17:35
@johnletey johnletey enabled auto-merge (squash) June 5, 2024 17:36
@johnletey johnletey disabled auto-merge June 5, 2024 17:47
Copy link
Contributor

@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 look great, very readable!

@johnletey johnletey merged commit f553945 into main Jun 6, 2024
7 of 8 checks passed
@johnletey johnletey deleted the e2e branch June 6, 2024 16:27
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 E2E Tests
3 participants