Skip to content

Deploy flags e2e #2788

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

Open
wants to merge 24 commits into
base: remove-use-local-nodes
Choose a base branch
from
Open

Conversation

sukantoraymond
Copy link
Collaborator

@sukantoraymond sukantoraymond commented May 1, 2025

Blockchain Deploy E2E

Our current E2E for tests/e2e/testcases is pretty extensive for local network across all commands. However, it does not test flags input extensively for happy path and error path.

For example, our E2E tests for blockchain deploy in https://github.com/ava-labs/avalanche-cli/blob/main/tests/e2e/testcases/subnet/sov/ currently tests that we are able to deploy to local network using PoA / PoS / Initialize Validator Manager. However, it does not test the multiple ways that we can achieve each objectives (for example we can use deploy an L1 with by setting num-local-machine=2 instead of using default value of 1).

This PR tests blockchain deploy flags extensively, checking for both happy path and error path.

Closes #2791, #2796

@sukantoraymond sukantoraymond requested a review from a team as a code owner May 1, 2025 21:14
@sukantoraymond sukantoraymond marked this pull request as draft May 1, 2025 21:14
@sukantoraymond sukantoraymond changed the base branch from main to remove-use-local-nodes May 6, 2025 22:45
@sukantoraymond sukantoraymond marked this pull request as ready for review May 6, 2025 22:46
@@ -396,7 +396,7 @@ func DeploySubnetLocallyWithArgsSOV(subnetName string, version string, confPath
gomega.Expect(exists).Should(gomega.BeTrue())

// Deploy subnet locally
cmdArgs := []string{SubnetCmd, "deploy", "--local", subnetName, "--" + constants.SkipUpdateFlag, bootstrapFilepathFlag + "=" + utils.BootstrapValidatorPath}
cmdArgs := []string{SubnetCmd, "deploy", "--local", subnetName, "--" + constants.SkipUpdateFlag}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since now using bootstrapFilepathFlag flag -> convert only & no local machine spun up, this flag will be removed in existing e2e blockchain deploy tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

bootstrapFilepathFlag is now tested in tests/e2e/commandse2e/blockchain/deploy/suite.go

@@ -476,10 +487,31 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
return err
}
}
if generateNodeID || bootstrapValidatorsJSONFilePath != "" || bootstrapEndpoints != nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A big change for blockchain deploy command in this PR:

if generateNodeID, bootstrapValidatorsJSONFilePath or bootstrapEndpoints flag is used, blockchain deploy will not use local machine and convert only will be set to true

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently we always spin up local machine even if bootstrapValidatorsJSONFilePath or generateNodeID is used, but this shouldn't be the case because the bootstrap validators defined in bootstrapValidatorsJSONFilePath or generateNodeID are not synced to the blockchain after convert step.

It should be either:

  • users only use all local machines as bootstrap validators in deploy or
  • users only use validators defined in generateNodeID, bootstrapValidatorsJSONFilePath or bootstrapEndpoints flags as bootstrap validators

We should not mix them

gomega.Expect(output).ShouldNot(gomega.ContainSubstring("L1 is successfully deployed on Local Network"))
gomega.Expect(err).Should(gomega.BeNil())
})

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not testing bootstrap endpoint because we are already testing it in etna test suite

gomega.Expect(output).Should(gomega.ContainSubstring("cannot use local machine as bootstrap validator if --generate-node-id=true"))
})

ginkgo.It("ERROR PATH: bootstrap filepath is not applicable if convert only is false", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would probably group the ERROR PATH and HAPPY PATH into ginkgo.Context() so you don't need to write it for every test

@artemanosov
Copy link
Contributor

LGTM, but I won't stamp until @felipemadero review, since he's more familiar with the command

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

Successfully merging this pull request may close these issues.

2 participants