54
54
name : testplane-fixtures
55
55
path : test/func/fixtures/*/report
56
56
57
- - name : ' e2e: Run Testplane testplane-common'
58
- continue-on-error : true
59
- id : ' testplane-testplane-common'
60
- uses :
gemini-testing/[email protected]
61
- env :
62
- TOOL : testplane
63
- PROJECT_UNDER_TEST : testplane
64
- SERVER_PORT : 8061
65
- html_reporter_path : html-reporter-reports/testplane-common
66
- with :
67
- cwd : ' test/func/tests'
68
- set : ' common'
69
-
70
57
- name : ' e2e: Run Testplane testplane-eye'
71
58
continue-on-error : true
72
59
id : ' testplane-testplane-eye'
80
67
cwd : ' test/func/tests'
81
68
set : ' eye'
82
69
83
- - name : ' e2e: Run Testplane testplane-gui'
84
- continue-on-error : true
85
- id : ' testplane-testplane-gui'
86
- uses :
gemini-testing/[email protected]
87
- env :
88
- TOOL : testplane
89
- PROJECT_UNDER_TEST : testplane-gui
90
- SERVER_PORT : 8063
91
- html_reporter_path : html-reporter-reports/testplane-gui
92
- with :
93
- cwd : ' test/func/tests'
94
- set : ' common-gui'
95
-
96
- - name : ' e2e: Run Testplane playwright'
97
- continue-on-error : true
98
- id : ' testplane-playwright'
99
- uses :
gemini-testing/[email protected]
100
- env :
101
- TOOL : playwright
102
- PROJECT_UNDER_TEST : playwright
103
- SERVER_PORT : 8065
104
- html_reporter_path : html-reporter-reports/playwright
105
- with :
106
- cwd : ' test/func/tests'
107
- set : ' common'
108
-
109
- - name : ' e2e: Run Testplane plugins'
110
- continue-on-error : true
111
- id : ' testplane-plugins'
112
- uses :
gemini-testing/[email protected]
113
- env :
114
- TOOL : testplane
115
- PROJECT_UNDER_TEST : plugins
116
- SERVER_PORT : 8064
117
- html_reporter_path : html-reporter-reports/plugins
118
- with :
119
- cwd : ' test/func/tests'
120
- set : ' plugins'
121
-
122
- - name : ' e2e: Run Testplane testplane-tinder'
123
- continue-on-error : true
124
- id : ' testplane-testplane-tinder'
125
- uses :
gemini-testing/[email protected]
126
- env :
127
- TOOL : testplane
128
- PROJECT_UNDER_TEST : testplane-gui
129
- SERVER_PORT : 8084
130
- html_reporter_path : html-reporter-reports/testplane-tinder
131
- with :
132
- cwd : ' test/func/tests'
133
- set : ' common-tinder'
134
-
135
- - name : ' e2e: Run Testplane analytics'
136
- continue-on-error : true
137
- id : ' testplane-analytics'
138
- uses :
gemini-testing/[email protected]
139
- env :
140
- TOOL : testplane
141
- PROJECT_UNDER_TEST : analytics
142
- SERVER_PORT : 8085
143
- html_reporter_path : html-reporter-reports/analytics
144
- with :
145
- cwd : ' test/func/tests'
146
- set : ' analytics'
147
-
148
70
- name : Check for failures
149
- run : |
150
- if [ "${{ steps.testplane-analytics.outcome }}" == "failure" ] || \
151
- [ "${{ steps.testplane-playwright.outcome }}" == "failure" ] || \
152
- [ "${{ steps.testplane-plugins.outcome }}" == "failure" ] || \
153
- [ "${{ steps.testplane-testplane-common.outcome }}" == "failure" ] || \
154
- [ "${{ steps.testplane-testplane-eye.outcome }}" == "failure" ] || \
155
- [ "${{ steps.testplane-testplane-tinder.outcome }}" == "failure" ] || \
156
- [ "${{ steps.testplane-testplane-gui.outcome }}" == "failure" ]; then
157
- echo "IS_FAILED=true" >> $GITHUB_ENV
158
- fi
71
+ run : echo "IS_FAILED=true" >> $GITHUB_ENV
159
72
160
73
- name : Deploy Testplane html-reporter reports
161
74
if : ${{ env.IS_FAILED }}
@@ -166,40 +79,55 @@ jobs:
166
79
destination_dir : ${{ env.DEST_REPORTS_DIR }}
167
80
keep_files : true
168
81
169
- - name : Construct PR comment
82
+ - name : Construct failed PR comment
170
83
if : ${{ env.IS_FAILED }}
171
84
run : |
172
- comment="### :x: Testplane run failed\\n\\n ";
85
+ comment="### ❌ Testplane run failed<br><br> ";
173
86
readonly -a RUN_CASES=("analytics" "playwright" "plugins" "testplane-common" "testplane-eye" "testplane-tinder" "testplane-gui");
174
87
for run_case in "${RUN_CASES[@]}"; do
175
- gh_step_id_raw=testplane-${run_case};
176
- gh_step_id="${gh_step_id_raw//-/_}"
177
- outcome_var="STEPS_${gh_step_id^^}_OUTCOME"
178
- outcome="${!outcome_var:-UNDEFINED}
179
88
report_link="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ env.DEST_REPORTS_DIR }}/${run_case}"
180
-
181
- case "$outcome" in
182
- "success")
183
- comment+="- ✅ $run_case: success. <a href=\"${report_link}\" target=\"_blank\">Report link</a>"
184
- ;;
185
- "failure"|"cancelled")
186
- comment+="- ❌ $run_case: failed. <a href=\"${report_link}\" target=\"_blank\">Report link</a>"
187
- ;;
188
- *)
189
- comment+="- ⚠️ $run_case: unknown. <a href=\"${report_link}\" target=\"_blank\">Report link</a>"
190
- ;;
191
- esac
89
+ gh_step_id_raw="testplane-${run_case}"
90
+ gh_step_id="${gh_step_id_raw//-/_}"
91
+ gh_step_id_upper=$(echo "$gh_step_id" | tr '[:lower:]' '[:upper:]')
92
+ outcome_var="STEPS_${gh_step_id_upper}_OUTCOME"
93
+
94
+ if [[ -z "${!outcome_var}" ]]; then
95
+ outcome="UNDEFINED"
96
+ echo "Outcome for $gh_step_id_upper is undefined"
97
+ else
98
+ outcome="${!outcome_var}"
99
+ echo "Outcome for $gh_step_id_upper is $outcome"
100
+ fi
101
+
102
+ case "$outcome" in
103
+ "success")
104
+ comment+="- ✅ $run_case: success. <a href=\"${report_link}\" target=\"_blank\">Report link</a><br><br>"
105
+ ;;
106
+ "failure"|"cancelled")
107
+ comment+="- ❌ $run_case: failed. <a href=\"${report_link}\" target=\"_blank\">Report link</a><br><br>"
108
+ ;;
109
+ *)
110
+ comment+="- ⚠️ $run_case: unknown. <a href=\"${report_link}\" target=\"_blank\">Report link</a><br><br>"
111
+ ;;
112
+ esac
192
113
done
193
- echo "PR_COMMENT =${comment}" >> $GITHUB_ENV
114
+ echo "FAILED_PR_COMMENT =${comment}" >> $GITHUB_ENV
194
115
116
+ - name : Leave failed comment to PR with link to Testplane HTML reports
117
+ if : env.IS_FAILED
118
+ id : leave-failed-comment-step
119
+ uses : thollander/actions-comment-pull-request@v3
120
+ with :
121
+ message : ${{ env.FAILED_PR_COMMENT }}
122
+ comment-tag : testplane_results
195
123
196
- - name : Comment PR with link to Testplane HTML report
197
- if : ${{ env.IS_FAILED }}
124
+ - name : Leave success comment to PR
125
+ if : steps.leave-failed-comment-step.outcome == 'skipped'
198
126
uses : thollander/actions-comment-pull-request@v3
199
127
with :
200
- message : ${{ env.PR_COMMENT }}
201
- comment-tag : testplane_html_report_link
128
+ message : ' ### ✅ Testplane run failed '
129
+ comment-tag : testplane_results
202
130
203
131
- name : Fail the job if any Testplane job is failed
204
- if : env.IS_FAILED == 'true'
132
+ if : env.IS_FAILED
205
133
run : exit 1
0 commit comments