Skip to content

Commit 9c42e42

Browse files
fix: wfe tests run on splunk latest (#377)
### Description ## Allow for TA to specify Splunk Latest as the only version to run WFE tests against. It is too expensive to run all WFE tests on all supported Splunk versions on every commit in CDC add-ons on every commit / PR. Let TA to specify the condition to run WFE tests on latest only. * Full run takes 2d 20h 31m 27s https://github.com/splunk/splunk-add-on-for-amazon-web-services/actions/runs/13389640676/usage * Latest run takes 17h 29m 24s https://github.com/splunk/splunk-add-on-for-amazon-web-services/actions/runs/13478849153/usage ## Proposal Default condition - Run WFE tests on all Splunk Versions for conditions: * push to main, develop * PR to main Run only on Splunk latest when: * scheduled execution * Everything else Introduce `wfe-run-on-splunk-latest` input for TA to be precise when it needs a custom rule to run or not run on latest ## +Fix `Summary of Versions Used` should take its value from `steps.determine_splunk.outputs.matrixSplunk` ### Checklist - [ ] `README.md` has been updated or is not required - [x] push trigger tests - [ ] manual release test - [ ] automated releases test - [x] pull request trigger tests - [ ] schedule trigger tests - [ ] workflow errors/warnings reviewed and addressed ### Testing done (for each selected checkbox, the corresponding test results link should be listed here) --------- Co-authored-by: mkolasinski-splunk <105011638+mkolasinski-splunk@users.noreply.github.com>
1 parent 98e4ccc commit 9c42e42

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/reusable-build-test-release.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ on:
5252
type: string
5353
default: >-
5454
[""]
55+
wfe-run-on-splunk-latest:
56+
required: false
57+
description: "Forces WFE tests to run only on the latest Splunk when set to true. When set to false - will run on all supported Splunk versions required for the release. When not set - default behavior."
58+
type: string
59+
default: ""
5560
secrets:
5661
GH_TOKEN_ADMIN:
5762
description: Github admin token
@@ -269,15 +274,20 @@ jobs:
269274
- id: matrix
270275
uses: splunk/addonfactory-test-matrix-action@v3.0
271276
- id: determine_splunk
277+
env:
278+
wfe_run_on_splunk_latest: ${{ inputs.wfe-run-on-splunk-latest }}
272279
run: |
273-
if [ "${{ github.event_name }}" == "schedule" ]; then
280+
if [[ "$wfe_run_on_splunk_latest" == "" ]]; then
281+
wfe_run_on_splunk_latest="${{ github.event_name == 'schedule' || !((github.base_ref == 'main' || github.ref_name == 'main') || ((github.base_ref == 'develop' || github.ref_name == 'develop') && github.event_name == 'push')) }}"
282+
fi
283+
if [[ "$wfe_run_on_splunk_latest" == "true" ]]; then
274284
echo "matrixSplunk=${{ toJson(steps.matrix.outputs.latestSplunk) }}" >> "$GITHUB_OUTPUT"
275285
else
276286
echo "matrixSplunk=${{toJson(steps.matrix.outputs.supportedSplunk) }}" >> "$GITHUB_OUTPUT"
277287
fi
278288
- name: job summary
279289
run: |
280-
splunk_version_list=$(echo '${{ steps.matrix.outputs.supportedSplunk }}' | jq -r '.[].version')
290+
splunk_version_list=$(echo '${{ steps.determine_splunk.outputs.matrixSplunk }}' | jq -r '.[].version')
281291
sc4s_version_list=$(echo '${{ steps.matrix.outputs.supportedSC4S }}' | jq -r '.[].version')
282292
echo -e "## Summary of Versions Used\n- **Splunk versions used:** (${splunk_version_list})\n- **SC4S versions used:** (${sc4s_version_list})\n- Browser: Chrome" >> "$GITHUB_STEP_SUMMARY"
283293
fossa-scan:

0 commit comments

Comments
 (0)