Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/actions/junit2jira/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ branding:
icon: 'archive'
color: 'blue'
inputs:
create-jiras:
description: 'Whether to report failures to Jira'
required: false
default: 'true'
gcp-account:
description: 'Account to be used to upload tests data'
required: true
jira-token:
description: 'Token used to authenticate with Jira.'
required: true
Expand Down Expand Up @@ -32,14 +39,28 @@ runs:
- name: Check files
shell: bash
env:
GCP_SERVICE_ACCOUNT_STACKROX_CI: ${{ inputs.gcp-account }}
JIRA_TOKEN: ${{ inputs.jira-token }}
run: |
extra_args=()
if [[ "${{ inputs.create-jiras }}" == "false" ]]; then
extra_args=(--dry-run)
else
echo "Will create JIRA issues for JUnit failures found in ${{ inputs.directory }}"
fi
csv_output="$(mktemp --suffix=.csv)"
./junit2jira \
-base-link "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}" \
-build-id "${{ github.run_id }}" \
-build-link "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
-build-tag "${{ github.ref_name }}@${{ github.sha }}" \
-csv-output "${csv_output}" \
-job-name "${{ github.job }}" \
-junit-reports-dir "${{ inputs.directory }}" \
-orchestrator "${{ runner.name }} ${{ runner.os }}-${{ runner.arch }}" \
-threshold "${{ inputs.threshold }}"
-threshold "${{ inputs.threshold }}" \
"${extra_args[@]}"

source scripts/ci/lib.sh
setup_gcp
save_test_metrics "${csv_output}"
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ jobs:
if: always()
with:
jira-token: ${{ secrets.JIRA_TOKEN }}
gcp-account: ${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
directory: 'junit-reports'

scan-images-with-roxctl:
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ jobs:
paths: 'junit-reports/report.xml'

- name: Report test failures to Jira
if: (!cancelled()) && github.event_name == 'push'
if: (!cancelled())
uses: ./.github/actions/junit2jira
with:
create-jiras: ${{ github.event_name == 'push' }}
jira-token: ${{ secrets.JIRA_TOKEN }}
gcp-account: ${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
directory: 'junit-reports'

go-postgres:
Expand Down Expand Up @@ -116,10 +118,12 @@ jobs:
paths: 'junit-reports/report.xml'

- name: Report junit failures in jira
if: (!cancelled()) && github.event_name == 'push'
if: (!cancelled())
uses: ./.github/actions/junit2jira
with:
create-jiras: ${{ github.event_name == 'push' }}
jira-token: ${{ secrets.JIRA_TOKEN }}
gcp-account: ${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
directory: 'junit-reports'

go-bench:
Expand Down Expand Up @@ -192,10 +196,12 @@ jobs:
paths: 'ui/apps/platform/test-results/reports/*.xml'

- name: Report junit failures in jira
if: (!cancelled()) && github.event_name == 'push'
if: (!cancelled())
uses: ./.github/actions/junit2jira
with:
create-jiras: ${{ github.event_name == 'push' }}
jira-token: ${{ secrets.JIRA_TOKEN }}
gcp-account: ${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
directory: 'ui/apps/platform/test-results/reports'

local-roxctl-tests:
Expand Down Expand Up @@ -226,10 +232,12 @@ jobs:
paths: 'roxctl-test-output/*.xml'

- name: Report junit failures in jira
if: (!cancelled()) && github.event_name == 'push'
if: (!cancelled())
uses: ./.github/actions/junit2jira
with:
create-jiras: ${{ github.event_name == 'push' }}
jira-token: ${{ secrets.JIRA_TOKEN }}
gcp-account: ${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
directory: 'roxctl-test-output'

shell-unit-tests:
Expand All @@ -255,10 +263,12 @@ jobs:
paths: 'shell-test-output/*.xml'

- name: Report junit failures in jira
if: (!cancelled()) && github.event_name == 'push'
if: (!cancelled())
uses: ./.github/actions/junit2jira
with:
create-jiras: ${{ github.event_name == 'push' }}
jira-token: ${{ secrets.JIRA_TOKEN }}
gcp-account: ${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
directory: 'shell-test-output'

openshift-ci-unit-tests:
Expand Down