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

[spike] Refactor TestIssueAtomicTxs as an integration test #377

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

marun
Copy link
Contributor

@marun marun commented Nov 3, 2023

Why this should be merged

This refactor is intended to demonstrate the potential of writing integration tests against a fixture interface that can be implemented by both a bare VM and a network API. This should support more comprehensive test coverage for minimal additional cost.

How this works

  • TestIssueAtomicTxs is factored into test code and fixture. The test is intended to be configured at runtime to use a VM or network fixture.

How this was tested

A new integration test suite that includes the refactored test is executed in CI (via scripts/tests.integration.sh) as part of the unit test job (with vm fixture) and a new integration test job (with network fixture).

TODO

scripts/versions.sh Outdated Show resolved Hide resolved
@marun marun force-pushed the vm-integration-fixture branch 2 times, most recently from c1a8164 to 8746622 Compare November 8, 2023 20:21
@marun marun added testing Anything testing-related integration-testing Refactoring of unit tests to fixture-based integration labels Nov 13, 2023
@marun marun assigned marun and unassigned aaronbuchwald Nov 13, 2023
@marun marun force-pushed the vm-integration-fixture branch 3 times, most recently from 308266a to 923dc81 Compare November 20, 2023 17:07
@marun marun force-pushed the vm-integration-fixture branch 2 times, most recently from 4fe7024 to 4843b22 Compare December 1, 2023 00:32
@marun marun marked this pull request as ready for review December 1, 2023 00:45
@marun marun force-pushed the vm-integration-fixture branch 3 times, most recently from 420e05a to 8860ccd Compare December 1, 2023 13:59
.github/workflows/ci.yml Outdated Show resolved Hide resolved
plugin/evm/shared_test_vm_fixture.go Show resolved Hide resolved
plugin/evm/shared_test_vm_fixture.go Outdated Show resolved Hide resolved
plugin/evm/shared_test_vm_fixture.go Show resolved Hide resolved
plugin/evm/shared_test_vm_fixture.go Show resolved Hide resolved
@marun marun marked this pull request as draft December 4, 2023 17:23
@marun marun changed the title Refactor TestIssueAtomicTxs as an integration test [spike] Refactor TestIssueAtomicTxs as an integration test Dec 4, 2023
@marun marun marked this pull request as ready for review December 15, 2023 06:32
@marun marun marked this pull request as draft December 15, 2023 06:42
assert.Equal(t, uint64(2), height, "expected height of indexed export tx to be 2")
assert.Equal(t, indexedExportTx.ID(), exportTx.ID(), "expected ID of indexed import tx to match original txID")
}

func TestBuildEthTxBlock(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should be confident that the fixture can interface with most if not all the tests in vm_test.go vm_warp_test.go, (eg, do some of these instantiate more than 1 vm?)
Some of the tests in syncervm_test.go are also candidates, but somewhat a stretch goal.

var fixture IntegrationFixture
if e2e.Env == nil {
// Shared network fixture not initialized, return a vm fixture
fixture = evm.CreateVMFixture(ginkgo.GinkgoT())
Copy link
Collaborator

Choose a reason for hiding this comment

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

smaller comment: Should we consider calling the light (VM) fixture from the unit tests? This would continue running them with race detection, and on the different OS-es.

@darioush
Copy link
Collaborator

I like what this change achieves. I think it makes sense to run the "VM-level unit tests" against a full node.
I think we should try to develop on subnet-evm first for this change (or see if the same style applies).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-testing Refactoring of unit tests to fixture-based integration testing Anything testing-related
Projects
Status: Paused 🧊
Status: Backlog 🗄
Development

Successfully merging this pull request may close these issues.

None yet

4 participants