Skip to content

Commit 9ed26c2

Browse files
chore: always collect e2e support bundles and recordings (#837)
collect everything even in case of success.
1 parent cc308a4 commit 9ed26c2

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

.github/actions/e2e/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,25 +107,25 @@ runs:
107107
make e2e-test TEST_NAME=${{ inputs.test-name }}
108108
- name: Upload Host Support Bundle
109109
uses: actions/upload-artifact@v4
110-
if: ${{ failure() }}
110+
if: ${{ ! cancelled() }}
111111
with:
112112
name: ${{ inputs.test-name }}-support-bundle-host.tar.gz
113113
path: ./e2e/support-bundle-host-*.tar.gz
114114
- name: Upload Cluster Support Bundle
115115
uses: actions/upload-artifact@v4
116-
if: ${{ failure() }}
116+
if: ${{ ! cancelled() }}
117117
with:
118118
name: ${{ inputs.test-name }}-support-bundle-cluster.tar.gz
119119
path: ./e2e/support-bundle-cluster.tar.gz
120120
- name: Upload Playwright Report
121121
id: upload-playwright-report
122122
uses: actions/upload-artifact@v4
123-
if: ${{ failure() }}
123+
if: ${{ ! cancelled() }}
124124
with:
125125
name: ${{ inputs.test-name }}-playwright-report.tar.gz
126126
path: ./e2e/playwright-report.tar.gz
127127
- name: Print instructions to view Playwright report
128-
if: ${{ failure() && steps.upload-playwright-report.outputs.artifact-url != '' }}
128+
if: ${{ ! cancelled() && steps.upload-playwright-report.outputs.artifact-url != '' }}
129129
run: |
130130
echo -e "\e[1;33m┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐\e[0m"
131131
echo -e "\e[1;33m To view the Playwright test report: \e[0m"

e2e/install_test.go

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,12 +1865,12 @@ func generateAndCopySupportBundle(t *testing.T, tc *cluster.Output) {
18651865
if stdout, stderr, err := RunCommandOnNode(t, tc, 0, line); err != nil {
18661866
t.Logf("stdout: %s", stdout)
18671867
t.Logf("stderr: %s", stderr)
1868-
t.Errorf("fail to generate cluster support from node %s bundle: %v", node, err)
1869-
}
1870-
1871-
t.Logf("%s: copying cluster support bundle from node %s to local machine", time.Now().Format(time.RFC3339), node)
1872-
if err := cluster.CopyFileFromNode(node, "/root/cluster.tar.gz", "support-bundle-cluster.tar.gz"); err != nil {
1873-
t.Errorf("fail to copy cluster support bundle from node %s to local machine: %v", node, err)
1868+
t.Logf("fail to generate cluster support from node %s bundle: %v", node, err)
1869+
} else {
1870+
t.Logf("%s: copying cluster support bundle from node %s to local machine", time.Now().Format(time.RFC3339), node)
1871+
if err := cluster.CopyFileFromNode(node, "/root/cluster.tar.gz", "support-bundle-cluster.tar.gz"); err != nil {
1872+
t.Logf("fail to copy cluster support bundle from node %s to local machine: %v", node, err)
1873+
}
18741874
}
18751875

18761876
for i, node := range tc.Nodes {
@@ -1879,12 +1879,13 @@ func generateAndCopySupportBundle(t *testing.T, tc *cluster.Output) {
18791879
if stdout, stderr, err := RunCommandOnNode(t, tc, i, line); err != nil {
18801880
t.Logf("stdout: %s", stdout)
18811881
t.Logf("stderr: %s", stderr)
1882-
t.Errorf("fail to generate support from node %s bundle: %v", node, err)
1882+
t.Logf("fail to generate support from node %s bundle: %v", node, err)
1883+
continue
18831884
}
18841885

18851886
t.Logf("%s: copying host support bundle from node %s to local machine", time.Now().Format(time.RFC3339), node)
18861887
if err := cluster.CopyFileFromNode(node, "/root/host.tar.gz", fmt.Sprintf("support-bundle-host-%s.tar.gz", node)); err != nil {
1887-
t.Errorf("fail to copy host support bundle from node %s to local machine: %v", node, err)
1888+
t.Logf("fail to copy host support bundle from node %s to local machine: %v", node, err)
18881889
}
18891890
}
18901891
}
@@ -1894,29 +1895,27 @@ func copyPlaywrightReport(t *testing.T, tc *cluster.Output) {
18941895
if tc.Proxy != "" {
18951896
t.Logf("%s: compressing playwright report on proxy node", time.Now().Format(time.RFC3339))
18961897
if _, _, err := RunCommandOnProxyNode(t, tc, line); err != nil {
1897-
t.Errorf("fail to compress playwright report on node %s: %v", tc.Proxy, err)
1898+
t.Logf("fail to compress playwright report on node %s: %v", tc.Proxy, err)
18981899
return
18991900
}
19001901
t.Logf("%s: copying playwright report to local machine", time.Now().Format(time.RFC3339))
19011902
if err := cluster.CopyFileFromNode(tc.Proxy, "/root/playwright-report.tar.gz", "playwright-report.tar.gz"); err != nil {
1902-
t.Errorf("fail to copy playwright report to local machine: %v", err)
1903+
t.Logf("fail to copy playwright report to local machine: %v", err)
19031904
}
19041905
} else {
19051906
t.Logf("%s: compressing playwright report on node 0", time.Now().Format(time.RFC3339))
19061907
if _, _, err := RunCommandOnNode(t, tc, 0, line); err != nil {
1907-
t.Errorf("fail to compress playwright report on node %s: %v", tc.Nodes[0], err)
1908+
t.Logf("fail to compress playwright report on node %s: %v", tc.Nodes[0], err)
19081909
return
19091910
}
19101911
t.Logf("%s: copying playwright report to local machine", time.Now().Format(time.RFC3339))
19111912
if err := cluster.CopyFileFromNode(tc.Nodes[0], "/root/playwright-report.tar.gz", "playwright-report.tar.gz"); err != nil {
1912-
t.Errorf("fail to copy playwright report to local machine: %v", err)
1913+
t.Logf("fail to copy playwright report to local machine: %v", err)
19131914
}
19141915
}
19151916
}
19161917

19171918
func cleanupCluster(t *testing.T, tc *cluster.Output) {
1918-
if t.Failed() {
1919-
generateAndCopySupportBundle(t, tc)
1920-
copyPlaywrightReport(t, tc)
1921-
}
1919+
generateAndCopySupportBundle(t, tc)
1920+
copyPlaywrightReport(t, tc)
19221921
}

0 commit comments

Comments
 (0)