-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
60 additions
and
50 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 |
---|---|---|
|
@@ -193,6 +193,54 @@ jobs: | |
test_artifacts_key: ${{ env.TEST_ARTIFACTS_KEY }} | ||
on_host: ${{ needs.initialize.outputs.test_on_host }} | ||
on_device: ${{ needs.initialize.outputs.test_on_device }} | ||
|
||
# Runs on-device integration and unit tests. | ||
on-device-test: | ||
needs: [initialize, build] | ||
# Run ODT when on_device label is applied on PR. | ||
# Also, run ODT on push and schedule if not explicitly disabled via repo vars. | ||
if: needs.initialize.outputs.test_on_device == 'true' && | ||
(( | ||
github.event_name == 'pull_request' && | ||
contains(github.event.pull_request.labels.*.name, 'on_device') ) || (( | ||
inputs.nightly == 'true' || github.event_name == 'schedule') && | ||
vars.RUN_ODT_TESTS_ON_NIGHTLY != 'False') || | ||
( github.event_name == 'push' && vars.RUN_ODT_TESTS_ON_POSTSUBMIT != 'False' | ||
)) | ||
runs-on: [self-hosted, odt-runner] | ||
name: ${{ matrix.name }}_on_device | ||
permissions: {} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: ${{ fromJson(needs.initialize.outputs.platforms) }} | ||
config: [devel] | ||
include: ${{ fromJson(needs.initialize.outputs.includes) }} | ||
env: | ||
TEST_RESULTS_DIR: ${{ matrix.name }}_test_results | ||
TEST_RESULTS_KEY: ${{ matrix.platform }}_${{ matrix.name }}_test_results | ||
steps: | ||
- name: Checkout | ||
uses: kaidokert/[email protected] | ||
timeout-minutes: 30 | ||
with: | ||
fetch-depth: 1 | ||
persist-credentials: false | ||
- name: Run On-Device Tests (${{ matrix.shard }}) | ||
id: on-device-tests | ||
uses: ./.github/actions/on_device_tests | ||
with: | ||
test_artifacts_key: ${{ env.TEST_ARTIFACTS_KEY }} | ||
gcs_results_path: gs://cobalt-unittest-storage/results/${{ matrix.name }}/${{ github.run_id }} | ||
results_dir: ${{ env.TEST_RESULTS_DIR }} | ||
- name: Process Test Results | ||
if: always() | ||
uses: ./.github/actions/process_test_results | ||
with: | ||
results_dir: ${{ env.TEST_RESULTS_DIR }} | ||
datadog_api_key: ${{ secrets.DD_API_KEY }} | ||
is_postsubmit: ${{ github.event_name == 'schedule' || github.event_name == 'push' }} | ||
continue-on-error: true | ||
|
||
on-host-test: | ||
needs: [initialize, docker-build-image, build] | ||
|
@@ -229,7 +277,11 @@ jobs: | |
|
||
test-upload: | ||
needs: [initialize, docker-build-image, build, on-host-test] | ||
if: always() && needs.initialize.outputs.test_on_host == 'true' | ||
if: always() && | ||
( | ||
needs.initialize.outputs.test_on_host == 'true' || | ||
needs.initialize.outputs.test_on_device == 'true' | ||
) | ||
permissions: {} | ||
runs-on: [self-hosted, chrobalt-linux-runner] | ||
name: ${{ matrix.name }}_tests_upload | ||
|
@@ -277,49 +329,3 @@ jobs: | |
run: | | ||
echo "Failing because at least one test shard had errors." | ||
exit 1 | ||
# Runs on-device integration and unit tests. | ||
on-device-test: | ||
needs: [initialize, build] | ||
# Run ODT when on_device label is applied on PR. | ||
# Also, run ODT on push and schedule if not explicitly disabled via repo vars. | ||
if: needs.initialize.outputs.test_on_device == 'true' && | ||
(( | ||
github.event_name == 'pull_request' && | ||
contains(github.event.pull_request.labels.*.name, 'on_device') ) || (( | ||
inputs.nightly == 'true' || github.event_name == 'schedule') && | ||
vars.RUN_ODT_TESTS_ON_NIGHTLY != 'False') || | ||
( github.event_name == 'push' && vars.RUN_ODT_TESTS_ON_POSTSUBMIT != 'False' | ||
)) | ||
runs-on: [self-hosted, odt-runner] | ||
name: ${{ matrix.name }}_on_device | ||
permissions: {} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: ${{ fromJson(needs.initialize.outputs.platforms) }} | ||
config: [devel] | ||
include: ${{ fromJson(needs.initialize.outputs.includes) }} | ||
env: | ||
TEST_RESULTS_DIR: ${{ matrix.name }}_test_results | ||
steps: | ||
- name: Checkout | ||
uses: kaidokert/[email protected] | ||
timeout-minutes: 30 | ||
with: | ||
fetch-depth: 1 | ||
persist-credentials: false | ||
- name: Run On-Device Tests (${{ matrix.shard }}) | ||
id: on-device-tests | ||
uses: ./.github/actions/on_device_tests | ||
with: | ||
gcs_results_path: gs://cobalt-unittest-storage/results/${{ matrix.name }}/${{ github.run_id }} | ||
results_dir: ${{ env.TEST_RESULTS_DIR }} | ||
- name: Process Test Results | ||
if: always() | ||
uses: ./.github/actions/process_test_results | ||
with: | ||
results_dir: ${{ env.TEST_RESULTS_DIR }} | ||
datadog_api_key: ${{ secrets.DD_API_KEY }} | ||
is_postsubmit: ${{ github.event_name == 'schedule' || github.event_name == 'push' }} | ||
continue-on-error: true |