-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
op-e2e: Support specifying allocs in tests #12216
Conversation
Semgrep found 1 Inputs to functions must be prepended with an underscore ( |
Previously, the E2E test suite read a hardcoded set of allocs from the `.devnet` directory. There could only be one logical set of allocs per test suite run. To get around this limitation, we added matrix jobs to the CI pipeline that swapped in different versions of the allocs for alt-DA, MT Cannon, fault proofs, and the L2OO. This was very inefficient and complex: most tests don't need to run against multiple versions of the allocs, and were running 4 separate build jobs when only one was needed. This PR makes it possible for an individual test to request a specific allocs file. We can now run tests for multiple different configurations of the OP Stack - e.g. alt-DA, L2OO and fault proofs - in a single test run. To make this work, I updated the test suite's initialization method to read alloc files from multiple suffixed `.devnet-` directories. I made a a new `make devnet-allocs-tests` task to generate them. The allocs are then added to a map, and the rest of the tests use getter methods in the `config` package to locate the appropriate configuration structs. This PR seems large, but most of the modified files contain limited changes to comply with the new API for selecting test configuration based on alloc type. For example, an `allocType` configuration parameter was added to various system config structs and the `DefaultRollupTestParams` variable was made into a method so that it always returns a copy for easy extension. The important logic happens in the following files: - Makefile - .circleci/config.yml - op-e2e/config/init.go As part of this PR, I also cleaned up a few issues: - I removed the external OP Geth shim. It wasn't used anywhere, and was introducing a lot of complexity for little gain. - I refactored some tests to use top-level test methods rather than subtests so that they could be more easily parallelized. - I removed references to `UseFaultProofs`, `UseAltDA`, and other environment-based test flags from test utilities. We shouldn't be reading from the environment in test utils. Instead, we should pass in the behavior we want to the test utils themselves.
aa8c819
to
ff132bc
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #12216 +/- ##
===========================================
- Coverage 75.19% 74.97% -0.22%
===========================================
Files 49 49
Lines 3665 3665
===========================================
- Hits 2756 2748 -8
- Misses 736 745 +9
+ Partials 173 172 -1
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Seems like a big improvement in flexibility that we can keep building on to support completely custom configs at some point without having to pre-generate them.
I'm not entirely sure what the mt-cannon tests are doing - they seem to still have some special treatment. Given we now have multicannon which will select the right version of cannon to run automatically based on the prestate, we should be able to just have tests that actually run cannon setup to run their tests with both Standard and MtCannon allocs and have it just work.
I also put up #12221 which reads the AllocType from the System
when configuring the challenger so it doesn't need to be pulled from the env which maybe helps with part of that too.
Confirmed that the MT cannon tests can just run as a standard alloc type with #12221. No need for special env vars. 🎉 |
962ba73
to
16537d9
Compare
* op-e2e: Support specifying allocs in tests Previously, the E2E test suite read a hardcoded set of allocs from the `.devnet` directory. There could only be one logical set of allocs per test suite run. To get around this limitation, we added matrix jobs to the CI pipeline that swapped in different versions of the allocs for alt-DA, MT Cannon, fault proofs, and the L2OO. This was very inefficient and complex: most tests don't need to run against multiple versions of the allocs, and were running 4 separate build jobs when only one was needed. This PR makes it possible for an individual test to request a specific allocs file. We can now run tests for multiple different configurations of the OP Stack - e.g. alt-DA, L2OO and fault proofs - in a single test run. To make this work, I updated the test suite's initialization method to read alloc files from multiple suffixed `.devnet-` directories. I made a a new `make devnet-allocs-tests` task to generate them. The allocs are then added to a map, and the rest of the tests use getter methods in the `config` package to locate the appropriate configuration structs. This PR seems large, but most of the modified files contain limited changes to comply with the new API for selecting test configuration based on alloc type. For example, an `allocType` configuration parameter was added to various system config structs and the `DefaultRollupTestParams` variable was made into a method so that it always returns a copy for easy extension. The important logic happens in the following files: - Makefile - .circleci/config.yml - op-e2e/config/init.go As part of this PR, I also cleaned up a few issues: - I removed the external OP Geth shim. It wasn't used anywhere, and was introducing a lot of complexity for little gain. - I refactored some tests to use top-level test methods rather than subtests so that they could be more easily parallelized. - I removed references to `UseFaultProofs`, `UseAltDA`, and other environment-based test flags from test utilities. We shouldn't be reading from the environment in test utils. Instead, we should pass in the behavior we want to the test utils themselves. * code review updates * fix gastoken test * fixes
Overview
Previously, the E2E test suite read a hardcoded set of allocs from the
.devnet
directory. There could only be one logical set of allocs per test suite run. To get around this limitation, we added matrix jobs to the CI pipeline that swapped in different versions of the allocs for alt-DA, MT Cannon, fault proofs, and the L2OO. This was very inefficient and complex: most tests don't need to run against multiple versions of the allocs, and were running 4 separate build jobs when only one was needed.This PR makes it possible for an individual test to request a specific allocs file. We can now run tests for multiple different configurations of the OP Stack - e.g. alt-DA, L2OO and fault proofs - in a single test run.
To make this work, I updated the test suite's initialization method to read alloc files from multiple suffixed
.devnet-
directories. I made a a newmake devnet-allocs-tests
task to generate them. The allocs are then added to a map, and the rest of the tests use getter methods in theconfig
package to locate the appropriate configuration structs.Reviewing this PR
This PR seems large, but most of the modified files contain limited changes to comply with the new API for selecting test configuration based on alloc type. For example, an
allocType
configuration parameter was added to various system config structs and theDefaultRollupTestParams
variable was made into a method so that it always returns a copy for easy extension. The important logic happens in the following files:As part of this PR, I also cleaned up a few issues:
UseFaultProofs
,UseAltDA
, and other environment-based test flags from test utilities. We shouldn't be reading from the environment in test utils. Instead, we should pass in the behavior we want to the test utils themselves.