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

chore: pass knuu as an argument to the testnet.New #3952

Conversation

mojtaba-esk
Copy link
Member

As pointed out before in one of the comments, if we pass knuu as an argument to the testnet constructor, user will have more flexibility in playing with knuu options and can optimize the resource consumption based on the test requirements.

This PR attempts to achieve that goal.

@mojtaba-esk mojtaba-esk self-assigned this Oct 8, 2024
@mojtaba-esk mojtaba-esk requested a review from a team as a code owner October 8, 2024 15:11
@mojtaba-esk mojtaba-esk requested review from rootulp and staheri14 and removed request for a team October 8, 2024 15:11
Copy link
Contributor

coderabbitai bot commented Oct 8, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces modifications to several end-to-end test files to integrate the Knuu package for improved test execution management. Key changes include the initialization of Knuu instances with unique identifiers, the introduction of a new Options structure for testnet creation, and enhanced logging for better visibility during test execution. The core logic of existing tests remains intact, but the overall structure and error handling have been improved to streamline the testing process.

Changes

File Path Change Summary
test/e2e/benchmark/benchmark.go Modified NewBenchmarkTest to integrate Knuu; established context with cancellation and improved error handling for testnet creation.
test/e2e/major_upgrade_v2.go Modified MajorUpgradeToV2 to integrate Knuu; added logging; updated testnet creation to use testnet.Options.
test/e2e/major_upgrade_v3.go Updated MajorUpgradeToV3 to include Knuu; adjusted upgrade height and testnet creation.

Possibly related PRs

  • test(e2e benchmark): refactors E2EThroughput #3395: The NewBenchmarkTest function in the main PR and the BenchmarkTest struct introduced in this PR both involve significant modifications to test management and initialization processes, particularly with the integration of the Knuu package.
  • test: make nodes also restart after upgrading in knuu #3556: The modifications to the MajorUpgradeToV2 function in this PR include adjustments to the testnet creation process, which is relevant to the changes made in the main PR regarding testnet initialization with Knuu.
  • test: v3 e2e upgrade #3910: The MajorUpgradeToV3 function in this PR introduces a new upgrade process that utilizes a context and Knuu, similar to the enhancements made in the main PR for managing testnet upgrades and signal handling.

Suggested labels

knuu, WS: Big Blonks 🔭

Suggested reviewers

  • staheri14
  • cmwaters
  • ninabarbakadze
  • rootulp
  • evan-forbes

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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

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

🧹 Outside diff range and nitpick comments (3)
test/e2e/simple.go (1)

25-30: Initialize Knuu with appropriate options

The Knuu instance is initialized correctly with the specified options:

  • Scope: Provides isolation between test runs.
  • ProxyEnabled: Allows for network proxying if required.

Consider whether you need to uncomment and set the Timeout option based on your test requirements.

If timeouts are a concern for longer-running tests, you might uncomment the Timeout option:

    		// if the tests timeout, pass the timeout option
-		// Timeout: 120 * time.Minute,
+		Timeout: 120 * time.Minute,
test/e2e/major_upgrade_v2.go (2)

21-21: Consider declaring testName as a constant

Since testName is a value that does not change, declaring it as a constant improves code readability and conveys its immutability.

Apply this diff to declare testName as a constant:

+const testName = "MajorUpgradeToV2"

 var (
-	testName      = "MajorUpgradeToV2"
 	numNodes      = 4
 	upgradeHeight = int64(10)
 )

33-34: Consider removing or uncommenting the Timeout option

The Timeout option is currently commented out. If it's not needed, consider removing it to keep the code clean. If it might be used in the future, perhaps add a comment explaining under what circumstances it should be enabled.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between b99ef0c and c0589bd.

📒 Files selected for processing (4)
  • test/e2e/major_upgrade_v2.go (1 hunks)
  • test/e2e/minor_version_compatibility.go (2 hunks)
  • test/e2e/simple.go (1 hunks)
  • test/e2e/testnet/testnet.go (1 hunks)
🧰 Additional context used
🔇 Additional comments (16)
test/e2e/testnet/testnet.go (4)

33-39: LGTM: Well-structured TestnetOptions struct

The introduction of the TestnetOptions struct is a good design choice. It encapsulates all the parameters previously passed to the New function, improving flexibility and making future additions easier. The struct is well-organized with clear field names.


41-49: LGTM: Improved New function with TestnetOptions

The changes to the New function are well-implemented. The new signature simplifies the function call by accepting a single TestnetOptions parameter, which aligns with the PR objective of passing knuu as an argument. The function body correctly initializes the Testnet struct using fields from the opts parameter.


Line range hint 1-1: Summary: Changes align well with PR objectives

The modifications in this file, including the introduction of TestnetOptions, updates to the New function, and removal of the Knuu method, align well with the PR objective of passing knuu as an argument to the testnet constructor. These changes enhance the flexibility of the testnet constructor and allow for better customization of testnet configurations.

The code structure has been improved, making it easier to add new options in the future. However, please ensure that all instances of t.Knuu() in the codebase are updated to directly access the knuu field of the Testnet struct.


Line range hint 1-1: Verify impact of removing the Knuu method

The removal of the Knuu method from the Testnet struct simplifies the code and reduces unnecessary abstraction. However, this change might impact existing code that uses the Knuu method.

Please run the following script to check for any remaining usage of the Knuu method:

If the script returns any results, those occurrences should be updated to directly access the knuu field of the Testnet struct.

test/e2e/simple.go (7)

12-12: Import Knuu package for testnet integration

The addition of the import "github.com/celestiaorg/knuu/pkg/knuu" is appropriate for integrating Knuu into the testnet. This allows for enhanced testnet management and flexibility.


19-19: Define 'testName' as a constant

Defining testName as a constant improves code readability and maintainability. This makes it easier to reference and modify the test name if needed.


24-24: Generate a unique identifier for Knuu scope

Creating a unique identifier using testName and the current timestamp ensures that each test run operates in a distinct scope. This is a good practice to prevent conflicts between concurrent test executions.


31-31: Proper error handling after Knuu initialization

Using testnet.NoError("failed to initialize Knuu", err) ensures that any errors during Knuu initialization are appropriately handled and reported. This enhances the robustness of the test setup.


32-32: Handle stop signals for Knuu gracefully

Calling kn.HandleStopSignal(ctx) allows the Knuu instance to handle termination signals properly, ensuring resources are cleaned up and processes are stopped gracefully.


33-33: Log Knuu initialization details

Logging the initialization details of Knuu, including the scope and testName, provides valuable information for debugging and auditing test runs.


35-40: Pass Knuu instance to TestnetOptions

Integrating the Knuu instance into testnet.New by passing it through testnet.TestnetOptions enhances the testnet's flexibility and control. This change aligns with the PR's objective to pass knuu as an argument to testnet.New.

test/e2e/minor_version_compatibility.go (4)

18-18: Importing Knuu package: Looks good

The addition of the Knuu package import is necessary for integrating Knuu into the test setup.


22-25: Constants declaration improves code clarity

Defining testName and numNodes as constants enhances readability and maintainability.


51-53: Initialization and logging of Knuu instance: Approved

Handling the stop signal and logging the initialization details ensures proper resource management and traceability.


54-59: Passing Knuu instance to TestnetOptions

Including the Knuu instance in TestnetOptions allows for flexible test network configuration and aligns with the objective of passing Knuu as an argument.

test/e2e/major_upgrade_v2.go (1)

15-15: Importing Knuu package is appropriate

The addition of the Knuu package import is necessary for the new functionality introduced.

test/e2e/minor_version_compatibility.go Outdated Show resolved Hide resolved
test/e2e/major_upgrade_v2.go Outdated Show resolved Hide resolved
test/e2e/major_upgrade_v2.go Outdated Show resolved Hide resolved
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: 2

🧹 Outside diff range and nitpick comments (3)
test/e2e/simple.go (1)

24-33: LGTM: Knuu initialization added with proper error handling and logging.

The Knuu initialization is well-implemented with a unique identifier, proper error handling, and informative logging. This addition enhances the test setup and provides better control over the test environment.

Consider reviewing the commented-out timeout option. If it's necessary for some scenarios, you might want to make it configurable or document why it's commented out.

test/e2e/testnet/testnet.go (1)

Potential Impact of Removing the Knuu Method

The removal of the Knuu method from the Testnet struct may affect existing code that references it. Please review the following locations to ensure that the removal does not introduce issues:

  • test/e2e/simple.go

    • Line 1: testnet.NoError("failed to initialize Knuu", err)
    • Line 2: logger.Println("Knuu initialized", "scope", kn.Scope, "testName", testName)
    • Line 3: Knuu: kn,
  • test/e2e/major_upgrade_v2.go

    • Line 1: testnet.NoError("failed to initialize Knuu", err)
    • Line 2: logger.Println("Knuu initialized", "scope", kn.Scope, "testName", testName)
    • Line 3: Knuu: kn,
  • test/e2e/testnet/txsimNode.go

    • Line 1: knuu *knuu.Knuu,
  • test/e2e/testnet/testnet.go

    • Line 1: knuu *knuu.Knuu
    • Line 2: Knuu *knuu.Knuu
    • Line 3: knuu: opts.Knuu,
  • test/e2e/testnet/node.go

    • Line 1: kn *knuu.Knuu,
  • test/e2e/minor_version_compatibility.go

    • Line 1: testnet.NoError("failed to initialize Knuu", err)
    • Line 2: logger.Println("Knuu initialized", "scope", kn.Scope, "testName", testName)
    • Line 3: Knuu: kn,
🔗 Analysis chain

Line range hint 1-1: Verify the impact of removing the Knuu method

The Knuu method has been removed from the Testnet struct. While this change aligns with the new approach of passing knuu as an argument, please verify that this removal doesn't negatively impact any existing code that might rely on this method. Consider adding a comment explaining the rationale behind this removal if it's intentional.

To check for potential impacts, you can run the following command:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining usage of the Knuu method
rg '\bKnuu\(\)' --type go

Length of output: 27


Script:

#!/bin/bash
# Search for any remaining usage of the Knuu identifier in Go files
rg 'Knuu' --type go

Length of output: 958

test/e2e/major_upgrade_v2.go (1)

21-21: Avoid hardcoding the test name

While defining testName as "MajorUpgradeToV2" works, consider deriving it dynamically from the function name or using a constant to prevent potential discrepancies if the function name changes.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between b99ef0c and c0589bd.

📒 Files selected for processing (4)
  • test/e2e/major_upgrade_v2.go (1 hunks)
  • test/e2e/minor_version_compatibility.go (2 hunks)
  • test/e2e/simple.go (1 hunks)
  • test/e2e/testnet/testnet.go (1 hunks)
🧰 Additional context used
🔇 Additional comments (17)
test/e2e/simple.go (3)

12-12: LGTM: Knuu package import added.

The import for the Knuu package is correctly added and is necessary for the subsequent Knuu initialization in the function.


19-20: LGTM: Test name constant added.

The addition of the testName constant is a good practice. It improves code readability and maintainability by centralizing the test name definition.


Line range hint 1-91: Summary: E2ESimple function successfully updated to incorporate Knuu.

The changes to the E2ESimple function effectively integrate the Knuu package for improved test execution management. Key improvements include:

  1. Proper initialization of a Knuu instance with a unique identifier.
  2. Enhanced testnet creation using the new TestnetOptions structure.
  3. Improved logging for better visibility during test execution.

These modifications align well with the PR objectives, enhancing the flexibility and control of the testnet setup while maintaining the core logic of the existing test.

test/e2e/testnet/testnet.go (2)

33-39: LGTM: New TestnetOptions struct improves code organization

The introduction of the TestnetOptions struct is a good improvement. It encapsulates all the parameters previously passed to the New function, making the code more organized and easier to maintain. This change also aligns with the PR objective of passing knuu as an argument.


41-49: LGTM: New function signature improves flexibility and meets PR objective

The changes to the New function are well-implemented. The new signature, which takes a single TestnetOptions parameter, simplifies function calls and improves flexibility for future additions. The function body correctly uses the fields from the TestnetOptions struct, including the initialization of the knuu field, which meets the PR objective of passing knuu as an argument.

test/e2e/minor_version_compatibility.go (5)

18-18: Added import for Knuu package

The addition of github.com/celestiaorg/knuu/pkg/knuu import integrates Knuu functionalities into the test environment.


22-25: Constants 'testName' and 'numNodes' added for clarity

Defining testName and numNodes as constants improves code readability and maintainability by clearly identifying the test's purpose and the number of nodes used.


42-43: Unique identifier for Knuu scope

Constructing the identifier using the test name and current timestamp ensures a unique scope for each test run, preventing potential conflicts in test environments.


51-51: Ensure graceful shutdown with 'HandleStopSignal'

Calling kn.HandleStopSignal(ctx) ensures that the Knuu instance handles stop signals appropriately, allowing for a clean and graceful shutdown of the test environment.


54-59: Updated 'testnet.New' call to include Knuu instance

Incorporating the Knuu instance into testnet.New enhances the flexibility and modularity of the testnet setup, allowing for better management and customization of the test environment.

test/e2e/major_upgrade_v2.go (7)

15-15: Importing Knuu package

The import of "github.com/celestiaorg/knuu/pkg/knuu" correctly allows the use of the Knuu package for managing test execution.


29-35: Initializing Knuu instance with unique identifier

The Knuu instance is initialized with a unique identifier, which is essential for isolating test environments. The options set, including ProxyEnabled, are appropriate.


36-36: Error handling after Knuu initialization

The error check using testnet.NoError ensures that any issues during Knuu initialization are properly handled.


38-38: Handling stop signals for graceful shutdown

Using kn.HandleStopSignal(ctx) allows the test to respond gracefully to termination signals, improving test robustness.


39-39: Enhanced logging with Knuu initialization details

Logging the initialization of Knuu with details about the scope and test name improves traceability and debugging capability.


42-47: Updating testnet creation to include Knuu instance

Passing the Knuu instance within testnet.TestnetOptions when creating the testnet ensures that the testnet is aware of the Knuu environment.


42-47: Verify consistency of testnet.New usage across the codebase

With the updated signature of testnet.New to accept TestnetOptions, ensure all other invocations of testnet.New are updated accordingly to prevent potential errors.

Run the following script to identify all usages of testnet.New:

Review each occurrence to confirm that they pass TestnetOptions with the necessary parameters, including the Knuu instance if required.

✅ Verification successful

All testnet.New invocations are consistent with the updated signature including the Knuu parameter. No issues found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find all calls to testnet.New that need to be reviewed.

rg --type go --no-heading --line-number 'testnet\.New\(ctx,'

Length of output: 333


Script:

#!/bin/bash
# Description: Verify that all testnet.New calls include the Knuu parameter in TestnetOptions.

ast-grep --lang go --pattern 'testnet\.New($_, testnet\.TestnetOptions{ $$$, Knuu: $_, $$$ })' --invert

Length of output: 305


Script:

#!/bin/bash
# Description: Verify that all testnet.New calls include the Knuu parameter in TestnetOptions.

rg --type go --no-heading --line-number 'testnet\.New\(ctx,\s*testnet\.TestnetOptions\{' | grep -v 'Knuu:'

Length of output: 377


Script:

#!/bin/bash
# Description: Verify that all testnet.New calls include the Knuu parameter in TestnetOptions.

rg --type go --no-heading --line-number 'testnet\.New\(ctx,\s*testnet\.TestnetOptions\{' | grep -v 'Knuu\s*:'

Length of output: 382


Script:

#!/bin/bash
# Description: Identify all testnet.New calls and check for the presence of the Knuu parameter.

# Step 1: Extract all testnet.New calls with their TestnetOptions
ast-grep --lang go --pattern 'testnet.New(ctx, testnet.TestnetOptions{ $$$ })' > all_testnet_new_calls.txt

# Step 2: Identify calls that do not include the Knuu parameter
grep -L 'Knuu:' all_testnet_new_calls.txt

Length of output: 122

test/e2e/simple.go Outdated Show resolved Hide resolved
test/e2e/minor_version_compatibility.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

CI is failing b/c NewBenchmarkTest also needs to be updated to account for the TestnetOptions modification

test/e2e/major_upgrade_v2.go Outdated Show resolved Hide resolved
@rootulp rootulp marked this pull request as draft October 8, 2024 15:34
@mojtaba-esk mojtaba-esk requested review from a team and ninabarbakadze and removed request for a team October 9, 2024 06:33
@mojtaba-esk mojtaba-esk marked this pull request as ready for review October 9, 2024 07:09
@mojtaba-esk
Copy link
Member Author

CI is failing b/c NewBenchmarkTest also needs to be updated to account for the TestnetOptions modification

Thanks for pointing it out. now it is fixed.

@mojtaba-esk mojtaba-esk enabled auto-merge (squash) October 9, 2024 07:10
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: 2

🧹 Outside diff range and nitpick comments (5)
test/e2e/major_upgrade_v2.go (1)

29-39: LGTM: Knuu initialization implemented correctly

The Knuu initialization has been implemented effectively:

  • A unique identifier is created for each test run.
  • Knuu options are set appropriately, including proxy enablement.
  • Error handling is implemented correctly.
  • The logging statement has been updated to use Printf as suggested.

Consider uncommenting and configuring the Timeout option if extended test durations are anticipated.

test/e2e/testnet/testnet.go (2)

41-49: LGTM: Improved New function with Options

The refactoring of the New function to use the Options struct simplifies the function signature and improves readability. The changes correctly utilize the fields from the opts parameter, including the knuu field, which aligns with the PR objective.

Consider adding basic validation for required fields in the Options struct to provide more informative error messages. For example:

if opts.Knuu == nil {
    return nil, errors.New("knuu is required in Options")
}

Remaining usages of the Knuu method found

The removal of the Knuu method from the Testnet struct is not fully completed. The following files still contain usages of Knuu:

  • test/e2e/simple.go
  • test/e2e/testnet/txsimNode.go
  • test/e2e/testnet/node.go
  • test/e2e/major_upgrade_v2.go
  • test/e2e/minor_version_compatibility.go
  • test/e2e/benchmark/benchmark.go

Please update these instances to use the new knuu field from the Testnet struct directly.

🔗 Analysis chain

Line range hint 1-1: Verify impact of removing Knuu method

The removal of the Knuu method from the Testnet struct aligns with the new approach of passing knuu as an argument in the Options struct. However, it's crucial to ensure that all previous usages of this method have been appropriately updated throughout the codebase.

Please run the following script to check for any remaining usages of the Knuu method:

If the script returns any results, those occurrences should be updated to use the new knuu field from the Testnet struct directly.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining usages of the Knuu method
rg --type go 'Knuu\(\)' --glob '!test/e2e/testnet/testnet.go'

Length of output: 63


Script:

#!/bin/bash
# Search for any remaining usages of Knuu in the codebase excluding testnet.go
rg --type go 'Knuu\b' --glob '!test/e2e/testnet/testnet.go'

Length of output: 933

test/e2e/benchmark/benchmark.go (2)

36-37: Clarify Context Usage in HandleStopSignal

The comment indicates that context.Background() is used to allow HandleStopSignal to function after this function returns. It might be clearer to explain why a new background context is appropriate here, especially since ctx was created earlier. Consistency in context usage can help prevent confusion.


39-40: Enhance Logging for Better Visibility

The log message "Knuu initialized with scope %s" provides useful information. Consider including additional context if available, such as the identifier or any relevant configuration details, to aid in debugging and monitoring.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c0589bd and a51789c.

📒 Files selected for processing (5)
  • test/e2e/benchmark/benchmark.go (2 hunks)
  • test/e2e/major_upgrade_v2.go (1 hunks)
  • test/e2e/minor_version_compatibility.go (2 hunks)
  • test/e2e/simple.go (1 hunks)
  • test/e2e/testnet/testnet.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/e2e/minor_version_compatibility.go
  • test/e2e/simple.go
🧰 Additional context used
🔇 Additional comments (6)
test/e2e/major_upgrade_v2.go (4)

15-15: LGTM: Knuu package import added correctly

The import for the Knuu package has been added appropriately, aligning with the existing import structure and supporting the new test management features.


21-21: LGTM: Test name variable added

The testName variable has been appropriately declared and initialized, providing a clear identifier for the test which enhances readability and maintainability.


55-55: LGTM: Logging statement updated as suggested

The logging statement has been correctly updated to use Printf, allowing for proper formatting of the log message with variables. This change addresses the suggestion made in a previous review comment.


Line range hint 19-147: Overall changes improve test management while preserving core logic

The modifications to the MajorUpgradeToV2 function successfully integrate Knuu for enhanced test management and update the testnet creation process. These changes provide better control over the test environment and improve code clarity without altering the core upgrade verification logic.

Key improvements:

  1. Integration of Knuu for test management
  2. Use of structured options for testnet creation
  3. Improved logging

These changes enhance the maintainability and flexibility of the test setup while preserving its fundamental functionality.

test/e2e/testnet/testnet.go (1)

33-39: LGTM: Well-structured Options struct

The introduction of the Options struct is a good design choice. It encapsulates related parameters, making the code more maintainable and extensible. This change aligns well with the PR objective of passing knuu as an argument and improves overall code organization.

test/e2e/benchmark/benchmark.go (1)

41-48: Verify Integration of Knuu with testnet.New

The testnet.New function now includes the Knuu option:

testNet, err := testnet.New(testnet.Options{
    // ...
    Knuu: kn,
})

Ensure that the testnet.Options struct and the testnet.New function are updated to accept and utilize the Knuu instance correctly. Verify that all downstream components handle the Knuu field as expected.

To confirm, you can check the implementation of testnet.Options and testnet.New to ensure they accommodate the new Knuu parameter.

test/e2e/benchmark/benchmark.go Show resolved Hide resolved
rootulp
rootulp previously approved these changes Oct 9, 2024
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

LGTM

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

identifier := fmt.Sprintf("%s_%s", name, time.Now().Format("20060102_150405"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

[optional] this could extract a constant for the time format and reuse that in other places

Copy link
Member Author

Choose a reason for hiding this comment

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

done

func (t *Testnet) Knuu() *knuu.Knuu {
return t.knuu
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

[question] is this getter no longer helpful?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really as the user passes the knuu object, so they can use it on their end the way they need.

@celestia-bot celestia-bot requested a review from a team October 10, 2024 06:14
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: 3

🧹 Outside diff range and nitpick comments (3)
test/e2e/benchmark/benchmark.go (1)

45-52: LGTM: Improved testnet creation with Options struct and error handling.

The use of an Options struct for testnet creation is a good improvement. It enhances code readability and makes it easier to add or modify options in the future. The addition of error handling is also a positive change.

Consider wrapping the error with additional context:

-testnet.NoError("failed to create testnet", err)
+testnet.NoError("failed to create testnet", fmt.Errorf("creating testnet with Knuu: %w", err))

This change would provide more context about where the error occurred, making debugging easier.

test/e2e/testnet/testnet.go (2)

41-49: Approved: Simplified New function with Options struct

The updated New function signature using the Options struct simplifies the API and improves flexibility. The function body correctly utilizes the fields from the Options struct.

Consider adding basic validation for the Options struct fields, such as checking for nil values where appropriate, to improve error handling and provide more informative error messages to the user.


Line range hint 62-65: Removal of Knuu method aligns with new design

The removal of the Knuu method is consistent with the new approach where the user passes the knuu object directly. This change improves encapsulation and gives users more control over how they use the knuu object.

Consider updating the package documentation to reflect this change and provide guidance on how users should now interact with the knuu object.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c17e943 and 3d3d3d6.

📒 Files selected for processing (7)
  • test/e2e/benchmark/benchmark.go (2 hunks)
  • test/e2e/main.go (1 hunks)
  • test/e2e/major_upgrade_v2.go (1 hunks)
  • test/e2e/major_upgrade_v3.go (1 hunks)
  • test/e2e/minor_version_compatibility.go (2 hunks)
  • test/e2e/simple.go (1 hunks)
  • test/e2e/testnet/testnet.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • test/e2e/main.go
  • test/e2e/major_upgrade_v2.go
  • test/e2e/minor_version_compatibility.go
  • test/e2e/simple.go
🧰 Additional context used
🔇 Additional comments (10)
test/e2e/benchmark/benchmark.go (2)

15-16: LGTM: New import for Knuu package.

The addition of the Knuu package import is appropriate for the new functionality being introduced in this file.


18-20: LGTM: Time format constant added.

The addition of the timeFormat constant is a good practice. It ensures consistency in time formatting across the package and improves maintainability.

test/e2e/testnet/testnet.go (2)

33-39: Excellent addition of the Options struct!

The introduction of the Options struct is a great improvement. It enhances the extensibility and readability of the New function by grouping related parameters. This change will make it easier to add new options in the future without modifying the function signature.


33-49: Overall: Significant improvement in package design

The changes introduced in this PR represent a substantial improvement in the testnet package's design. The new Options struct and the updated New function signature enhance flexibility and extensibility while maintaining the core functionality.

To ensure a smooth transition, please verify that all other parts of the codebase that use this package have been updated to work with the new API. Run the following script to check for any remaining usages of the old New function signature:

If any results are found, they will need to be updated to use the new Options struct.

✅ Verification successful

Verification Successful: No Remaining Old New Function Usages

All usages of the old New function signature have been successfully updated. No remaining instances of the outdated New function are found in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for old New function usage
rg --type go 'New\s*\(\s*ctx\s*,\s*name\s*,\s*seed\s*,\s*grafana\s*,\s*chainID\s*,\s*genesisModifiers' --glob '!test/e2e/testnet/testnet.go'

Length of output: 142


Script:

#!/bin/bash
# Search for any usage of the New function in Go files excluding testnet.go
rg --type go 'New\s*\(' --glob '!test/e2e/testnet/testnet.go'

Length of output: 8982

test/e2e/major_upgrade_v3.go (6)

13-13: Importing the knuu package

The import statement for github.com/celestiaorg/knuu/pkg/knuu correctly adds the necessary package for Knuu integration.


18-21: Initialization of new variables for test configuration

The addition of testName, numNodes, and the change of upgradeHeightV3 to int64(10) enhances the configurability of the test. This allows for more flexibility in test scenarios.


27-31: Initialization of Knuu instance with context and options

The Knuu instance kn is properly initialized with the context and options, including Scope and ProxyEnabled. Error handling after initialization ensures robustness.


33-34: Handling stop signals and logging Knuu initialization

Using kn.HandleStopSignal(ctx) allows the application to gracefully handle termination signals. Logging the initialization of Knuu with scope enhances observability.


37-41: Updating testnet.New to use testnet.Options struct

Refactoring the testnet.New function to use the testnet.Options struct improves code clarity and future maintainability. Passing Knuu: kn integrates the Knuu instance into the testnet setup effectively.


20-20: Verify the change of upgradeHeightV3 from 20 to 10

The upgradeHeightV3 has been modified from int64(20) to int64(10). Please ensure that this change aligns with your testing requirements and that the upgrade occurs at the intended block height.

To confirm that the upgrade height is correctly set and does not affect other tests, you can verify its usage:

✅ Verification successful

upgradeHeightV3 successfully updated to 10

The change from int64(20) to int64(10) has been verified across the codebase. No remaining instances of upgradeHeightV3 set to int64(20) were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `upgradeHeightV3` is correctly set to 10 and is used appropriately.

# Test: Search for the usage of `upgradeHeightV3` in the codebase.
# Expect: Occurrences where `upgradeHeightV3` is set to 10.

rg --type go 'upgradeHeightV3' -A 5

Length of output: 712


Script:

#!/bin/bash
# Description: Check for any occurrences where `upgradeHeightV3` is still set to 20.

# Test: Search for assignments of `upgradeHeightV3` to `int64(20)`.
# Expect: No matches should be found.

rg --type go 'upgradeHeightV3\s*=\s*int64\(20\)'

Length of output: 50

test/e2e/benchmark/benchmark.go Outdated Show resolved Hide resolved
test/e2e/major_upgrade_v3.go Outdated Show resolved Hide resolved
test/e2e/major_upgrade_v3.go Outdated Show resolved Hide resolved

func New(opts Options) (*Testnet, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I prefer the use of Options for arguments to a constructor which are in fact optional. All fields here can have working defaults except for the Knuu instance which is mandatory thus I'd prefer

Suggested change
func New(opts Options) (*Testnet, error) {
func New(knuu *knuu.Knuu, opts Options) (*Testnet, error) {

so now it's more explicit or better still if you go with

type Option func (*Testnet) 

func WithSeed(seed int64) Option {
    return func (t *Testnet) {
        t.seed = seed
    }
}

func New(knuu *knuu.Knuu, options Option...) *Testnet

Copy link
Member Author

Choose a reason for hiding this comment

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

yes the term "option" is kinda counter intuitive here. The main reason for using it to reduce the number of arguments to the constructor.
Function option could be another way of using it; it is subjective, but I think option alone is cleaner than than the function option way.
we could extract knuu out of that option thing. a question might arise here: do we have default values for the rest of options if we extract knuu out? if so, I will do that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here's a guess at defaults for the options:

	Seed             int64 => 42
	Grafana          *GrafanaInfo => &GrafanaInfo{}
	ChainID          string => test-chain-id
	GenesisModifiers []genesis.Modifier => []genesis.Modifier{}

Copy link
Member Author

Choose a reason for hiding this comment

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

ok thanks Rootul, then let's do it

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@celestia-bot celestia-bot requested a review from a team October 10, 2024 14:35
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: CHILL

📥 Commits

Files that changed from the base of the PR and between 3d3d3d6 and 24ed7e9.

📒 Files selected for processing (1)
  • test/e2e/testnet/testnet.go (1 hunks)
🧰 Additional context used
🔇 Additional comments (3)
test/e2e/testnet/testnet.go (3)

33-39: LGTM: New Options struct improves code organization

The introduction of the Options struct is a good improvement. It encapsulates related parameters, making the code more maintainable and easier to extend in the future. This change also aligns with the PR objective of passing Knuu as an argument.


41-49: LGTM: Validate method enhances error handling

The Validate method is a valuable addition. It ensures that critical fields (ChainID and Knuu) are provided before creating a Testnet, which will help prevent potential issues downstream. The error messages are clear and informative.


51-62: LGTM: New function refactored to use Options struct

The refactoring of the New function to use the Options struct is a good improvement. It simplifies the function signature, enhances error handling by validating options upfront, and makes the Testnet initialization more concise. This change aligns well with the PR objective of enhancing the flexibility of the testnet constructor.

test/e2e/testnet/testnet.go Show resolved Hide resolved
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: 2

🧹 Outside diff range and nitpick comments (2)
test/e2e/major_upgrade_v3.go (1)

26-34: LGTM: Knuu initialization improves test management

The Knuu initialization with a unique identifier enhances test isolation. The error handling and logging additions are good practices.

Consider wrapping the error handling in a helper function for consistency:

func handleError(msg string, err error) {
    if err != nil {
        log.Fatalf("%s: %v", msg, err)
    }
}

// Usage
handleError("failed to initialize Knuu", err)
test/e2e/benchmark/benchmark.go (1)

45-51: LGTM: Testnet creation with Knuu and improved error handling

The changes to the testnet creation, including the use of the Knuu instance and additional options, align well with the PR objectives. The error handling for testnet creation is good, but could be slightly improved for consistency.

Consider updating the error handling to match the style used for Knuu initialization:

-testnet.NoError("failed to create testnet", err)
+if err != nil {
+    return nil, fmt.Errorf("failed to create testnet: %w", err)
+}

This change would provide more consistent error handling throughout the function.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 24ed7e9 and 57e1f55.

📒 Files selected for processing (8)
  • test/e2e/benchmark/benchmark.go (2 hunks)
  • test/e2e/benchmark/throughput.go (0 hunks)
  • test/e2e/main.go (1 hunks)
  • test/e2e/major_upgrade_v2.go (1 hunks)
  • test/e2e/major_upgrade_v3.go (1 hunks)
  • test/e2e/minor_version_compatibility.go (2 hunks)
  • test/e2e/simple.go (1 hunks)
  • test/e2e/testnet/testnet.go (3 hunks)
💤 Files with no reviewable changes (1)
  • test/e2e/benchmark/throughput.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • test/e2e/main.go
  • test/e2e/major_upgrade_v2.go
  • test/e2e/minor_version_compatibility.go
  • test/e2e/simple.go
🧰 Additional context used
🔇 Additional comments (9)
test/e2e/major_upgrade_v3.go (4)

13-13: LGTM: Knuu package import added

The addition of the Knuu package import is consistent with the changes in the function body and supports the new test execution management approach.


Line range hint 39-114: LGTM: Overall changes improve test management while preserving core logic

The modifications to incorporate Knuu improve test execution management without altering the core upgrade test logic. The unchanged parts of the function remain consistent with the new changes.

As a final verification step, please run the following script to ensure all Knuu-related changes are consistent throughout the file:

#!/bin/bash
# Check for any remaining references to the old testnet creation method
# and verify Knuu usage consistency
rg --type go 'testnet\.New\(' test/e2e/
rg --type go 'knuu\.' test/e2e/

37-37: LGTM: Testnet creation now uses Knuu

The change aligns with the PR objective of passing Knuu as an argument to testnet.New. The use of testnet.Options might provide more flexibility in testnet configuration.

Please verify that all necessary options are being passed to testnet.New. Run the following script to check the testnet.Options struct definition and usage:


17-21: Verify the impact of reducing upgradeHeightV3

The addition of testName improves code readability. However, the upgradeHeightV3 has been reduced from 20 to 10.

Please confirm that this change doesn't negatively impact the test scenario. Run the following script to check for any related configurations or dependencies:

test/e2e/benchmark/benchmark.go (3)

15-20: LGTM: New import and constant added

The addition of the Knuu package import and the timeFormat constant are appropriate for the new functionality. The constant improves code readability and maintainability.


40-43: LGTM: Stop signal handling and logging added

The addition of stop signal handling using a background context is correct and ensures proper functionality even after the function returns. The logging statement provides useful information about the Knuu initialization, which is good for debugging and monitoring.


28-38: ⚠️ Potential issue

Remove deferred context cancellation

The creation of a context with cancellation and the initialization of the Knuu instance look good. However, the deferred cancellation of the context on line 29 could lead to premature termination of Knuu operations, especially since HandleStopSignal is called with a background context later.

 ctx, cancel := context.WithCancel(context.Background())
-defer cancel()

The rest of the changes, including the unique identifier generation and Knuu initialization, are well-implemented.

test/e2e/testnet/testnet.go (2)

23-26: Constants DefaultSeed and DefaultChainID are appropriately defined.

Defining DefaultSeed and DefaultChainID enhances code maintainability and provides clear default values for the Testnet configuration.


46-54: New function signature is well-structured and follows best practices.

Passing knuu as a mandatory parameter and grouping optional parameters into the Options struct enhances the readability and usability of the New function.

test/e2e/testnet/testnet.go Outdated Show resolved Hide resolved
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 (1)
test/e2e/testnet/testnet.go (1)

38-43: LGTM: Options struct improves parameter management.

The Options struct enhances code organization and flexibility. However, consider adding the Knuu field to this struct as suggested in a previous review comment.

Consider adding the Knuu field to the Options struct:

 type Options struct {
 	Seed             int64
 	Grafana          *GrafanaInfo
 	ChainID          string
 	GenesisModifiers []genesis.Modifier
+	Knuu             *knuu.Knuu
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 57e1f55 and f7d9104.

📒 Files selected for processing (1)
  • test/e2e/testnet/testnet.go (3 hunks)
🧰 Additional context used
🔇 Additional comments (2)
test/e2e/testnet/testnet.go (2)

23-26: LGTM: Default constants added for seed and chain ID.

The addition of DefaultSeed and DefaultChainID constants improves code readability and maintainability by centralizing default values.


45-54: LGTM: New function signature improves parameter handling.

The updated New function effectively uses the Options struct and separates the knuu parameter. The setDefaults call ensures proper initialization of default values.

test/e2e/testnet/testnet.go Show resolved Hide resolved
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

I had a bunch of nits but decided to address them myself by pushing a commit.

test/e2e/benchmark/benchmark.go Outdated Show resolved Hide resolved
test/e2e/benchmark/benchmark.go Outdated Show resolved Hide resolved
test/e2e/benchmark/benchmark.go Outdated Show resolved Hide resolved
// context.Background() is used to allow the stopSignal to be functioning even after this function returns
kn.HandleStopSignal(context.Background())

log.Printf("Knuu initialized with scope %s", kn.Scope)
Copy link
Collaborator

Choose a reason for hiding this comment

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

[nit] I would move this log statement immediately beneath the Knuu initialization command (and error handling):

	kn, err := knuu.New(ctx, knuu.Options{
		Scope:        identifier,
		ProxyEnabled: true,
	})
	if err != nil {
		return nil, err
	}
	log.Printf("Knuu initialized with scope %s", kn.Scope)

test/e2e/major_upgrade_v2.go Outdated Show resolved Hide resolved
test/e2e/major_upgrade_v2.go Outdated Show resolved Hide resolved
testnet.NoError("failed to initialize Knuu", err)

kn.HandleStopSignal(ctx)
logger.Printf("Knuu initialized with scope %s", kn.Scope)
Copy link
Collaborator

Choose a reason for hiding this comment

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

[nit] same nit about moving this immediately after knuu initialization.

Copy link
Member Author

Choose a reason for hiding this comment

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

it is after knuu initialization. knuu.New() does the initialization and if it does not fail (error check), then we handle the stop signal.

or you mean removing that empty line?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean moving the log statement.

	kn, err := knuu.New(ctx, knuu.Options{
		Scope:        scope,
		ProxyEnabled: true,
	})
	testnet.NoError("failed to initialize Knuu", err)
+	logger.Printf("Knuu initialized with scope %s", kn.Scope)

	kn.HandleStopSignal(ctx)
-	logger.Printf("Knuu initialized with scope %s", kn.Scope)

test/e2e/major_upgrade_v3.go Outdated Show resolved Hide resolved
test/e2e/major_upgrade_v3.go Outdated Show resolved Hide resolved
testnet.NoError("failed to initialize Knuu", err)

kn.HandleStopSignal(ctx)
logger.Printf("Knuu initialized with scope %s", kn.Scope)
Copy link
Collaborator

Choose a reason for hiding this comment

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

[nit] same nit about moving this up

@rootulp
Copy link
Collaborator

rootulp commented Oct 11, 2024

Oops nvm I can't push to your fork until you add me as a collaborator. cc: @mojtaba-esk

rootulp
rootulp previously approved these changes Oct 11, 2024
@rootulp
Copy link
Collaborator

rootulp commented Oct 11, 2024

Approving to unblock. I can address nits in a follow-up if this merges before I get permission to push my commit that addresses nits.

@celestia-bot celestia-bot requested a review from a team October 14, 2024 06:11
Co-authored-by: Rootul P <rootulp@gmail.com>
mojtaba-esk and others added 2 commits October 14, 2024 08:13
Co-authored-by: Rootul P <rootulp@gmail.com>
Co-authored-by: Rootul P <rootulp@gmail.com>
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: 2

🧹 Outside diff range and nitpick comments (3)
test/e2e/major_upgrade_v2.go (1)

20-22: LGTM: Test configuration variables added

The addition of these variables improves code readability and maintainability. The values seem appropriate for the test scenario.

Consider using inline variable declarations for consistency with the codebase style:

testName := "MajorUpgradeToV2"
numNodes := 4
upgradeHeight := int64(10)
test/e2e/benchmark/benchmark.go (2)

18-18: Consider removing the const block

The timeFormat constant is correctly defined and used in the NewBenchmarkTest function. However, as suggested in a previous review, since there's only one constant, you can remove the const block:

const timeFormat = "20060102_150405"

This change would slightly improve readability.


38-41: LGTM: Stop signal handling and logging

The stop signal handling with a background context is correctly implemented. The log statement provides good observability for the Knuu initialization.

Consider moving the log statement immediately after the Knuu initialization for better code flow:

kn, err := knuu.New(ctx, knuu.Options{
    Scope:        scope,
    ProxyEnabled: true,
})
if err != nil {
    return nil, err
}
log.Printf("Knuu initialized with scope %s", kn.Scope)

// context.Background() is used to allow the stopSignal to be functional even after this function returns
kn.HandleStopSignal(context.Background())

This change would improve the logical grouping of related operations.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f7d9104 and 2e83e48.

📒 Files selected for processing (3)
  • test/e2e/benchmark/benchmark.go (1 hunks)
  • test/e2e/major_upgrade_v2.go (1 hunks)
  • test/e2e/major_upgrade_v3.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/major_upgrade_v3.go
🧰 Additional context used
🔇 Additional comments (5)
test/e2e/major_upgrade_v2.go (3)

15-15: LGTM: Knuu package import added

The addition of the Knuu package import is appropriate for the changes made in this file.


38-38: LGTM: Testnet creation updated

The update to use testnet.Options structure improves the clarity of the testnet creation process. The Knuu instance is correctly passed as an argument, and the previously undefined seed parameter is no longer used.


46-46: LGTM: Logging statement updated

The logging statement has been improved to include the test name, enhancing the clarity of the log output. The Printf function is correctly used for formatting.

test/e2e/benchmark/benchmark.go (2)

15-15: LGTM: Knuu package import added

The addition of the Knuu package import is consistent with the changes in the NewBenchmarkTest function and is correctly implemented.


43-48: LGTM: Enhanced testnet creation with Knuu

The updated testnet creation using testnet.New with Knuu and additional options is well-implemented. This change aligns perfectly with the PR objective of enhancing the flexibility of the testnet constructor by allowing the "knuu" parameter to be passed as an argument.

The error handling for testnet creation is also correctly implemented, improving the robustness of the function.

These modifications successfully achieve the goal of providing users with more control over the "knuu" options, thereby improving the overall usability and efficiency of the testnet setup.

test/e2e/major_upgrade_v2.go Show resolved Hide resolved
test/e2e/benchmark/benchmark.go Show resolved Hide resolved
Comment on lines +22 to +25
const (
testName = "MinorVersionCompatibility"
numNodes = 4
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const (
testName = "MinorVersionCompatibility"
numNodes = 4
)
testName := "MinorVersionCompatibility"
numNodes = 4

Comment on lines +24 to +28
identifier := fmt.Sprintf("%s_%s", testName, time.Now().Format(timeFormat))
kn, err := knuu.New(ctx, knuu.Options{
Scope: identifier,
ProxyEnabled: true,
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
identifier := fmt.Sprintf("%s_%s", testName, time.Now().Format(timeFormat))
kn, err := knuu.New(ctx, knuu.Options{
Scope: identifier,
ProxyEnabled: true,
})
scope := fmt.Sprintf("%s_%s", testName, time.Now().Format(timeFormat))
kn, err := knuu.New(ctx, knuu.Options{
Scope: scope,
ProxyEnabled: true,
})

@mojtaba-esk mojtaba-esk merged commit 6936685 into celestiaorg:main Oct 14, 2024
32 of 33 checks passed
@mojtaba-esk mojtaba-esk deleted the mojtaba/pass-knuu-as-an-argument-to-the-testnet.New branch October 14, 2024 14:04
@evan-forbes
Copy link
Member

@mojtaba-esk for future reference, this was an api breaking PR, so we should put chore! in front of it

@evan-forbes
Copy link
Member

also, as a broad question, why were we able to merge this PR when only a single core app engineer approved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants