From 49d94cb08b1d2f8039ea930692a63cf3a613a6fe Mon Sep 17 00:00:00 2001 From: cybai Date: Mon, 16 Aug 2021 22:38:44 +0900 Subject: [PATCH 1/4] Run WPT sync nightly on GitHub Action --- .github/workflows/wpt-nightly.yml | 149 ++++++++++++++++++++++++++++++ etc/ci/update-wpt-checkout | 6 +- etc/ci/wpt-nightly-update.sh | 44 +++++++++ python/mach_bootstrap.py | 1 - python/servo/testing_commands.py | 16 +++- 5 files changed, 212 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/wpt-nightly.yml create mode 100755 etc/ci/wpt-nightly-update.sh diff --git a/.github/workflows/wpt-nightly.yml b/.github/workflows/wpt-nightly.yml new file mode 100644 index 00000000000..bb2b2ed7178 --- /dev/null +++ b/.github/workflows/wpt-nightly.yml @@ -0,0 +1,149 @@ +name: Synchronize WPT Nightly + +on: + pull_request: + schedule: + # Run this job at 00:00 everyday + - cron: "0 0 * * *" + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build-linux: + name: Build on Linux + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Bootstrap + run: | + python3 -m pip install --upgrade pip virtualenv + sudo apt update + python3 ./mach bootstrap + - name: Release build + run: python3 ./mach build --release + - name: Lockfile check + run: ./etc/ci/lockfile_changed.sh + - name: Forbidden panic check + run: ./etc/ci/check_no_panic.sh + - name: Package binary + run: tar -czf target.tar.gz target/release/servo resources + - name: Archive binary + uses: actions/upload-artifact@v2 + with: + name: release-binary + path: target.tar.gz + + linux-wpt: + name: Linux WPT Tests + runs-on: ubuntu-20.04 + needs: ["build-linux"] + env: + max_chunk_id: 20 + strategy: + matrix: + chunk_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + - uses: actions/download-artifact@v2 + with: + name: release-binary + path: release-binary + - name: unPackage binary + run: tar -xzf release-binary/target.tar.gz + - name: Prep test environment + run: | + python3 -m pip install --upgrade pip virtualenv + sudo apt update + sudo apt install -qy --no-install-recommends libgl1 libssl1.1 libdbus-1-3 libxcb-xfixes0-dev libxcb-shape0-dev libunwind8 libegl1-mesa + wget http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb + sudo apt install ./libffi6_3.2.1-8_amd64.deb + python3 ./mach bootstrap-gstreamer + - name: Fetch upstream changes before testing + run: | + ./etc/ci/update-wpt-checkout fetch-upstream-changes + - name: Run tests + run: | + python3 ./mach test-wpt \ + --release --processes $(nproc) --timeout-multiplier 2 \ + --total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \ + --log-raw test-wpt.${{ matrix.chunk_id }}.log \ + --log-servojson wpt-jsonsummary.${{ matrix.chunk_id }}.log \ + --always-succeed + python3 ./mach filter-intermittents wpt-jsonsummary.${{ matrix.chunk_id }}.log \ + --log-intermittents=intermittents.${{ matrix.chunk_id }}.log \ + --log-filteredsummary=filtered-wpt-summary.${{ matrix.chunk_id }}.log \ + --tracker-api=default --reporter-api=default \ + --always-succeed + - name: Archive logs + uses: actions/upload-artifact@v2 + with: + name: wpt${{ matrix.chunk_id }}-logs-linux + path: | + test-wpt.${{ matrix.chunk_id }}.log + wpt-jsonsummary.${{ matrix.chunk_id }}.log + filtered-wpt-summary.${{ matrix.chunk_id }}.log + intermittents.${{ matrix.chunk_id }}.log + + sync: + name: Synchronize WPT Nightly + runs-on: ubuntu-latest + needs: + - "build-linux" + - "linux-wpt" + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 2 + # Download all artifacts + - uses: actions/download-artifact@v2 + - name: Prep environment + run: | + python3 -m pip install --upgrade pip virtualenv + sudo apt update + python3 ./mach bootstrap + - name: Add upstream remote + run: | + git config --local user.email "josh+wptsync@joshmatthews.net" + git config --local user.name "WPT Sync Bot" + git remote add upstream https://github.com/servo/servo.git + git fetch --unshallow upstream + - name: Fetch upstream changes before syncing + run: | + ./etc/ci/update-wpt-checkout fetch-upstream-changes + - name: Run WPT Update + env: + MAX_CHUNK_ID: 20 + WPT_SYNC_TOKEN: ${{ secrets.WPT_SYNC_TOKEN }} + run: | + export CURRENT_DATE=$(date +"%d-%m-%Y") + echo $CURRENT_DATE + echo "CURRENT_DATE=$CURRENT_DATE" >> $GITHUB_ENV + ./etc/ci/wpt-nightly-update.sh + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: wpt_update_${{ env.CURRENT_DATE }} + repository: servo-wpt-sync/servo + - name: Open PR + env: + GH_TOKEN: ${{ secrets.WPT_SYNC_TOKEN }} + UPDATE_BRANCH: wpt_update_${{ env.CURRENT_DATE }} + run: | + BODY=$(cat < Date: Tue, 16 Aug 2022 00:18:37 +0900 Subject: [PATCH 2/4] Remove unnecessary always succeed flag --- python/servo/testing_commands.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index dc73b0af91e..bb25cb301cf 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -535,16 +535,13 @@ class MachCommands(CommandBase): help='The API endpoint for tracking known intermittent failures.') @CommandArgument('--reporter-api', default=None, action='store', help='The API endpoint for reporting tracked intermittent failures.') - @CommandArgument('--always-succeed', default=False, action='store_true', - help='Always yield exit code of zero') def filter_intermittents(self, summary, log_filteredsummary, log_intermittents, auth, tracker_api, - reporter_api, - always_succeed): + reporter_api): encoded_auth = None if auth: with open(auth, "r") as file: @@ -611,10 +608,7 @@ class MachCommands(CommandBase): if actual_failures: format(actual_failures, description) - if always_succeed: - return 0 - else: - return bool(actual_failures) + return bool(actual_failures) @Command('test-android-startup', description='Extremely minimal testing of Servo for Android', From 05cefceed625403a44e96adf19671e0b09eadc8b Mon Sep 17 00:00:00 2001 From: cybai Date: Tue, 16 Aug 2022 00:19:49 +0900 Subject: [PATCH 3/4] Remove command of running filter intermittents --- .github/workflows/wpt-nightly.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/wpt-nightly.yml b/.github/workflows/wpt-nightly.yml index bb2b2ed7178..4ac017da8b8 100644 --- a/.github/workflows/wpt-nightly.yml +++ b/.github/workflows/wpt-nightly.yml @@ -74,11 +74,6 @@ jobs: --log-raw test-wpt.${{ matrix.chunk_id }}.log \ --log-servojson wpt-jsonsummary.${{ matrix.chunk_id }}.log \ --always-succeed - python3 ./mach filter-intermittents wpt-jsonsummary.${{ matrix.chunk_id }}.log \ - --log-intermittents=intermittents.${{ matrix.chunk_id }}.log \ - --log-filteredsummary=filtered-wpt-summary.${{ matrix.chunk_id }}.log \ - --tracker-api=default --reporter-api=default \ - --always-succeed - name: Archive logs uses: actions/upload-artifact@v2 with: From 1b9bda0d25d98cb91dc52ccc9e1a45a32b0f79d3 Mon Sep 17 00:00:00 2001 From: cybai Date: Tue, 16 Aug 2022 00:20:07 +0900 Subject: [PATCH 4/4] Avoid running the job for PRs --- .github/workflows/wpt-nightly.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/wpt-nightly.yml b/.github/workflows/wpt-nightly.yml index 4ac017da8b8..cd38f227e72 100644 --- a/.github/workflows/wpt-nightly.yml +++ b/.github/workflows/wpt-nightly.yml @@ -1,7 +1,6 @@ name: Synchronize WPT Nightly on: - pull_request: schedule: # Run this job at 00:00 everyday - cron: "0 0 * * *"