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

Refactor p2p unit tests #425

Merged
merged 12 commits into from
Dec 13, 2023
Merged

Refactor p2p unit tests #425

merged 12 commits into from
Dec 13, 2023

Conversation

joshua-kim
Copy link
Contributor

Why this should be merged

the P2P unit tests are confusing + spin up goroutines, this PR refactors all of them to be simpler

How this works

See above

How this was tested

UTs

plugin/evm/vm.go Outdated Show resolved Hide resolved
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
@joshua-kim joshua-kim changed the title Refactor unit tests Refactor p2p unit tests Dec 12, 2023
@joshua-kim joshua-kim marked this pull request as ready for review December 12, 2023 09:10
darioush
darioush previously approved these changes Dec 12, 2023
Copy link
Collaborator

@darioush darioush left a comment

Choose a reason for hiding this comment

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

I think this is a good improvement so I am approving this PR.

I think we should find a coherent strategy for initializing & wiring objects during testing. May be worthwhile to look into golang best practices or agree on some standards for further improvement.

scripts/versions.sh Outdated Show resolved Hide resolved
plugin/evm/vm.go Outdated Show resolved Hide resolved
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
@joshua-kim joshua-kim requested a review from darioush December 12, 2023 21:20
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
peer/network_test.go Outdated Show resolved Hide resolved
@joshua-kim joshua-kim self-assigned this Dec 13, 2023
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
commit 056800c
Author: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Date:   Wed Dec 13 00:28:59 2023 -0500

    Update to new SDK API (#421)

commit 42db2c2
Author: Ceyhun Onur <ceyhun.onur@avalabs.org>
Date:   Tue Dec 12 19:05:37 2023 +0300

    show strings in pointers (#414)

Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
plugin/evm/vm.go Outdated Show resolved Hide resolved
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
@StephenButtolph StephenButtolph added the testing Anything testing-related label Dec 13, 2023
@StephenButtolph StephenButtolph merged commit 9c85de5 into master Dec 13, 2023
8 checks passed
@StephenButtolph StephenButtolph deleted the sdk-refactor branch December 13, 2023 16:34
darioush pushed a commit that referenced this pull request Apr 25, 2024
* Simplify e2e tests

* Add TODOs

* WIP

* Replace GetSubnetIDF

* Bump avalanchego to v1.9.6-rc.0

* Working on tests

* Light client mode to unlock dynamic state sync

* revert version to pass ci (?)

* fix simulator go.mod

* Set env variable using os setenv

* Needed renames to run all solidity precompile tests

* Cleanup

* E2E test GH Action

* Remove simualtor from GH Actions

* Re-add simulator to GH Actions

* nits

* Modify run script to support running a network and running simulator

* Fix GH Actions file

* Bump avalanchego to v1.9.6-rc.2

* go mod tidy

* Fix run script

* Reduce ctx timeout for starting new subnet to 15s

* Set data dir from github action

* Update run script

* Create separate load test for ginkgo

* Refactor scripts

* Fix up env variables in run single node script

* WIP

* Add install_cli.sh script

* Create 1 script to start a non-staking network of nodes in a subshell

* Fix run script to run 5 node non-staking network and add simple load script

* Fix load test

* go mod update to ago v1.9.7

* Fix allowed geth imports for simulator

* Populate constants to fix blst warning

* load constants in run ginkgo

* Update run simulator name check

* Update data dir

* Add plugin dir env variable

* Update github action and env var used in install avago script

* Filter out both precompile and load test from unit test script

* Add comment about skipping load test in unit test script

* Fix lint geth allowed pkgs

* Address nits

* Remove unused DATA_DIRs var from run script

* Add TODO to update run script to allow running N nodes instead of just one

* Update READMEs

* Break down simulator

* Cleanup

* Update cmd/simulator/README.md

* Update cmd/simulator/README.md

* Update cmd/simulator/README.md

* Update contract-examples/README.md

* Address review comments

* Address PR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Anything testing-related
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants