Skip to content

Commit

Permalink
Merge branch 'main' into progressive-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
osagie98 authored Dec 18, 2024
2 parents dc3f57d + 1f79302 commit dc4f6de
Show file tree
Hide file tree
Showing 92 changed files with 8,250 additions and 630 deletions.
18 changes: 1 addition & 17 deletions .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ inputs:
targets:
description: "List of ninja targets for Cobalt build."
required: true
test_artifacts_key:
description: "Artifact key used to store test artifacts."
required: true
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -60,17 +57,4 @@ runs:
path: |
src/out/${{ matrix.platform }}_qa/apks/*.apk
src/out/${{ matrix.platform }}_qa/*_apk/*.apk
- name: Create Test Files Archive
if: startsWith(matrix.platform, 'linux') && matrix.config == 'devel'
run: |
set -x
cd src
tar cvf - out/${{ matrix.platform }}_${{ matrix.config }}/*tests out/${{ matrix.platform }}_${{ matrix.config }}/*.so out/${{ matrix.platform }}_${{ matrix.config }}/*.so.* out/${{ matrix.platform }}_${{ matrix.config }}/starboard/*.so.* | xz -T0 -1 -z - > test_artifacts.tar.xz
shell: bash
- name: Upload Test artifacts
if: startsWith(matrix.platform, 'linux') && matrix.config == 'devel'
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.test_artifacts_key }}
path: src/test_artifacts.tar.xz
retention-days: 3
src/out/${{ matrix.platform }}_qa/gen/build_info.json
50 changes: 32 additions & 18 deletions .github/actions/on_host_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ inputs:
test_artifacts_key:
description: "Artifact key used to store test artifacts."
required: true
results_dir:
description: "Path to directory where test results are saved."
required: true
platform:
description: "Platform on which to run tests."
test_results_key:
description: "Artifact key used to store test results."
required: true
runs:
using: "composite"
Expand All @@ -21,34 +18,51 @@ runs:
shell: bash
run: |
set -x
mkdir -p ${GITHUB_WORKSPACE}/unit_test
cd ${GITHUB_WORKSPACE}/unit_test
tar xvf ${GITHUB_WORKSPACE}/test_artifacts.tar.xz
test_dir="${GITHUB_WORKSPACE}/unit_test"
echo "test_dir=${test_dir}" >> $GITHUB_ENV
mkdir -p ${test_dir}
cd ${test_dir}
tar xvf ../test_artifacts.tar.xz
- name: Run Tests
id: run-tests
shell: bash
env:
RESULTS_DIR: ${{ inputs.results_dir }}
XVFB_SERVER_ARGS: "-screen 0 1920x1080x24i +render +extension GLX -noreset"
run: |
set -x
env
# Update path to find missing library linkages.
export LD_LIBRARY_PATH="${GITHUB_WORKSPACE}"/unit_test/out/${{ matrix.platform }}_${{ matrix.config }}/starboard:"${GITHUB_WORKSPACE}"/unit_test/out/${{ matrix.platform }}_${{ matrix.config }}
# Explicitly point to libraries in extracted dir.
LD_LIBRARY_PATH="${test_dir}/out/${{ matrix.platform }}_${{ matrix.config }}/starboard"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${test_dir}/out/${{ matrix.platform }}_${{ matrix.config }}"
export LD_LIBRARY_PATH
cd ${GITHUB_WORKSPACE}/unit_test
for test_binary in $(ls -d out/**/*tests); do
# TODO(b/372303096): Need dedicated xvfb runner.
# Make results dir available to the archiving step below.
results_dir="${GITHUB_WORKSPACE}/results"
echo "results_dir=${results_dir}" >> $GITHUB_ENV
cd ${test_dir}
for test_binary_path in $(ls -d out/**/*tests out/**/nplb); do
test_binary=$(basename "${test_binary_path}")
echo "Running tests for suite: ${test_binary}"
test_filter="*"
if [ -f ${GITHUB_WORKSPACE}/src/cobalt/testing/${{ inputs.platform }}/${test_binary##*/}_filter.json ]; then
test_filter=`jq -r '"-" + (.failing_tests | join(":"))' ${GITHUB_WORKSPACE}/src/cobalt/testing/${{ inputs.platform }}/${test_binary##*/}_filter.json`
test_filter_json_dir="${GITHUB_WORKSPACE}/src/cobalt/testing/filters/${{ matrix.platform }}/${test_binary}_filter.json"
if [ -f ${test_filter_json_dir} ]; then
test_filter=`jq -r '"-" + (.failing_tests | join(":"))' ${test_filter_json_dir}`
fi
echo "Test filter evaluated to: $test_filter"
echo "Test filter evaluated to: ${test_filter}"
/usr/bin/xvfb-run -a --server-args="${XVFB_SERVER_ARGS}" ./$test_binary --gtest_filter="$test_filter" --gtest_output="xml:${RESULTS_DIR}/${test_binary}_testoutput.xml"
xml_path="${results_dir}/${test_binary}_testoutput.xml"
/usr/bin/xvfb-run -a --server-args="${XVFB_SERVER_ARGS}" ./$test_binary_path --gtest_filter="${test_filter}" --gtest_output="xml:${xml_path}"
done
echo "Finished running all unit tests..."
- name: Archive Test Results
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.test_results_key }}
path: ${{ env.results_dir }}/*.xml
28 changes: 17 additions & 11 deletions .github/actions/process_test_results/action.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
name: Upload Results
name: Process Test Results
description: Uploads test results to DataDog.
inputs:
results_dir:
description: "Path to directory where test results are saved."
required: true
datadog_api_key:
description: "Path to directory where test results are saved."
required: true
is_postsubmit:
description: "Indicates if this is a postsubmit run or not."
test_results_key:
description: "Artifact key used to store test results."
required: true
runs:
using: "composite"
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ inputs.test_results_key }}
path: results/

- name: Publish Test Report
continue-on-error: true
uses: mikepenz/action-junit-report@992d97d6eb2e5f3de985fbf9df6a04386874114d
with:
report_paths: "**/${{ inputs.results_dir }}/**/*.xml"
report_paths: results/*.xml
annotate_only: true

- name: Get Datadog CLI
if: inputs.is_postsubmit == 'true'
id: download-dd-cli
# The API key is not available on PRs created from a fork.
if: inputs.datadog_api_key != ''
env:
DD_VERSION: 'v2.18.0'
DD_SHA256SUM: 'adbe9b3a41faaf0b1d9702ba256cf8fa9e474c0cc8216f25e5b489c53d6f0a70 datadog-ci'
run: |
set -x
download_url="https://github.com/DataDog/datadog-ci/releases/download/${DD_VERSION}/datadog-ci_linux-x64"
curl -L --fail $download_url --output datadog-ci
curl -L --fail ${download_url} --output datadog-ci
echo ${DD_SHA256SUM} | sha256sum --check
chmod +x datadog-ci
shell: bash

- name: Upload to Datadog
if: inputs.is_postsubmit == 'true'
if: steps.download-dd-cli.outcome == 'success'
env:
DATADOG_SITE: us5.datadoghq.com
DATADOG_API_KEY: ${{ inputs.datadog_api_key }}
Expand All @@ -42,5 +48,5 @@ runs:
DD_ENV: ci
run: |
set -x
./datadog-ci junit upload --service ${DD_SERVICE} "${{ inputs.results_dir }}/**/*.xml"
./datadog-ci junit upload --service ${DD_SERVICE} results/*.xml
shell: bash
35 changes: 31 additions & 4 deletions .github/actions/upload_test_artifacts/action.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
name: Test Artifact Upload
description: Uploads test archives to GCS for on-device tests.
description: Uploads test archives for on-device and on-host tests.
inputs:
on_host:
description: "Indicates if on-host test artifacts should be uploaded."
required: true
on_device:
description: "Indicates if on-device test artifacts should be uploaded."
required: true
test_artifacts_key:
description: "Artifact key used to store on-host test artifacts."
required: true
runs:
using: "composite"
steps:
- name: Set up Cloud SDK
if: inputs.on_device == 'true'
uses: isarkis/setup-gcloud@40dce7857b354839efac498d3632050f568090b6 # v1.1.1
- name: Upload Artifacts to GCS
- name: Upload Android Test Artifacts to GCS
if: inputs.on_device == 'true'
env:
WORKFLOW: ${{ github.workflow }}
run: |
set -eux
project_name=$(gcloud config get-value project)
gsutil cp "${GITHUB_WORKSPACE}"/src/out/${{ matrix.platform }}_${{ matrix.config }}/**/*.apk \
gs://"${project_name}"-test-artifacts/"${WORKFLOW}"/"${GITHUB_RUN_NUMBER}"/${{matrix.platform}}/
gsutil cp "${GITHUB_WORKSPACE}/src/out/${{ matrix.platform }}_${{ matrix.config }}/**/*.apk" \
"gs://${project_name}-test-artifacts/${WORKFLOW}/${GITHUB_RUN_NUMBER}/${{matrix.platform}}/"
shell: bash

- name: Create On-Host Test Artifacts Archive
if: inputs.on_host == 'true'
run: |
set -x
cd src
tar cvf - out/${{ matrix.platform }}_${{ matrix.config }}/*tests out/${{ matrix.platform }}_${{ matrix.config }}/nplb out/${{ matrix.platform }}_${{ matrix.config }}/*.so out/${{ matrix.platform }}_${{ matrix.config }}/*.so.* out/${{ matrix.platform }}_${{ matrix.config }}/starboard/*.so.* out/${{ matrix.platform }}_${{ matrix.config }}/content/test | xz -T0 -1 -z - > test_artifacts.tar.xz
shell: bash
- name: Upload On-Host Test Artifacts Archive
if: inputs.on_host == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.test_artifacts_key }}
path: src/test_artifacts.tar.xz
retention-days: 3
15 changes: 15 additions & 0 deletions .github/config/linux-evergreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"docker_service": "linux",
"platforms": [
"linux-x64x11-evergreen"
],
"targets": [
"base_unittests"
],
"includes": [
{
"name": "x64",
"platform": "linux-x64x11-evergreen"
}
]
}
16 changes: 8 additions & 8 deletions .github/config/linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"linux-x64x11"
],
"targets": [
"base_unittests",
"sql_unittests",
"url_unittests",
"ipc_tests",
"mojo_unittests",
"gpu_unittests",
"base_unittests",
"cobalt:gn_all",
"content_shell",
"gin_unittests",
"gpu_unittests",
"ipc_tests",
"media_unittests",
"content_shell",
"cobalt:gn_all"
"mojo_unittests",
"sql_unittests",
"url_unittests"
],
"includes": [
{
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
with:
platform: chromium_android-arm64
nightly: ${{ github.event.inputs.nightly }}
secrets:
datadog_api_key: ${{ secrets.DD_API_KEY }}
chromium_android-arm:
uses: ./.github/workflows/main.yaml
permissions:
Expand All @@ -37,6 +39,8 @@ jobs:
with:
platform: chromium_android-arm
nightly: ${{ github.event.inputs.nightly }}
secrets:
datadog_api_key: ${{ secrets.DD_API_KEY }}
chromium_android-x86:
uses: ./.github/workflows/main.yaml
permissions:
Expand All @@ -45,6 +49,8 @@ jobs:
with:
platform: chromium_android-x86
nightly: ${{ github.event.inputs.nightly }}
secrets:
datadog_api_key: ${{ secrets.DD_API_KEY }}
# Cobalt specific build configs
android-arm64:
uses: ./.github/workflows/main.yaml
Expand All @@ -54,6 +60,8 @@ jobs:
with:
platform: android-arm64
nightly: ${{ github.event.inputs.nightly }}
secrets:
datadog_api_key: ${{ secrets.DD_API_KEY }}
android-arm:
uses: ./.github/workflows/main.yaml
permissions:
Expand All @@ -62,6 +70,8 @@ jobs:
with:
platform: android-arm
nightly: ${{ github.event.inputs.nightly }}
secrets:
datadog_api_key: ${{ secrets.DD_API_KEY }}
android-x86:
uses: ./.github/workflows/main.yaml
permissions:
Expand All @@ -70,3 +80,5 @@ jobs:
with:
platform: android-x86
nightly: ${{ github.event.inputs.nightly }}
secrets:
datadog_api_key: ${{ secrets.DD_API_KEY }}
15 changes: 15 additions & 0 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
with:
platform: chromium_linux
nightly: ${{ github.event.inputs.nightly }}
secrets:
datadog_api_key: ${{ secrets.DD_API_KEY }}
# This is default Cobalt build config
linux:
uses: ./.github/workflows/main.yaml
Expand All @@ -39,3 +41,16 @@ jobs:
with:
platform: linux
nightly: ${{ github.event.inputs.nightly }}
secrets:
datadog_api_key: ${{ secrets.DD_API_KEY }}
# This is cobalt on linux using evergreen build config
linux-evergreen:
uses: ./.github/workflows/main.yaml
permissions:
packages: write
pull-requests: write
with:
platform: linux-evergreen
nightly: ${{ github.event.inputs.nightly }}
secrets:
datadog_api_key: ${{ secrets.DD_API_KEY }}
Loading

0 comments on commit dc4f6de

Please sign in to comment.