Skip to content

Commit f788344

Browse files
authored
CI: replace test execution handler with conditional (#612)
1 parent ffb8d15 commit f788344

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

.github/workflows/e2e-suite.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,34 +44,21 @@ jobs:
4444
run: |
4545
timestamp=$(date +'%Y%m%d%H%M')
4646
report_filename="${timestamp}_cli_test_report.xml"
47-
if ! pytest tests/integration --disable-warnings --junitxml="${report_filename}"; then
48-
echo "EXIT_STATUS=1" >> $GITHUB_ENV
49-
fi
47+
make testint TEST_ARGS="--junitxml=${report_filename}"
5048
env:
5149
LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN }}
5250

53-
- name: Add additional information to XML report
51+
- name: Upload test results
52+
if: always()
5453
run: |
55-
filename=$(ls | grep -E '^[0-9]{12}_cli_test_report\.xml$')
54+
filename=$(ls | grep -E '^[0-9]{12}_cli_test_report\.xml$')
5655
python tod_scripts/add_to_xml_test_report.py \
5756
--branch_name "${GITHUB_REF#refs/*/}" \
5857
--gha_run_id "$GITHUB_RUN_ID" \
5958
--gha_run_number "$GITHUB_RUN_NUMBER" \
6059
--xmlfile "${filename}"
61-
62-
- name: Upload test results
63-
run: |
64-
filename=$(ls | grep -E '^[0-9]{12}_cli_test_report\.xml$')
60+
sync
6561
python tod_scripts/test_report_upload_script.py "${filename}"
6662
env:
6763
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
68-
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
69-
70-
- name: Test Execution Status Handler
71-
run: |
72-
if [[ "$EXIT_STATUS" != 0 ]]; then
73-
echo "Test execution contains failure(s)"
74-
exit $EXIT_STATUS
75-
else
76-
echo "Tests passed!"
77-
fi
64+
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
MODULE :=
55
TEST_CASE_COMMAND :=
6+
TEST_ARGS :=
67

78
ifdef TEST_CASE
89
TEST_CASE_COMMAND = -k $(TEST_CASE)
@@ -71,7 +72,7 @@ testunit:
7172

7273
.PHONY: testint
7374
testint:
74-
pytest tests/integration/${MODULE} ${TEST_CASE_COMMAND}
75+
pytest tests/integration/${MODULE} ${TEST_CASE_COMMAND} ${TEST_ARGS}
7576

7677
.PHONY: testall
7778
testall:

0 commit comments

Comments
 (0)