From 8f2e591d862d5c5787a24555482bf642f39098c8 Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Thu, 30 May 2024 15:48:59 +0300 Subject: [PATCH] test: handled TestGenerateComposeServices/Test_generation_of_compose_services_validator:_grandine,_network:_mainnet,_only_validator Test Case --- internal/pkg/clients/init.go | 2 +- .../pkg/generate/generate_scripts_test.go | 23 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/internal/pkg/clients/init.go b/internal/pkg/clients/init.go index 575bcee2f..b9af108c5 100644 --- a/internal/pkg/clients/init.go +++ b/internal/pkg/clients/init.go @@ -27,7 +27,7 @@ var AllClients map[string][]string = map[string][]string{ "prysm", "teku", "lodestar", - "grandine",//add grandine + "grandine", }, "validator": { "lighthouse", diff --git a/internal/pkg/generate/generate_scripts_test.go b/internal/pkg/generate/generate_scripts_test.go index 38ad4355b..9c911c18d 100644 --- a/internal/pkg/generate/generate_scripts_test.go +++ b/internal/pkg/generate/generate_scripts_test.go @@ -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{