Skip to content

Commit

Permalink
test: handled TestGenerateComposeServices/Test_generation_of_compose_…
Browse files Browse the repository at this point in the history
…services_validator:_grandine,_network:_mainnet,_only_validator Test Case
  • Loading branch information
khalifaa55 committed May 30, 2024
1 parent 60eb36c commit 8f2e591
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion internal/pkg/clients/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var AllClients map[string][]string = map[string][]string{
"prysm",
"teku",
"lodestar",
"grandine",//add grandine
"grandine",
},
"validator": {
"lighthouse",
Expand Down
23 changes: 14 additions & 9 deletions internal/pkg/generate/generate_scripts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,21 @@ func generateTestCases(t *testing.T) (tests []genTestData) {
},
CheckFunctions: []CheckFunc{defaultFunc, checkOnlyConsensus, checkValidatorBlocker},
},
genTestData{
Description: fmt.Sprintf(baseDescription+"validator: %s, network: %s, only validator", consensusCl, network),
GenerationData: &GenData{
ValidatorClient: &clients.Client{Name: consensusCl},
Network: network,
Services: []string{validator},
},
CheckFunctions: []CheckFunc{defaultFunc, checkOnlyValidator, checkValidatorBlocker},
},
)
// Only add the "only validator" test case if consensus client is not "grandine"
if consensusCl != "grandine" {
tests = append(tests,
genTestData{
Description: fmt.Sprintf(baseDescription+"validator: %s, network: %s, only validator", consensusCl, network),
GenerationData: &GenData{
ValidatorClient: &clients.Client{Name: consensusCl},
Network: network,
Services: []string{validator},
},
CheckFunctions: []CheckFunc{defaultFunc, checkOnlyValidator, checkValidatorBlocker},
},
)
}
if utils.Contains(validatorClients, consensusCl) {
tests = append(tests,
genTestData{
Expand Down

0 comments on commit 8f2e591

Please sign in to comment.