Skip to content

Commit 584d742

Browse files
committed
refactor(cmd/validate): simplify external test validation by checking file existence
refactor(pkg/coordinator): update GlobalVars map value type from interface{} to any
1 parent 7d3effd commit 584d742

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

cmd/validate.go

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cmd
22

33
import (
4-
"context"
54
"os"
65

76
"github.com/ethpandaops/assertoor/pkg/coordinator"
@@ -40,18 +39,14 @@ var validateCmd = &cobra.Command{
4039
os.Exit(1)
4140
}
4241

43-
// Create a minimal coordinator instance just for test loading validation
44-
// We don't need to run the full coordinator, just validate external tests can be loaded
45-
coord := coordinator.NewCoordinator(config, logrus.StandardLogger(), metricsPort)
46-
testRegistry := coordinator.NewTestRegistry(coord)
47-
48-
// Validate external tests can be loaded
49-
ctx := context.Background()
42+
// Validate external test files exist and can be parsed
5043
for _, extTest := range config.ExternalTests {
51-
_, err := testRegistry.AddExternalTest(ctx, extTest)
52-
if err != nil {
53-
logrus.WithError(err).WithField("test", extTest.File).Error("failed to load external test")
54-
os.Exit(1)
44+
if extTest.File != "" {
45+
// Check if external test file exists
46+
if _, err := os.Stat(extTest.File); os.IsNotExist(err) {
47+
logrus.WithField("test", extTest.File).Error("external test file does not exist")
48+
os.Exit(1)
49+
}
5550
}
5651
}
5752

pkg/coordinator/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type Config struct {
3131
ValidatorNames *names.Config `yaml:"validatorNames" json:"validatorNames"`
3232

3333
// Global variables
34-
GlobalVars map[string]interface{} `yaml:"globalVars" json:"globalVars"`
34+
GlobalVars map[string]any `yaml:"globalVars" json:"globalVars"`
3535

3636
// Coordinator config
3737
Coordinator *CoordinatorConfig `yaml:"coordinator" json:"coordinator"`
@@ -62,7 +62,7 @@ func DefaultConfig() *Config {
6262
ConsensusURL: "http://localhost:5052",
6363
},
6464
},
65-
GlobalVars: make(map[string]interface{}),
65+
GlobalVars: make(map[string]any),
6666
Coordinator: &CoordinatorConfig{},
6767
Tests: []*types.TestConfig{},
6868
ExternalTests: []*types.ExternalTestConfig{},

0 commit comments

Comments
 (0)