From ef76a00c6d38be8145b73104ab37caebffa9000a Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Thu, 21 Feb 2019 11:45:55 -0500 Subject: [PATCH 1/9] Use xenial VMs on Travis for faster bootup --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 83a2cdeb1baa..75f48395648c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js -dist: trusty +dist: xenial node_js: - "lts/*" python: From af8ff83d72332e8e16f3616d95ada6b023e44fa8 Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Thu, 21 Feb 2019 11:56:49 -0500 Subject: [PATCH 2/9] User mode for pip install --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 75f48395648c..06c16cfaa72d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ notifications: before_install: - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" - - pip install urllib3[secure] + - pip install urllib3[secure] --user - pip install gsutil --user branches: only: From 68d0f8f2e98e6f303712c34a16914439c4f21eac Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Thu, 21 Feb 2019 11:57:10 -0500 Subject: [PATCH 3/9] Remove xvfb install, since we use chrome in headless mode --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 06c16cfaa72d..b171101505dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -89,8 +89,8 @@ jobs: fast_finish: true #TODO(ampproject/wg-infra): remove when remote tests stabilize allow_failures: - - script: - - node build-system/pr-check/remote-tests.js + - script: + - node build-system/pr-check/remote-tests.js cache: yarn: true directories: From 378db6c65463e89f8932183efbcc106aac53be1c Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Thu, 21 Feb 2019 14:54:06 -0500 Subject: [PATCH 4/9] Reorganize install section --- .travis.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index b171101505dd..b6c822971360 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,14 @@ notifications: webhooks: - http://savage.nonblocking.io:8080/savage/travis before_install: + # Yarn is outdated on Travis (github.com/travis-ci/travis-ci/issues/9445) - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" - - pip install urllib3[secure] --user - - pip install gsutil --user + # Python dependencies + - pip install --upgrade pip + - pip install --user urllib3[secure] + - pip install --user gsutil + - pip install --user protobuf branches: only: - master @@ -25,6 +29,11 @@ branches: - /^amp-release-.*$/ - /^revert-.*$/ addons: + apt: + packages: + - protobuf-compiler + - python-protobuf + chrome: stable hosts: - ads.localhost - iframe.localhost @@ -50,15 +59,8 @@ jobs: - node build-system/pr-check/checks.js - stage: build name: "Validator Tests" - before_script: - - pip install --user protobuf script: - node build-system/pr-check/validator-tests.js - addons: - apt: - packages: - - protobuf-compiler - - python-protobuf - stage: build name: "Dist" if: type != pull_request @@ -66,8 +68,6 @@ jobs: - node build-system/pr-check/dist.js - stage: test name: "Dist, Bundle Size, Single Pass Tests" - addons: - chrome: stable script: - node build-system/pr-check/dist-tests.js - stage: test @@ -76,8 +76,6 @@ jobs: - node build-system/pr-check/visual-diff-tests.js - stage: test name: "Local Tests" - addons: - chrome: stable script: - node build-system/pr-check/local-tests.js - stage: test From 251e5b76b5513c29bd04f31a9e77afe1c5d5f890 Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Wed, 27 Feb 2019 18:43:36 -0500 Subject: [PATCH 5/9] Use Java 8 by default --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index b6c822971360..39e1e13ba926 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,9 @@ before_install: - pip install --user urllib3[secure] - pip install --user gsutil - pip install --user protobuf + # Xenial uses Java 11 by default (github.com/travis-ci/travis-ci/issues/10290) + - export PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/lib\/jvm\/openjdk11\/bin//') + - export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 branches: only: - master From 78e281bed74c585eb15cb731cdb1415f4259c3f0 Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Wed, 27 Feb 2019 18:50:20 -0500 Subject: [PATCH 6/9] Clean up, fixes --- .travis.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 39e1e13ba926..0b1b0b014c86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,11 +17,10 @@ before_install: - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" # Python dependencies - - pip install --upgrade pip - pip install --user urllib3[secure] - pip install --user gsutil - pip install --user protobuf - # Xenial uses Java 11 by default (github.com/travis-ci/travis-ci/issues/10290) + # Override Xenial's default Java version (github.com/travis-ci/travis-ci/issues/10290) - export PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/lib\/jvm\/openjdk11\/bin//') - export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 branches: @@ -40,9 +39,8 @@ addons: hosts: - ads.localhost - iframe.localhost - # CURLs amp subdomain for amp-recaptcha-input, - # integration tests. The hash is the - # CURLS subdomain for localhost:9876 + # CURLs amp subdomain for the amp-recaptcha-input integration test. The hash + # is the CURLS subdomain for localhost:9876 - jgla3zmib2ggq5buc4hwi5taloh6jlvzukddfr4zltz3vay5s5rq.recaptcha.localhost # Requested by some tests because they need a valid font host, # but should not resolve in tests. @@ -52,6 +50,7 @@ stages: - test jobs: include: + # Build stage - stage: build name: "Build" script: @@ -69,6 +68,8 @@ jobs: if: type != pull_request script: - node build-system/pr-check/dist.js + + # Test stage - stage: test name: "Dist, Bundle Size, Single Pass Tests" script: @@ -88,18 +89,19 @@ jobs: after_script: - build-system/sauce_connect/stop_sauce_connect.sh fast_finish: true - #TODO(ampproject/wg-infra): remove when remote tests stabilize + + # TODO(ampproject/wg-infra): remove when remote tests stabilize allow_failures: - script: - node build-system/pr-check/remote-tests.js cache: - yarn: true directories: - - build-system/tasks/visual-diff/node_modules - node_modules + - build-system/tasks/visual-diff/node_modules + - sauce_connect - validator/node_modules - validator/nodejs/node_modules - validator/webui/node_modules - - sauce_connect pip: true bundler: true + yarn: true From 949e818769cf0564c003b15045d120fe828ca6fb Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Wed, 27 Feb 2019 20:15:59 -0500 Subject: [PATCH 7/9] Fix caching --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0b1b0b014c86..8822cf18a5cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -102,6 +102,5 @@ cache: - validator/node_modules - validator/nodejs/node_modules - validator/webui/node_modules - pip: true - bundler: true + - $HOME/.cache/pip yarn: true From 4e0e1e5b1cfbaeebbc651704dc53231005a631ef Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Thu, 28 Feb 2019 10:51:57 -0500 Subject: [PATCH 8/9] Remove yarn upgrade, since Xenial uses the latest version --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8822cf18a5cf..c9d4d69763f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,6 @@ notifications: webhooks: - http://savage.nonblocking.io:8080/savage/travis before_install: - # Yarn is outdated on Travis (github.com/travis-ci/travis-ci/issues/9445) - - curl -o- -L https://yarnpkg.com/install.sh | bash - - export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" - # Python dependencies - pip install --user urllib3[secure] - pip install --user gsutil - pip install --user protobuf From f8db418442d532d8c38d0058922951fd92f81b30 Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Thu, 28 Feb 2019 11:47:55 -0500 Subject: [PATCH 9/9] Address comments --- .travis.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index c9d4d69763f8..b3d4eafbd12a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,7 @@ notifications: webhooks: - http://savage.nonblocking.io:8080/savage/travis before_install: - - pip install --user urllib3[secure] - - pip install --user gsutil - - pip install --user protobuf + - pip install --user gsutil protobuf urllib3[secure] # Override Xenial's default Java version (github.com/travis-ci/travis-ci/issues/10290) - export PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/lib\/jvm\/openjdk11\/bin//') - export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 @@ -46,7 +44,6 @@ stages: - test jobs: include: - # Build stage - stage: build name: "Build" script: @@ -64,8 +61,6 @@ jobs: if: type != pull_request script: - node build-system/pr-check/dist.js - - # Test stage - stage: test name: "Dist, Bundle Size, Single Pass Tests" script: