Bug 1540048 [wpt PR 16101] - Revert "Don't use HEAD or FETCH_HEAD to checkout specific revisions.", a=testonly
authorSam Sneddon <me@gsnedders.com>
Thu, 18 Apr 2019 11:56:13 +0000
changeset 529932 7abb425884aa69edf08cf3ff86a8dea7b87141c9
parent 529931 9a245f0c9016a7e8215b61e11a22de47fe340b2b
child 529933 2fef7bad0e2ededcc4b3f9a219b25f9b5562b961
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1540048, 16101, 16066
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1540048 [wpt PR 16101] - Revert "Don't use HEAD or FETCH_HEAD to checkout specific revisions.", a=testonly Automatic update from web-platform-tests Revert "Don't use HEAD or FETCH_HEAD to checkout specific revisions. (#16066)" (#16101) This reverts commit 856a95f08c3674cf34edbd15cf51d4fbffe84a5c. -- wpt-commits: fbd91b73ea03f23fffe4717556c088ae344c9501 wpt-pr: 16101
testing/web-platform/tests/.taskcluster.yml
testing/web-platform/tests/tools/ci/run_tc.py
testing/web-platform/tests/tools/ci/start.sh
testing/web-platform/tests/tools/docker/start.sh
--- a/testing/web-platform/tests/.taskcluster.yml
+++ b/testing/web-platform/tests/.taskcluster.yml
@@ -59,45 +59,45 @@ tasks:
                 name: wpt-${browser.name}-${browser.channel}-${chunk[0]}-${chunk[1]}
                 description: >-
                   A subset of WPT's "${chunk[0]}" tests (chunk number ${chunk[1]}
                   of ${chunk[2]}), run in the ${browser.channel} release of
                   ${browser.name}.
                 owner: ${event.pusher.email}
                 source: ${event.repository.url}
               payload:
-                image: harjgam/web-platform-tests:0.32
+                image: harjgam/web-platform-tests:0.30
                 maxRunTime: 7200
                 artifacts:
                   public/results:
                     path: /home/test/artifacts
                     type: directory
                 env:
                     TASK_EVENT: "${event_str}"
                 command:
                   - /bin/bash
                   - --login
                   - -c
                   - set -ex;
                     echo "wpt-${browser.name}-${browser.channel}-${chunk[0]}-${chunk[1]}";
                     ~/start.sh
                       ${event.repository.url}
-                      ${event.ref};
+                      ${event.ref}
+                      ${event.after};
                     cd ~/web-platform-tests;
                     ./tools/ci/run_tc.py
                       --oom-killer
                       --hosts
                       --browser=${browser.name}
                       --channel=${browser.channel}
                       --xvfb
                       run-all
                       ./tools/ci/taskcluster-run.py
                         ${browser.name}
                         --
-                        --checkout=${event.after}
                         --channel=${browser.channel}
                         --log-wptreport=../artifacts/wpt_report.json
                         --log-wptscreenshot=../artifacts/wpt_screenshot.txt
                         --no-fail-on-unexpected
                         --test-type=${chunk[0]}
                         --this-chunk=${chunk[1]}
                         --total-chunks=${chunk[2]};
       - $if: tasks_for == "github-pull-request"
@@ -107,35 +107,35 @@ tasks:
           # which should not trigger re-validation.
           $if: event.action in ['opened', 'reopened', 'synchronize']
           then:
             $map: [{name: firefox, channel: nightly}, {name: chrome, channel: dev}]
             each(browser):
               $map:
                 # This is the main place to define new stability checks
                 - name: wpt-${browser.name}-${browser.channel}-stability
-                  checkout: task_head
-                  diff_base: base_head
+                  checkout: FETCH_HEAD
+                  diff_range: HEAD^
                   description: >-
                     Verify that all tests affected by a pull request are stable
                     when executed in ${browser.name}.
                   extra_args: '--verify'
                 - name: wpt-${browser.name}-${browser.channel}-results
-                  checkout: task_head
-                  diff_base: base_head
+                  checkout: FETCH_HEAD
+                  diff_range: HEAD^
                   description: >-
                     Collect results for all tests affected by a pull request in
                     ${browser.name}.
                   extra_args: >-
                     --no-fail-on-unexpected
                     --log-wptreport=../artifacts/wpt_report.json
                     --log-wptscreenshot=../artifacts/wpt_screenshot.txt
                 - name: wpt-${browser.name}-${browser.channel}-results-without-changes
-                  checkout: base_head
-                  diff_base: task_head
+                  checkout: FETCH_HEAD^
+                  diff_range: FETCH_HEAD
                   description: >-
                     Collect results for all tests affected by a pull request in
                     ${browser.name} but without the changes in the PR.
                   extra_args: >-
                     --no-fail-on-unexpected
                     --log-wptreport=../artifacts/wpt_report.json
                     --log-wptscreenshot=../artifacts/wpt_screenshot.txt
               each(operation):
@@ -151,17 +151,17 @@ tasks:
                   else:
                     github-worker
                 metadata:
                   name: ${operation.name}
                   description: ${operation.description}
                   owner: ${event.pull_request.user.login}@users.noreply.github.com
                   source: ${event.repository.url}
                 payload:
-                  image: harjgam/web-platform-tests:0.32
+                  image: harjgam/web-platform-tests:0.30
                   maxRunTime: 7200
                   artifacts:
                     public/results:
                       path: /home/test/artifacts
                       type: directory
                   env:
                     TASK_EVENT: "${event_str}"
                   # Fetch the GitHub-provided merge commit (rather than the pull
@@ -173,27 +173,28 @@ tasks:
                   command:
                     - /bin/bash
                     - --login
                     - -c
                     - set -ex;
                       echo "${operation.name}";
                       ~/start.sh
                         ${event.repository.clone_url}
-                        refs/pull/${event.number}/merge;
+                        refs/pull/${event.number}/merge
+                        FETCH_HEAD;
                       cd web-platform-tests;
                       ./tools/ci/run_tc.py
                         --checkout=${operation.checkout}
                         --oom-killer
                         --browser=${browser.name}
                         --channel=${browser.channel}
                         --xvfb
                         stability
                         ./tools/ci/taskcluster-run.py
-                          --commit-range ${operation.diff_base}
+                          --commit-range ${operation.diff_range}
                           ${browser.name}
                           --
                           --channel=${browser.channel}
                           ${operation.extra_args};
       - $map:
           # This is the main point to define new CI checks other than stability checks
         - name: lint
           description: >-
@@ -304,27 +305,28 @@ tasks:
                   else:
                     github-worker
                 metadata:
                   name: ${operation.name}
                   description: ${operation.description}
                   owner: ${event.sender.login}@users.noreply.github.com
                   source: ${event.repository.url}
                 payload:
-                  image: harjgam/web-platform-tests:0.32
+                  image: harjgam/web-platform-tests:0.30
                   maxRunTime: 7200
                   artifacts:
                     public/results:
                       path: /home/test/artifacts
                       type: directory
                   env:
                     TASK_EVENT: "${event_str}"
                   command:
                     - /bin/bash
                     - --login
                     - -c
                     - set -ex;
                       echo "${operation.name}";
                       ~/start.sh
                         ${event.repository.clone_url}
-                        ${checkout_ref};
+                        ${checkout_ref}
+                        FETCH_HEAD;
                       cd ~/web-platform-tests;
                       ${operation.script};
--- a/testing/web-platform/tests/tools/ci/run_tc.py
+++ b/testing/web-platform/tests/tools/ci/run_tc.py
@@ -112,17 +112,17 @@ def start_userspace_oom_killer():
     start(["sudo", "earlyoom", "-p", "-r", "60" "--prefer=(chrome|firefox)", "--avoid=python"])
 
 
 def make_hosts_file():
     subprocess.check_call(["sudo", "sh", "-c", "./wpt make-hosts-file >> /etc/hosts"])
 
 
 def checkout_revision(rev):
-    subprocess.check_call(["git", "--quiet", "checkout", rev])
+    subprocess.check_call(["git", "checkout", "-q", rev])
 
 
 def install_chrome(channel):
     if channel in ("experimental", "dev", "nightly"):
         deb_archive = "google-chrome-unstable_current_amd64.deb"
     elif channel == "beta":
         deb_archive = "google-chrome-beta_current_amd64.deb"
     elif channel == "stable":
@@ -228,29 +228,16 @@ def main():
     except KeyError:
         print("WARNING: Missing TASK_EVENT environment variable")
         # For example under local testing
         event = {}
 
     if event:
         set_variables(event)
 
-    if os.environ.get("GITHUB_PULL_REQUEST", "false") != "false":
-        parents = run(["git", "show", "--format=%P", "task_head"], return_stdout=True).strip().split()
-        if len(parents) == 2:
-            base_head = parents[0]
-            pr_head = parents[1]
-
-            run(["git", "branch", "base_head", base_head])
-            run(["git", "branch", "pr_head", pr_head])
-        else:
-            print("ERROR: Pull request HEAD wasn't a 2-parent merge commit; "
-                  "expected to test the merge of PR into the base")
-            sys.exit(1)
-
     if os.environ.get("GITHUB_BRANCH"):
         # Ensure that the remote base branch exists
         # TODO: move this somewhere earlier in the task
         run(["git", "fetch", "origin", "%s:%s" % (os.environ["GITHUB_BRANCH"],
                                                   os.environ["GITHUB_BRANCH"])])
 
     extra_jobs = get_extra_jobs(event)
 
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/tools/ci/start.sh
@@ -0,0 +1,1 @@
+# Contents of this script superceeded by tools/ci/run_tc.py
--- a/testing/web-platform/tests/tools/docker/start.sh
+++ b/testing/web-platform/tests/tools/docker/start.sh
@@ -9,21 +9,33 @@
 #   docker push <tag>
 # Update the `image` specified in the project's .taskcluster.yml file
 
 
 set -ex
 
 REMOTE=${1:-https://github.com/web-platform-tests/wpt}
 REF=${2:-master}
+REVISION=${3:-FETCH_HEAD}
+BROWSER=${4:-all}
+CHANNEL=${5:-nightly}
 
 cd ~
 
 mkdir web-platform-tests
 cd web-platform-tests
 
 git init
 git remote add origin ${REMOTE}
 
 # Initially we just fetch 50 commits in order to save several minutes of fetching
-retry git fetch --quiet --depth=50 --tags origin ${REF}:task_head
+retry git fetch --quiet --depth=50 --tags origin ${REF}
 
-git checkout --quiet task_head
+if [[ ! `git rev-parse --verify -q ${REVISION}` ]];
+then
+    # But if for some reason the commit under test isn't in that range, we give in and
+    # fetch everything
+    retry git fetch -q --unshallow ${REMOTE}
+    git rev-parse --verify ${REVISION}
+fi
+git checkout -b build ${REVISION}
+
+source tools/ci/start.sh