Skip to content
Open
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
7 changes: 4 additions & 3 deletions infra/ec2/common/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -16,9 +20,6 @@ import (
"github.com/google/uuid"
"github.com/rs/zerolog/log"
"golang.org/x/crypto/ssh"
"os"
"strings"
"text/template"
)

const (
Expand Down
1 change: 1 addition & 0 deletions infra/ec2/ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
77 changes: 38 additions & 39 deletions tools/flakeguard/runner/parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down