Skip to content

Commit e4ffa17

Browse files
authored
CI: replace test execution handler with conditional (#405)
* replace execution handler with conditional * adding if statement
1 parent 098d050 commit e4ffa17

2 files changed

Lines changed: 7 additions & 20 deletions

File tree

.github/workflows/e2e-test.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,35 +36,21 @@ jobs:
3636
run: |
3737
timestamp=$(date +'%Y%m%d%H%M')
3838
report_filename="${timestamp}_sdk_test_report.xml"
39-
status=0
40-
if ! python3 -m pytest test/integration/${INTEGRATION_TEST_PATH} --disable-warnings --junitxml="${report_filename}"; then
41-
echo "EXIT_STATUS=1" >> $GITHUB_ENV
42-
fi
39+
make testint TEST_ARGS="--junitxml=${report_filename}"
4340
env:
4441
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
4542

46-
- name: Add additional information to XML report
43+
- name: Upload test results
44+
if: always()
4745
run: |
4846
filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$')
4947
python tod_scripts/add_to_xml_test_report.py \
5048
--branch_name "${GITHUB_REF#refs/*/}" \
5149
--gha_run_id "$GITHUB_RUN_ID" \
5250
--gha_run_number "$GITHUB_RUN_NUMBER" \
5351
--xmlfile "${filename}"
54-
55-
- name: Upload test results
56-
run: |
57-
report_filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$')
58-
python3 tod_scripts/test_report_upload_script.py "${report_filename}"
52+
sync
53+
python3 tod_scripts/test_report_upload_script.py "${filename}"
5954
env:
6055
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
6156
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
62-
63-
- name: Test Execution Status Handler
64-
run: |
65-
if [[ "$EXIT_STATUS" != 0 ]]; then
66-
echo "Test execution contains failure(s)"
67-
exit $EXIT_STATUS
68-
else
69-
echo "Tests passed!"
70-
fi

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ PYTHON ?= python3
22

33
TEST_CASE_COMMAND :=
44
TEST_SUITE :=
5+
TEST_ARGS :=
56

67
LINODE_SDK_VERSION ?= "0.0.0.dev"
78
VERSION_MODULE_DOCSTRING ?= \"\"\"\nThe version of this linode_api4 package.\n\"\"\"\n\n
@@ -70,7 +71,7 @@ lint: build
7071

7172
.PHONY: testint
7273
testint:
73-
$(PYTHON) -m pytest test/integration/${TEST_COMMAND} ${TEST_CASE_COMMAND}
74+
$(PYTHON) -m pytest test/integration/${TEST_COMMAND} ${TEST_CASE_COMMAND} ${TEST_ARGS}
7475

7576
.PHONY: testunit
7677
testunit:

0 commit comments

Comments
 (0)