Skip to content

Commit 81d6950

Browse files
authored
ci: fix TestRail results upload (#741)
Use the `trcli` directly instead of the deprecated GitHub action and fix test case matching to avoid creating new test cases on each run.
1 parent 0d91b4a commit 81d6950

2 files changed

Lines changed: 20 additions & 13 deletions

File tree

.github/workflows/acceptance-sim.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
required: false
1212
testrail-project:
1313
required: false
14-
testrail-user:
14+
testrail-username:
1515
required: false
1616
testrail-api-key:
1717
required: false
@@ -128,17 +128,24 @@ jobs:
128128
- name: upload test results to TestRail
129129
if: always()
130130
continue-on-error: true
131-
uses: oxidecomputer/trcli-action@1ac634c97714109c05cbfbe4d92b9fc7349626c3
132-
with:
133-
host: ${{ secrets.testrail-host }}
134-
username: ${{ secrets.testrail-user }}
135-
password: ${{ secrets.testrail-api-key }}
136-
project: ${{ secrets.testrail-project }}
137-
report_file_path: ./acctest/acc-tests.xml
138-
auto_create_cases_yes: true
139-
case_matcher: name
140-
title: 'Acceptance Tests (${{ matrix.tf-binary }})'
141-
run_description: 'GitHub workflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
131+
env:
132+
TESTRAIL_HOST: ${{ secrets.testrail-host }}
133+
TESTRAIL_USERNAME: ${{ secrets.testrail-username }}
134+
TESTRAIL_API_KEY: ${{ secrets.testrail-api-key }}
135+
TESTRAIL_PROJECT: ${{ secrets.testrail-project }}
136+
run: |
137+
uvx trcli \
138+
--host "${TESTRAIL_HOST}" \
139+
--username "${TESTRAIL_USERNAME}" \
140+
--key "${TESTRAIL_API_KEY}" \
141+
--project "${TESTRAIL_PROJECT}" \
142+
--yes `# Auto-create new test cases.` \
143+
parse_junit \
144+
--file './acctest/acc-tests.xml' \
145+
--title '${{ matrix.tf-binary }} - ${{ github.run_id }} - ${{ job.check_run_id }}' \
146+
--run-description 'GitHub workflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ github.check_run_id }}' \
147+
--update-existing-cases 'yes' \
148+
--case-matcher 'auto'
142149
- name: upload logs
143150
if: always()
144151
continue-on-error: true

.github/workflows/build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ jobs:
116116
omicron-sha: ${{ needs.omicron-version.outputs.sha }}
117117
secrets:
118118
testrail-host: ${{ secrets.TESTRAIL_HOST }}
119-
testrail-user: ${{ secrets.TESTRAIL_USER }}
119+
testrail-username: ${{ secrets.TESTRAIL_USERNAME }}
120120
testrail-api-key: ${{ secrets.TESTRAIL_API_KEY }}
121121
testrail-project: ${{ secrets.TESTRAIL_PROJECT }}

0 commit comments

Comments
 (0)