Skip to content

Comments

Adding localnetwork e2e tests: start\status\clean#2784

Closed
Tonix517 wants to merge 6 commits intomainfrom
tonyz/add_more_local_network_tests
Closed

Adding localnetwork e2e tests: start\status\clean#2784
Tonix517 wants to merge 6 commits intomainfrom
tonyz/add_more_local_network_tests

Conversation

@Tonix517
Copy link

@Tonix517 Tonix517 commented May 1, 2025

Why this should be merged

https://ava-labs.atlassian.net/browse/DPTN-1625
https://ava-labs.atlassian.net/browse/DPTN-1626
https://ava-labs.atlassian.net/browse/DPTN-1627

How this works

How this was tested

  • ran new e2e test cases locally

Code Coverage Enhancement:

  • FULL: 41.5% -> 41.7%
  • Non-Cloud: 53.7% -> 53.9%
  • Non-Cloud Non-SDK: 55.3% -> 55.5%

Copy link
Contributor

@artemanosov artemanosov left a comment

Choose a reason for hiding this comment

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

LGTM but would refactor to use new testing function

ginkgo.AfterEach(func() {
_, _ = commands.CleanNetwork()
})

Copy link
Contributor

@sukantoraymond sukantoraymond May 2, 2025

Choose a reason for hiding this comment

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

can we add tests for these flags too

cmd.Flags().StringVar(
		&startFlags.UserProvidedAvagoVersion,
		"avalanchego-version",
		constants.DefaultAvalancheGoVersion,
		"use this version of avalanchego (ex: v1.17.12)",
	)
	cmd.Flags().StringVar(&startFlags.AvagoBinaryPath, "avalanchego-path", "", "use this avalanchego binary path")
	cmd.Flags().StringVar(&startFlags.RelayerBinaryPath, "relayer-path", "", "use this relayer binary path")
	cmd.Flags().StringVar(&startFlags.SnapshotName, "snapshot-name", constants.DefaultSnapshotName, "name of snapshot to use to start the network from")
	cmd.Flags().StringVar(
		&startFlags.RelayerVersion,
		"relayer-version",
		constants.DefaultRelayerVersion,
		"use this relayer version",
	)

Copy link
Contributor

Choose a reason for hiding this comment

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

For relayer related tests, feel free to create issue for it / if you want to pick it up, @felipemadero can give more context

Copy link
Author

Choose a reason for hiding this comment

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

ok i just created a ticket for it: https://ava-labs.atlassian.net/browse/DPTN-1665 - will address it in a follow-up PR

Copy link
Contributor

Choose a reason for hiding this comment

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

what about the other flags;

cmd.Flags().StringVar(
		&startFlags.UserProvidedAvagoVersion,
		"avalanchego-version",
		constants.DefaultAvalancheGoVersion,
		"use this version of avalanchego (ex: v1.17.12)",
	)
	cmd.Flags().StringVar(&startFlags.AvagoBinaryPath, "avalanchego-path", "", "use this avalanchego binary path")
	cmd.Flags().StringVar(&startFlags.SnapshotName, "snapshot-name", constants.DefaultSnapshotName, "name of snapshot to use to start the network from")

Copy link
Author

Choose a reason for hiding this comment

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

all added in

@Tonix517 Tonix517 force-pushed the tonyz/add_more_local_network_tests branch from 6e94b79 to cbaf8a2 Compare May 2, 2025 18:10
gomega.Expect(err).Should(gomega.BeNil())
gomega.Expect(out).Should(gomega.ContainSubstring("Network is Up"))
})
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

you need to add tests for starting from a stopped cluster. most important test
consideration is that the state is preserved. eg:
start with N nodes -> stop -> start with no args-> the same N is obtained

and check that L1s are started, blockchain deploy -> stop -> start -> the L1s are up and running

Copy link
Collaborator

Choose a reason for hiding this comment

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

also check for start with different snapshot names, and see that:

  • it does not modify or create a default snapshot
  • stop only restores that state if given that snapshot name
    also, clean only affects the default snapshot, no other snapshots
    all the snapshots semantic may be well tested in this commands, together with stop

Copy link
Author

Choose a reason for hiding this comment

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

added in

})

ginkgo.It("can get status of started network", func() {
out := commands.StartNetwork()
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you check the status is current for different network configurations, and for deployed L1s?

var _ = ginkgo.Describe("[Local Network] Stop", ginkgo.Ordered, func() {
ginkgo.AfterEach(func() {
commands.CleanNetwork()
_, _ = commands.CleanNetwork()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I should add here a test case for stopping a locally deployed L1. it should both stop the network and
the L1s

Copy link
Author

Choose a reason for hiding this comment

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

added.

@Tonix517 Tonix517 force-pushed the tonyz/add_more_local_network_tests branch 6 times, most recently from 780d920 to 7a6e648 Compare June 4, 2025 22:21
@Tonix517 Tonix517 force-pushed the tonyz/add_more_local_network_tests branch 2 times, most recently from 78f3e1d to 9f8b08e Compare June 11, 2025 21:39
@Tonix517 Tonix517 force-pushed the tonyz/add_more_local_network_tests branch 7 times, most recently from 0a78c42 to a1a9cfc Compare June 12, 2025 22:25
@Tonix517 Tonix517 force-pushed the tonyz/add_more_local_network_tests branch 2 times, most recently from b810447 to ab9cc87 Compare June 12, 2025 22:38
@Tonix517 Tonix517 force-pushed the tonyz/add_more_local_network_tests branch from ab9cc87 to 2f2bf94 Compare July 9, 2025 18:57
@Tonix517 Tonix517 force-pushed the tonyz/add_more_local_network_tests branch from 2f2bf94 to 8716cb3 Compare July 16, 2025 22:24
@Tonix517 Tonix517 force-pushed the tonyz/add_more_local_network_tests branch 5 times, most recently from 9f6828a to 32f76ea Compare July 18, 2025 20:15
@Tonix517 Tonix517 force-pushed the tonyz/add_more_local_network_tests branch from 32f76ea to 68c727a Compare July 18, 2025 20:22
@felipemadero
Copy link
Collaborator

Closing as CLI is moving into maintenance mode. Thanks for the work on this!

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.

4 participants