9696 id : matrix
97979898
99- compliance-sample-scanner :
100- runs-on : ubuntu-latest
101- steps :
102- - name : Checkout
103- uses : actions/checkout@v3
104- - name : sample-scanner
105- uses : splunk/addonfactory-sample-scanner@v1
106- id : sample-scanner
107- env :
108- REVIEWDOG_GITHUB_API_TOKEN : ${{ secrets.GH_TOKEN }}
109-
11099 fossa-scan :
111100 continue-on-error : true
112101 runs-on : ubuntu-latest
@@ -410,30 +399,6 @@ jobs:
410399 name : test-results-unit-python_${{ matrix.python-version }}
411400 path : test-results/*
412401
413- run-requirements-unit-tests :
414- if : ${{ needs.test-inventory.outputs.requirement_test == 'true' }}
415- runs-on : ubuntu-latest
416- needs :
417- - build
418- - test-inventory
419- steps :
420- - uses : actions/checkout@v3
421- - name : Install Python 3
422- uses : actions/setup-python@v4
423- with :
424- python-version : 3.7
425- - name : run-tests
426- 427- with :
428- input-files : tests/requirement_test/logs
429- - name : Archive production artifacts
430- if : always()
431- uses : actions/upload-artifact@v3
432- with :
433- name : test-results
434- path : |
435- test_*.txt
436-
437402 appinspect :
438403 name : quality-appinspect-${{ matrix.tags }}
439404 needs : build
@@ -777,162 +742,6 @@ jobs:
777742 path : " ${{ needs.setup.outputs.directory-path }}/test-results/*.xml"
778743 reporter : java-junit
779744
780- run-requirement-tests :
781- if : ${{ needs.test-inventory.outputs.requirement_test == 'true' }}
782- needs :
783- - build
784- - test-inventory
785- - setup
786- - meta
787- runs-on : ubuntu-latest
788- strategy :
789- fail-fast : false
790- matrix :
791- splunk : ${{ fromJson(needs.meta.outputs.matrix_latestSplunk) }}
792- sc4s : ${{ fromJson(needs.meta.outputs.matrix_supportedSC4S) }}
793- container :
794- image : ghcr.io/splunk/workflow-engine-base:2.0.3
795- env :
796- ARGO_SERVER : ${{ needs.setup.outputs.argo-server }}
797- ARGO_HTTP1 : ${{ needs.setup.outputs.argo-http1 }}
798- ARGO_SECURE : ${{ needs.setup.outputs.argo-secure }}
799- ARGO_BASE_HREF : ${{ needs.setup.outputs.argo-href }}
800- ARGO_NAMESPACE : ${{ needs.setup.outputs.argo-namespace }}
801- TEST_TYPE : " requirement_test"
802- TEST_ARGS : " "
803- steps :
804- - uses : actions/checkout@v3
805- with :
806- submodules : recursive
807- - name : Configure AWS credentials
808- uses : aws-actions/configure-aws-credentials@v1
809- with :
810- aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
811- aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
812- aws-region : ${{ secrets.AWS_DEFAULT_REGION }}
813- - name : Read secrets from AWS Secrets Manager into environment variables
814- id : get-argo-token
815- run : |
816- ARGO_TOKEN=$(aws secretsmanager get-secret-value --secret-id ta-github-workflow-automation-token | jq -r '.SecretString')
817- echo "::set-output name=argo-token::$ARGO_TOKEN"
818- - name : create job name
819- id : create-job-name
820- shell : bash
821- run : |
822- RANDOM_STRING=$(head -3 /dev/urandom | tr -cd '[:lower:]' | cut -c -4)
823- JOB_NAME=${{ needs.setup.outputs.job-name }}-${RANDOM_STRING}
824- JOB_NAME=${JOB_NAME//TEST-TYPE/${{ env.TEST_TYPE }}}
825- JOB_NAME=${JOB_NAME//[_.]/-}
826- JOB_NAME=$(echo "$JOB_NAME" | tr '[:upper:]' '[:lower:]')
827- echo "::set-output name=job-name::$JOB_NAME"
828-
829- - name : run-tests
830- id : run-tests
831- env :
832- ARGO_TOKEN : ${{ steps.get-argo-token.outputs.argo-token }}
833- 834- with :
835- splunk : ${{ matrix.splunk.version }}
836- test-type : ${{ env.TEST_TYPE }}
837- test-args : " "
838- job-name : ${{ steps.create-job-name.outputs.job-name }}
839- labels : ${{ needs.setup.outputs.labels }}
840- workflow-tmpl-name : ${{ needs.setup.outputs.argo-workflow-tmpl-name }}
841- workflow-template-ns : ${{ needs.setup.outputs.argo-namespace }}
842- delay-destroy : " No"
843- addon-url : ${{ needs.setup.outputs.addon-upload-path }}
844- addon-name : ${{ needs.setup.outputs.addon-name }}
845- sc4s-version : ${{ matrix.sc4s.version }}
846- sc4s-docker-registry : ${{ matrix.sc4s.docker_registry }}
847- - name : Check if pod was deleted
848- id : is-pod-deleted
849- if : always()
850- shell : bash
851- env :
852- ARGO_TOKEN : ${{ steps.get-argo-token.outputs.argo-token }}
853- run : |
854- set -o xtrace
855- if argo watch ${{ steps.run-tests.outputs.workflow-name }} -n workflows | grep "pod deleted"; then
856- echo "::set-output name=retry-workflow::true"
857- fi
858- - name : Retrying workflow
859- id : retry-wf
860- shell : bash
861- env :
862- ARGO_TOKEN : ${{ steps.get-argo-token.outputs.argo-token }}
863- if : always()
864- run : |
865- set -o xtrace
866- set +e
867- if [[ "${{ steps.is-pod-deleted.outputs.retry-workflow }}" == "true" ]]
868- then
869- WORKFLOW_NAME=$(argo resubmit -v -o json -n workflows "${{ steps.run-tests.outputs.workflow-name }}" | jq -r .metadata.name)
870- echo "::set-output name=workflow-name::$$WORKFLOW_NAME"
871- argo logs --follow "${WORKFLOW_NAME}" -n workflows || echo "... there was an error fetching logs, the workflow is still in progress. please wait for the workflow to complete ..."
872- else
873- echo "No retry required"
874- argo wait "${{ steps.run-tests.outputs.workflow-name }}" -n workflows
875- argo watch "${{ steps.run-tests.outputs.workflow-name }}" -n workflows | grep "test-addon"
876- fi
877- - name : check if workflow completed
878- env :
879- ARGO_TOKEN : ${{ steps.get-argo-token.outputs.argo-token }}
880- shell : bash
881- if : always()
882- run : |
883- set +e
884- # shellcheck disable=SC2157
885- if [ -z "${{ steps.retry-wf.outputs.workflow-name }}" ]; then
886- WORKFLOW_NAME=${{ steps.run-tests.outputs.workflow-name }}
887- else
888- WORKFLOW_NAME="${{ steps.retry-wf.outputs.workflow-name }}"
889- fi
890- ARGO_STATUS=$(argo get "${WORKFLOW_NAME}" -n workflows -o json | jq -r '.status.phase')
891- echo "Status of workflow:" "$ARGO_STATUS"
892- while [ "$ARGO_STATUS" == "Running" ] || [ "$ARGO_STATUS" == "Pending" ]
893- do
894- echo "... argo Workflow ${WORKFLOW_NAME} is running, waiting for it to complete."
895- argo wait "${WORKFLOW_NAME}" -n workflows || true
896- ARGO_STATUS=$(argo get "${WORKFLOW_NAME}" -n workflows -o json | jq -r '.status.phase')
897- done
898- - name : pull artifacts from s3 bucket
899- if : always()
900- run : |
901- echo "pulling artifacts"
902- aws s3 cp s3://${{ needs.setup.outputs.s3-bucket }}/artifacts-${{ steps.create-job-name.outputs.job-name }}/${{ steps.create-job-name.outputs.job-name }}.tgz ${{ needs.setup.outputs.directory-path }}/
903- tar -xf ${{ needs.setup.outputs.directory-path }}/${{ steps.create-job-name.outputs.job-name }}.tgz -C ${{ needs.setup.outputs.directory-path }}
904- - name : pull logs from s3 bucket
905- if : always()
906- run : |
907- # shellcheck disable=SC2157
908- if [ -z "${{ steps.retry-wf.outputs.workflow-name }}" ]; then
909- WORKFLOW_NAME=${{ steps.run-tests.outputs.workflow-name }}
910- else
911- WORKFLOW_NAME="${{ steps.retry-wf.outputs.workflow-name }}"
912- fi
913- echo "pulling logs"
914- mkdir -p ${{ needs.setup.outputs.directory-path }}/argo-logs
915- aws s3 cp s3://${{ needs.setup.outputs.s3-bucket }}/${WORKFLOW_NAME}/ ${{ needs.setup.outputs.directory-path }}/argo-logs/ --recursive
916- - uses : actions/upload-artifact@v3
917- if : always()
918- with :
919- name : archive splunk ${{ matrix.splunk.version }} ${{ env.TEST_TYPE }} tests artifacts
920- path : |
921- ${{ needs.setup.outputs.directory-path }}/test-results
922- - uses : actions/upload-artifact@v3
923- if : always()
924- with :
925- name : archive splunk ${{ matrix.splunk.version }} ${{ env.TEST_TYPE }} tests logs
926- path : |
927- ${{ needs.setup.outputs.directory-path }}/argo-logs
928- - name : Test Report
929- uses : dorny/test-reporter@v1
930- if : always()
931- with :
932- name : splunk ${{ matrix.splunk.version }} ${{ env.TEST_TYPE }} test report
933- path : " ${{ needs.setup.outputs.directory-path }}/test-results/*.xml"
934- reporter : java-junit
935-
936745 run-ui-tests :
937746 if : ${{ needs.test-inventory.outputs.ui == 'true' }}
938747 needs :
@@ -1788,7 +1597,6 @@ jobs:
17881597 if : always()
17891598 needs :
17901599 - meta
1791- - compliance-sample-scanner
17921600 - compliance-copyrights
17931601 - lint
17941602 - review_secrets
@@ -1797,13 +1605,11 @@ jobs:
17971605 - security-virustotal
17981606 - test-inventory
17991607 - run-unit-tests
1800- - run-requirements-unit-tests
18011608 - appinspect
18021609 - setup
18031610 - run-knowledge-tests
18041611 - run-modinput-tests
18051612 - run-ui-tests
1806- - run-requirement-tests
18071613 - validate-pr-title
18081614 runs-on : ubuntu-latest
18091615 env :
0 commit comments