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

cannon: Run expensive tests in parallel #11739

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cannon/mipsevm/tests/evm_common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,14 @@ func TestEVMFault(t *testing.T) {
}

func TestHelloEVM(t *testing.T) {
t.Parallel()
var tracer *tracing.Hooks // no-tracer by default, but see test_util.MarkdownTracer
versions := GetMipsVersionTestCases(t)

for _, v := range versions {
v := v
t.Run(v.Name, func(t *testing.T) {
t.Parallel()
evm := testutil.NewMIPSEVM(v.Contracts)
evm.SetTracer(tracer)
testutil.LogStepFailureAtCleanup(t, evm)
Expand Down Expand Up @@ -502,11 +505,14 @@ func TestHelloEVM(t *testing.T) {
}

func TestClaimEVM(t *testing.T) {
t.Parallel()
var tracer *tracing.Hooks // no-tracer by default, but see test_util.MarkdownTracer
versions := GetMipsVersionTestCases(t)

for _, v := range versions {
v := v
t.Run(v.Name, func(t *testing.T) {
t.Parallel()
evm := testutil.NewMIPSEVM(v.Contracts)
evm.SetTracer(tracer)
testutil.LogStepFailureAtCleanup(t, evm)
Expand Down Expand Up @@ -549,11 +555,14 @@ func TestClaimEVM(t *testing.T) {
}

func TestEntryEVM(t *testing.T) {
t.Parallel()
var tracer *tracing.Hooks // no-tracer by default, but see test_util.MarkdownTracer
versions := GetMipsVersionTestCases(t)

for _, v := range versions {
v := v
t.Run(v.Name, func(t *testing.T) {
t.Parallel()
evm := testutil.NewMIPSEVM(v.Contracts)
evm.SetTracer(tracer)
testutil.LogStepFailureAtCleanup(t, evm)
Expand Down
4 changes: 4 additions & 0 deletions cannon/mipsevm/tests/evm_multithreaded_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ func TestEVM_NoopSyscall(t *testing.T) {
}

func TestEVM_UnsupportedSyscall(t *testing.T) {
t.Parallel()
var tracer *tracing.Hooks

var NoopSyscallNums = maps.Values(NoopSyscalls)
Expand All @@ -638,7 +639,10 @@ func TestEVM_UnsupportedSyscall(t *testing.T) {

for i, syscallNum := range unsupportedSyscalls {
testName := fmt.Sprintf("Unsupported syscallNum %v", syscallNum)
i := i
syscallNum := syscallNum
t.Run(testName, func(t *testing.T) {
t.Parallel()
goVm, state, contracts := setup(t, i*3434)
// Setup basic getThreadId syscall instruction
state.Memory.SetMemory(state.GetPC(), syscallInsn)
Expand Down