diff --git a/.github/workflows/collection.yml b/.github/workflows/collection.yml index d33cd1be..da7561bc 100644 --- a/.github/workflows/collection.yml +++ b/.github/workflows/collection.yml @@ -76,26 +76,101 @@ jobs: testing-type: sanity target-python-version: 3.11 - # TO-DO - # - name: Upload gateway jUnit test reports to the unified dashboard - # if: >- - # !cancelled() - # && steps.make-run.outputs.test-result-files != '' - # && github.event_name == 'push' - # && env.UPSTREAM_REPOSITORY_ID == github.repository_id - # && github.ref_name == github.event.repository.default_branch - # run: | - # for junit_file in $(echo '${{ steps.make-run.outputs.test-result-files }}' | sed 's/,/ /') - # do - # curl \ - # -v \ - # --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}" \ - # --form "xunit_xml=@${junit_file}" \ - # --form "component_name=gateway" \ - # --form "git_commit_sha=${{ github.sha }}" \ - # --form "git_repository_url=https://github.com/${{ github.repository }}" \ - # "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/" - # done + - name: Upload gateway jUnit test reports to the unified dashboard + if: >- + !cancelled() + && steps.make-run.outputs.test-result-files != '' + && github.event_name == 'push' + && env.UPSTREAM_REPOSITORY_ID == github.repository_id + && github.ref_name == github.event.repository.default_branch + run: | + for junit_file in $(echo '${{ steps.make-run.outputs.test-result-files }}' | sed 's/,/ /') + do + curl \ + -v \ + --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}" \ + --form "xunit_xml=@${junit_file}" \ + --form "component_name=gateway" \ + --form "git_commit_sha=${{ github.sha }}" \ + --form "git_repository_url=https://github.com/${{ github.repository }}" \ + "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/" + done + + coverage_test: + name: collection integration check + runs-on: ubuntu-latest + env: + HEADLESS: "yes" + steps: + - uses: actions/checkout@v3 + with: + repository: NilashishC/aap-gateway + token: ${{ secrets.AAP_GATEWAY_REPO_TOKEN }} + + - name: Checkout DAB branch if needed + env: + PR_BODY: ${{ github.event.pull_request.body }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: tools/scripts/get_dab_for_pr.py + + - name: Start the dev environment + run: COMPOSE_UP_OPTS='-d' make docker-compose + + - name: Install make + run: sudo apt install make + + - name: Install python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install requirements + run: pip3.11 install -r requirements/requirements_dev.txt ansible-core + + - uses: actions/checkout@v3 + with: + path: ansible-platform + + - name: Perform completeness tests + run: cd ansible-platform && make collection-test-integration-check + + completeness_test: + name: collection completeness test + runs-on: ubuntu-latest + env: + HEADLESS: "yes" + steps: + - uses: actions/checkout@v3 + with: + repository: NilashishC/aap-gateway + token: ${{ secrets.AAP_GATEWAY_REPO_TOKEN }} + + - name: Checkout DAB branch if needed + env: + PR_BODY: ${{ github.event.pull_request.body }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: tools/scripts/get_dab_for_pr.py + + - name: Start the dev environment + run: COMPOSE_UP_OPTS='-d' make docker-compose + + - name: Install make + run: sudo apt install make + + - name: Install python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install requirements + run: pip3.11 install -r requirements/requirements_dev.txt ansible-core + + - uses: actions/checkout@v3 + with: + path: ansible-platform + + - name: Perform completeness tests + run: cd ansible-platform && make collection-test-completeness docs: name: Check module doc strings diff --git a/Makefile b/Makefile index 8d36e609..ea6f767d 100644 --- a/Makefile +++ b/Makefile @@ -75,3 +75,11 @@ collection-test: collection-install cat /tmp/collections/ansible_collections/ansible/platform/tests/integration/integration_config.yml && \ cd /tmp/collections/ansible_collections/ansible/platform && \ ansible-test integration --venv --requirements --coverage + +## Run the collections test-integration check to see if all modules have integration tests +collection-test-integration-check: + ./tests/test_integration_check.py + +## Run the collections test-completness check +collection-test-completeness: + ./tests/test_completeness.py