@@ -1077,8 +1077,6 @@ func TestParseFiles_IgnoreParentFailures(t *testing.T) {
10771077}
10781078
10791079func TestParseFiles_WithPanicEventFile (t * testing.T ) {
1080-
1081- t .Skip ("Failing test, needs investigation" )
10821080 t .Parallel ()
10831081
10841082 parser := NewParser ()
@@ -1090,20 +1088,72 @@ func TestParseFiles_WithPanicEventFile(t *testing.T) {
10901088 }
10911089
10921090 assert .Equal (t , 6 , len (results ), "Expected 6 test results from file." )
1091+
1092+ // Map test names to expected values for easier assertions
1093+ expected := map [string ]struct {
1094+ pkg string
1095+ pkgPanic bool
1096+ panic bool
1097+ passRatio float64
1098+ runs int
1099+ failures int
1100+ successes int
1101+ skipped bool
1102+ skips int
1103+ }{
1104+ "Test_EventHandlerStateSync" : {
1105+ 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 ,
1106+ },
1107+ "Test_InitialStateSync" : {
1108+ 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 ,
1109+ },
1110+ "Test_RegistrySyncer_SkipsEventsNotBelongingToDON" : {
1111+ 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 ,
1112+ },
1113+ "Test_RegistrySyncer_WorkflowRegistered_InitiallyActivated" : {
1114+ 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 ,
1115+ },
1116+ "Test_RegistrySyncer_WorkflowRegistered_InitiallyPaused" : {
1117+ 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 ,
1118+ },
1119+ "Test_SecretsWorker" : {
1120+ 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 ,
1121+ },
1122+ }
1123+
1124+ for _ , r := range results {
1125+ exp , ok := expected [r .TestName ]
1126+ require .True (t , ok , "Unexpected test name: %s" , r .TestName )
1127+ assert .Equal (t , exp .pkg , r .TestPackage , "Package mismatch for %s" , r .TestName )
1128+ assert .Equal (t , exp .pkgPanic , r .PackagePanic , "PackagePanic mismatch for %s" , r .TestName )
1129+ assert .Equal (t , exp .panic , r .Panic , "Panic mismatch for %s" , r .TestName )
1130+ assert .InDelta (t , exp .passRatio , r .PassRatio , 0.001 , "PassRatio mismatch for %s" , r .TestName )
1131+ assert .Equal (t , exp .runs , r .Runs , "Runs mismatch for %s" , r .TestName )
1132+ assert .Equal (t , exp .failures , r .Failures , "Failures mismatch for %s" , r .TestName )
1133+ assert .Equal (t , exp .successes , r .Successes , "Successes mismatch for %s" , r .TestName )
1134+ assert .Equal (t , exp .skipped , r .Skipped , "Skipped mismatch for %s" , r .TestName )
1135+ assert .Equal (t , exp .skips , r .Skips , "Skips count mismatch for %s" , r .TestName )
1136+ }
1137+
1138+
10931139}
10941140
10951141func TestParseFiles_WithPanicEventFileSpecific (t * testing.T ) {
1096- t .Skip ("Failing test, needs investigation" )
10971142 t .Parallel ()
10981143
10991144 parser := NewParser ()
11001145 filePath := "testdata/events-with-panic-single.json"
11011146
11021147 results , _ , err := parser .ParseFiles ([]string {filePath }, "run" , 1 , Config {})
1103-
11041148 if err != nil {
11051149 t .Fatalf ("Failed to parse event file: %v" , err )
11061150 }
1107-
11081151 assert .Equal (t , 1 , len (results ), "Expected 6 test results from file." )
1152+
1153+ testResult := results [0 ]
1154+
1155+ assert .True (t , testResult .Panic , "Expected test result to be marked as panic" )
1156+ assert .True (t , testResult .PackagePanic , "Expected test result to be marked as panic" )
1157+ assert .Equal (t , "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/workflows/syncer" , testResult .TestPackage , "Test package mismatch" )
1158+ assert .Equal (t , "Test_RegistrySyncer_WorkflowRegistered_InitiallyActivated" , testResult .TestName , "Test name mismatch" )
11091159}
0 commit comments