forked from opensearch-project/security
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collect all coverage data at once (opensearch-project#3537)
Collect all coverage data at once - should reduce throttling by GitHub APIs when coverage data is proceeded. Will only report code coverage once all the other tests have finished running ensuring accurate reporting. Also speed up normal test flows by changing how artifacts are uploaded, the `actions/upload-artifacts` action was taking 2-3 mins to copy files, now its down to a couple of seconds. Signed-off-by: Peter Nied <[email protected]> Signed-off-by: Peter Nied <[email protected]>
- Loading branch information
Showing
4 changed files
with
64 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,27 +60,50 @@ jobs: | |
arguments: | | ||
${{ matrix.gradle_task }} -Dbuild.snapshot=false | ||
- name: Coverage | ||
uses: Wandalen/[email protected] | ||
with: | ||
attempt_limit: 3 | ||
attempt_delay: 2000 | ||
action: codecov/codecov-action@v3 | ||
with: | | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: false | ||
files: ./build/reports/jacoco/test/jacocoTestReport.xml | ||
- uses: actions/upload-artifact@v3 | ||
- uses: alehechka/upload-tartifact@v2 | ||
if: always() | ||
with: | ||
name: ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports | ||
name: ${{ matrix.platform }}-JDK${{ matrix.jdk }}-${{ matrix.gradle_task }}-reports | ||
path: | | ||
./build/reports/ | ||
- name: check archive for debugging | ||
if: always() | ||
run: echo "Check the artifact ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports for detailed test results" | ||
report-coverage: | ||
needs: | ||
- "test" | ||
- "integration-tests" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
path: downloaded-artifacts | ||
|
||
- name: Display structure of downloaded files | ||
run: ls -R | ||
working-directory: downloaded-artifacts | ||
|
||
- name: Extract downloaded artifacts | ||
run: | | ||
for archive in ./*/artifact.tar; do | ||
(cd "$(dirname "$archive")" && tar -xvf artifact.tar) | ||
done | ||
working-directory: downloaded-artifacts | ||
|
||
- name: Display structure of downloaded files | ||
run: ls -R | ||
working-directory: downloaded-artifacts | ||
|
||
- name: Upload Coverage with retry | ||
uses: Wandalen/[email protected] | ||
with: | ||
attempt_limit: 5 | ||
attempt_delay: 2000 | ||
action: codecov/codecov-action@v3 | ||
with: | | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true | ||
directory: downloaded-artifacts | ||
verbose: true | ||
integration-tests: | ||
name: integration-tests | ||
|
@@ -108,6 +131,14 @@ jobs: | |
arguments: | | ||
integrationTest -Dbuild.snapshot=false | ||
- uses: alehechka/upload-tartifact@v2 | ||
if: always() | ||
with: | ||
name: integration-${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports | ||
path: | | ||
./build/reports/ | ||
resource-tests: | ||
env: | ||
CI_ENVIRONMENT: resource-test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters