From 3f4860fba5ac14f38cb69f920f4dfd4dfb361217 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 9 Jul 2024 14:19:59 +0200 Subject: [PATCH] npe protection, step condition streamlining --- .github/workflows/client-compatibility-tests.yml | 3 ++- integration-tests/docker/test_env/test_env_builder.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/client-compatibility-tests.yml b/.github/workflows/client-compatibility-tests.yml index 2a343214a35..d0563789edc 100644 --- a/.github/workflows/client-compatibility-tests.yml +++ b/.github/workflows/client-compatibility-tests.yml @@ -160,6 +160,7 @@ jobs: echo "New reth release found: $new_reth" implementations_arr+=("reth") fi + IFS=',' eth_implementations="${implementations_arr[*]}" if [ -n "$eth_implementations" ]; then @@ -307,7 +308,7 @@ jobs: get-latest-available-images: name: Get Latest EVM Implementation's Images - if: always() && needs.should-run.outputs.should_run == 'true' && (needs.select-versions.outputs.evm_implementations != '' || github.event.inputs.base64TestList != '') + if: always() && needs.should-run.outputs.should_run == 'true' && needs.select-versions.outputs.evm_implementations != '' && github.event.inputs.base64TestList != '' environment: integration runs-on: ubuntu-latest needs: [check-ecr-images-exist, should-run, select-versions] diff --git a/integration-tests/docker/test_env/test_env_builder.go b/integration-tests/docker/test_env/test_env_builder.go index 19ab64671e8..4f6d92a8db2 100644 --- a/integration-tests/docker/test_env/test_env_builder.go +++ b/integration-tests/docker/test_env/test_env_builder.go @@ -280,6 +280,10 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) { // new logs can be added to the log stream, so parallel processing would get stuck on waiting for it to be unlocked LogScanningLoop: for i := 0; i < b.clNodesCount; i++ { + // if something went wrong during environment setup we might not have all nodes, and we don't want an NPE + if b.te.ClCluster == nil || b.te.ClCluster.Nodes == nil || len(b.te.ClCluster.Nodes) < i || b.te.ClCluster.Nodes[i] == nil { + continue + } // ignore count return, because we are only interested in the error _, err := logProcessor.ProcessContainerLogs(b.te.ClCluster.Nodes[i].ContainerName, processFn) if err != nil && !strings.Contains(err.Error(), testreporters.MultipleLogsAtLogLevelErr) && !strings.Contains(err.Error(), testreporters.OneLogAtLogLevelErr) {