diff --git a/infra/ec2/common/template.go b/infra/ec2/common/template.go index 40134edf6..6c45cf541 100644 --- a/infra/ec2/common/template.go +++ b/infra/ec2/common/template.go @@ -6,6 +6,10 @@ import ( "crypto/x509" "encoding/pem" "fmt" + "os" + "strings" + "text/template" + "github.com/aws/aws-cdk-go/awscdk/v2" "github.com/aws/aws-cdk-go/awscdk/v2/awsec2" "github.com/aws/aws-cdk-go/awscdk/v2/awsiam" @@ -16,9 +20,6 @@ import ( "github.com/google/uuid" "github.com/rs/zerolog/log" "golang.org/x/crypto/ssh" - "os" - "strings" - "text/template" ) const ( diff --git a/infra/ec2/ec2.go b/infra/ec2/ec2.go index c4c15dda1..d25e6f2e8 100644 --- a/infra/ec2/ec2.go +++ b/infra/ec2/ec2.go @@ -2,6 +2,7 @@ package main import ( "ec2/common" + "github.com/aws/aws-cdk-go/awscdk/v2/awsec2" "github.com/aws/jsii-runtime-go" "github.com/rs/zerolog/log" diff --git a/tools/flakeguard/runner/parser/parser_test.go b/tools/flakeguard/runner/parser/parser_test.go index 5360abaf2..432f60ce0 100644 --- a/tools/flakeguard/runner/parser/parser_test.go +++ b/tools/flakeguard/runner/parser/parser_test.go @@ -1091,51 +1091,50 @@ func TestParseFiles_WithPanicEventFile(t *testing.T) { // Map test names to expected values for easier assertions expected := map[string]struct { - pkg string - pkgPanic bool - panic bool - passRatio float64 - runs int - failures int - successes int - skipped bool - skips int + pkg string + pkgPanic bool + panic bool + passRatio float64 + runs int + failures int + successes int + skipped bool + skips int }{ - "Test_EventHandlerStateSync": { - pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: true, panic: false, passRatio: 1, runs: 1, failures: 0, successes: 1, skipped: false, skips: 0, - }, - "Test_InitialStateSync": { - pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: true, panic: false, passRatio: 1, runs: 1, failures: 0, successes: 1, skipped: false, skips: 0, - }, - "Test_RegistrySyncer_SkipsEventsNotBelongingToDON": { - pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: true, panic: false, passRatio: 1, runs: 1, failures: 0, successes: 1, skipped: false, skips: 0, - }, - "Test_RegistrySyncer_WorkflowRegistered_InitiallyActivated": { - pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: true, panic: true, passRatio: 0, runs: 1, failures: 1, successes: 0, skipped: false, skips: 0, - }, - "Test_RegistrySyncer_WorkflowRegistered_InitiallyPaused": { - pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: true, panic: false, passRatio: 1, runs: 1, failures: 0, successes: 1, skipped: false, skips: 0, - }, - "Test_SecretsWorker": { - pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: false, panic: false, passRatio: 1, runs: 0, failures: 0, successes: 0, skipped: true, skips: 1, - }, + "Test_EventHandlerStateSync": { + pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: true, panic: false, passRatio: 1, runs: 1, failures: 0, successes: 1, skipped: false, skips: 0, + }, + "Test_InitialStateSync": { + pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: true, panic: false, passRatio: 1, runs: 1, failures: 0, successes: 1, skipped: false, skips: 0, + }, + "Test_RegistrySyncer_SkipsEventsNotBelongingToDON": { + pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: true, panic: false, passRatio: 1, runs: 1, failures: 0, successes: 1, skipped: false, skips: 0, + }, + "Test_RegistrySyncer_WorkflowRegistered_InitiallyActivated": { + pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: true, panic: true, passRatio: 0, runs: 1, failures: 1, successes: 0, skipped: false, skips: 0, + }, + "Test_RegistrySyncer_WorkflowRegistered_InitiallyPaused": { + pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: true, panic: false, passRatio: 1, runs: 1, failures: 0, successes: 1, skipped: false, skips: 0, + }, + "Test_SecretsWorker": { + pkg: "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer", pkgPanic: false, panic: false, passRatio: 1, runs: 0, failures: 0, successes: 0, skipped: true, skips: 1, + }, } for _, r := range results { - exp, ok := expected[r.TestName] - require.True(t, ok, "Unexpected test name: %s", r.TestName) - assert.Equal(t, exp.pkg, r.TestPackage, "Package mismatch for %s", r.TestName) - assert.Equal(t, exp.pkgPanic, r.PackagePanic, "PackagePanic mismatch for %s", r.TestName) - assert.Equal(t, exp.panic, r.Panic, "Panic mismatch for %s", r.TestName) - assert.InDelta(t, exp.passRatio, r.PassRatio, 0.001, "PassRatio mismatch for %s", r.TestName) - assert.Equal(t, exp.runs, r.Runs, "Runs mismatch for %s", r.TestName) - assert.Equal(t, exp.failures, r.Failures, "Failures mismatch for %s", r.TestName) - assert.Equal(t, exp.successes, r.Successes, "Successes mismatch for %s", r.TestName) - assert.Equal(t, exp.skipped, r.Skipped, "Skipped mismatch for %s", r.TestName) - assert.Equal(t, exp.skips, r.Skips, "Skips count mismatch for %s", r.TestName) + exp, ok := expected[r.TestName] + require.True(t, ok, "Unexpected test name: %s", r.TestName) + assert.Equal(t, exp.pkg, r.TestPackage, "Package mismatch for %s", r.TestName) + assert.Equal(t, exp.pkgPanic, r.PackagePanic, "PackagePanic mismatch for %s", r.TestName) + assert.Equal(t, exp.panic, r.Panic, "Panic mismatch for %s", r.TestName) + assert.InDelta(t, exp.passRatio, r.PassRatio, 0.001, "PassRatio mismatch for %s", r.TestName) + assert.Equal(t, exp.runs, r.Runs, "Runs mismatch for %s", r.TestName) + assert.Equal(t, exp.failures, r.Failures, "Failures mismatch for %s", r.TestName) + assert.Equal(t, exp.successes, r.Successes, "Successes mismatch for %s", r.TestName) + assert.Equal(t, exp.skipped, r.Skipped, "Skipped mismatch for %s", r.TestName) + assert.Equal(t, exp.skips, r.Skips, "Skips count mismatch for %s", r.TestName) } - } func TestParseFiles_WithPanicEventFileSpecific(t *testing.T) {