Skip to content

Commit

Permalink
chore: Add create log artifacts when e2e test fails
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Paschenko <[email protected]>
  • Loading branch information
Steamvis committed Jan 17, 2025
1 parent 7b38556 commit 54d7b38
Show file tree
Hide file tree
Showing 11 changed files with 925 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/ci_templates/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,22 @@ check_e2e_labels:
INITIAL_IMAGE_TAG: ${{ steps.setup.outputs.initial-image-tag }}
{!{- tmpl.Exec "e2e_run_template" (slice .provider "run-test" (coll.Has $ctx "manualRun") ) | strings.Indent 6 }!}

################################################### Collect logs when e2e failed ###########################
{!{- if coll.Has $ctx "manualRun" }!}
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: {!{ $ctx.providerName }!}
LAYOUT: {!{ $ctx.layout }!}
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
{!{- end }!}
################################################### Collect logs when e2e failed ###########################

{!{- if coll.Has $ctx "manualRun" }!}
- name: Read connection string
if: ${{ failure() || cancelled() }}
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/e2e-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: AWS
LAYOUT: WithoutNAT
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -1024,6 +1038,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: AWS
LAYOUT: WithoutNAT
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -1519,6 +1547,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: AWS
LAYOUT: WithoutNAT
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -2014,6 +2056,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: AWS
LAYOUT: WithoutNAT
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -2509,6 +2565,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: AWS
LAYOUT: WithoutNAT
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -3004,6 +3074,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: AWS
LAYOUT: WithoutNAT
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -3499,6 +3583,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: AWS
LAYOUT: WithoutNAT
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/e2e-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: Azure
LAYOUT: Standard
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -1036,6 +1050,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: Azure
LAYOUT: Standard
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -1539,6 +1567,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: Azure
LAYOUT: Standard
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -2042,6 +2084,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: Azure
LAYOUT: Standard
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -2545,6 +2601,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: Azure
LAYOUT: Standard
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -3048,6 +3118,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: Azure
LAYOUT: Standard
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down Expand Up @@ -3551,6 +3635,20 @@ jobs:
bash /deckhouse/testing/cloud_layouts/script.sh run-test
# </template: e2e_run_template>

################################################### Collect logs when e2e failed ###########################
- name: "Create log artifacts when e2e testing fails"
id: create_e2e_tests_logs
if: failure() || cancelled()
env:
PROVIDER: Azure
LAYOUT: Standard
SSH_CONNECT_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_connection_str_file }}
SSH_BASTION_STR_FILE: ${{ steps.e2e_test_run.outputs.ssh_bastion_str_file }}
run: |
ls -la $(pwd)/testing/${PROVIDER}/${LAYOUT}
cat $SSH_CONNECT_STR_FILE
################################################### Collect logs when e2e failed ###########################
- name: Read connection string
if: ${{ failure() || cancelled() }}
id: check_stay_failed_cluster
Expand Down
Loading

0 comments on commit 54d7b38

Please sign in to comment.