Skip to content

Conversation

tolbrino
Copy link
Contributor

@tolbrino tolbrino commented Nov 4, 2024

Adds a new GHA workflow which runs the unit tests using Rust nightly.

@tolbrino tolbrino self-assigned this Nov 4, 2024
Copy link
Contributor

coderabbitai bot commented Nov 4, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces two new jobs to the GitHub Actions workflow in .github/workflows/tests.yaml: tests-unit-nightly and tests-smart-contracts. The tests-unit-nightly job is set to run nightly unit tests, while tests-smart-contracts focuses on smart contract testing. The existing tests-unit job has been simplified, and the overall workflow structure remains intact, ensuring that the new jobs enhance testing capabilities without disrupting existing processes.

Changes

File Change Summary
.github/workflows/tests.yaml Added jobs: tests-unit-nightly for nightly unit tests and tests-smart-contracts for smart contract tests. Simplified tests-unit job by removing comments. Existing jobs remain unchanged.

Possibly related PRs

  • ci: Run full rust workspace unit test suite #6499: This PR modifies the .github/workflows/tests.yaml file to streamline the testing process, which is directly related to the changes made in the main PR that also updates the testing workflow in the same file.
  • Pipeline improvements #6551: This PR includes updates to the .github/workflows/tests.yaml file, specifically regarding the setup for Google Cloud credentials, which aligns with the changes made in the main PR that also involves modifications to the same workflow file.

Suggested labels

crate:chain-types

Suggested reviewers

  • NumberFour8

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.

@tolbrino tolbrino requested a review from a team November 4, 2024 18:15
@tolbrino tolbrino changed the title gha: Add nightly test run gha: Add test run using Rust nightly Nov 4, 2024
@tolbrino tolbrino marked this pull request as ready for review November 4, 2024 18:16
@github-actions github-actions bot added the toolchain Developer and product happiness label Nov 4, 2024
@tolbrino tolbrino enabled auto-merge November 4, 2024 18:19
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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

Reviewing files that changed from the base of the PR and between d122e5b and be6ce83.

📒 Files selected for processing (2)
  • .github/workflows/tests.yaml (1 hunks)
  • flake.nix (2 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/tests.yaml

52-52: label "self-hosted-hoprnet-bigger" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


87-87: label "self-hosted-hoprnet-bigger" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

🔇 Additional comments (6)
.github/workflows/tests.yaml (4)

49-50: LGTM! Command simplification looks good.

The simplified command improves readability while maintaining the same functionality.


86-119: Review smart contract test configuration.

A few observations about the smart contracts test job:

  1. The HOPR_NETWORK environment variable is only set for this job. Consider documenting why this is needed
  2. The job has no explicit dependencies on other test jobs. Consider if there should be a specific test execution order
  3. Same Nix action version inconsistency as noted in the nightly job

Let's check if the HOPR_NETWORK variable is used consistently:

#!/bin/bash
# Check for HOPR_NETWORK usage across workflows
rg "HOPR_NETWORK:" .github/workflows/
🧰 Tools
🪛 actionlint

87-87: label "self-hosted-hoprnet-bigger" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


52-52: Verify self-hosted runner configuration.

The workflow uses custom runner labels (self-hosted-hoprnet-bigger). While these appear to be organization-specific runners, consider:

  1. Documenting the runner capabilities and requirements
  2. Adding these labels to actionlint.yaml to suppress the warnings
  3. Having fallback runners in case the custom runners are unavailable

Let's check the runner usage across workflows:

#!/bin/bash
# Check for custom runner usage patterns
rg "runs-on: self-hosted-hoprnet" .github/workflows/

Also applies to: 87-87

🧰 Tools
🪛 actionlint

52-52: label "self-hosted-hoprnet-bigger" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


51-85: 🧹 Nitpick (assertive)

Consider job optimization opportunities.

A few suggestions to improve the job configuration:

  1. Consider adding this job as a dependency of regular unit tests or vice versa to ensure consistent test ordering
  2. The job structure is heavily duplicated. Consider using reusable workflows or composite actions to reduce duplication
  3. Document why this job needs separate Google Cloud credentials setup compared to regular unit tests

Let's verify if other workflows in the repository use reusable workflows:

🧰 Tools
🪛 actionlint

52-52: label "self-hosted-hoprnet-bigger" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

flake.nix (2)

139-142: LGTM! Well-structured nightly test target implementation.

The implementation correctly leverages the nightly rust builder and enables panic abort tests through the -Z panic-abort-tests flag, which is a nightly-only feature.


428-428: LGTM! Clean package exports update.

The hopr-test-nightly package is correctly exported alongside the existing hopr-test package, maintaining the established pattern.

tolbrino and others added 2 commits November 4, 2024 21:33
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@Teebor-Choka Teebor-Choka force-pushed the tb/20241104-ci-nightly-test branch from fb853ae to 81beef5 Compare November 4, 2024 20:33
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 comments (1)
.github/workflows/tests.yaml (1)

Line range hint 1-119: Well-structured workflow with good separation of concerns.

The workflow maintains a consistent pattern across all test jobs while properly separating:

  • Regular unit tests
  • Nightly Rust tests
  • Smart contract tests

This separation allows for better control over test execution and failure isolation.

Consider adding job dependencies if any of these tests should run in a specific order or if they share build artifacts that could be cached between jobs.

🧰 Tools
🪛 actionlint

52-52: label "self-hosted-hoprnet-bigger" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


87-87: label "self-hosted-hoprnet-bigger" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

Reviewing files that changed from the base of the PR and between be6ce83 and 81beef5.

📒 Files selected for processing (1)
  • .github/workflows/tests.yaml (1 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/tests.yaml

52-52: label "self-hosted-hoprnet-bigger" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


87-87: label "self-hosted-hoprnet-bigger" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

🔇 Additional comments (3)
.github/workflows/tests.yaml (3)

49-50: LGTM! Command simplification looks good.

The simplified command improves readability while maintaining the same functionality.


51-85: LGTM! New nightly test job is well-structured.

The job follows the established patterns and includes proper conditional setup for Google Cloud credentials.

Let's verify the nightly test target exists:

✅ Verification successful

✅ Nightly test target is properly defined

The hopr-test-nightly target exists in flake.nix and is correctly configured with nightly rust builder and panic abort tests flag, matching the workflow's usage.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if hopr-test-nightly target is defined in Nix configuration
rg -l "hopr-test-nightly" flake.nix

Length of output: 45


Script:

#!/bin/bash
# Let's see the actual definition of hopr-test-nightly target
rg -A 5 "hopr-test-nightly" flake.nix

Length of output: 689

🧰 Tools
🪛 actionlint

52-52: label "self-hosted-hoprnet-bigger" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


86-119: Verify smart contract test configuration.

The job structure looks good, but let's verify two things:

✅ Verification successful

Let me check the content of the make target and documentation to ensure everything is properly configured.


Let me check the actual smart contract test implementation in the ethereum/contracts directory to ensure it's properly configured.


Smart contract test configuration is properly set up

The verification confirms:

  • The smart-contract-test make target exists and correctly delegates to ethereum/contracts/sc-test
  • The sc-test target in ethereum/contracts properly runs forge tests in groups to avoid IO race conditions
  • Test execution is well-structured with separate runs for deployment tests and other test cases
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if smart-contract-test make target exists and HOPR_NETWORK usage
echo "Checking for make target..."
rg "smart-contract-test:" Makefile

echo "Checking for HOPR_NETWORK usage documentation..."
rg -l "HOPR_NETWORK" {.,**}/README.md

Length of output: 353


Script:

#!/bin/bash
# Check the make target implementation
echo "Checking make target implementation..."
rg -A 5 "^smart-contract-test:" Makefile

echo "Checking HOPR_NETWORK documentation..."
cat ./README.md | rg -A 5 -B 5 "HOPR_NETWORK"

Length of output: 816


Script:

#!/bin/bash
# Check the smart contract test implementation
echo "Checking ethereum/contracts/Makefile for sc-test target..."
rg -A 5 "^sc-test:" ethereum/contracts/Makefile

echo "Checking for forge test command usage..."
rg "forge test" ethereum/contracts/Makefile

Length of output: 629

🧰 Tools
🪛 actionlint

87-87: label "self-hosted-hoprnet-bigger" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

@tolbrino tolbrino added this pull request to the merge queue Nov 5, 2024
Merged via the queue into master with commit b9458d4 Nov 5, 2024
27 of 28 checks passed
@tolbrino tolbrino deleted the tb/20241104-ci-nightly-test branch November 5, 2024 09:12
@coderabbitai coderabbitai bot mentioned this pull request Nov 12, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain Developer and product happiness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants