Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(circleci): Switch to using circleci v2 syntax and fix build errors (
Browse files Browse the repository at this point in the history
#4837)

This patch fixes the continually breaking circleci build. The changes made were:
- Switch to using circleci v2 syntax, as the v1 syntax will be deprecated in August.
  It also permits running this build locally using the `circleci` commandline tool.
- Adjust timeouts on error tests to fail consistently on high-performance machines.
- Correct error formatting on error tests.
  • Loading branch information
krotscheck authored and qiyigg committed Jun 4, 2018
1 parent 60cc0dc commit 1c6a1a8
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 40 deletions.
106 changes: 69 additions & 37 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,72 @@
machine:
node:
version: 6.9.1
environment:
# Fix issue with selenium-server in containers.
# See http://github.com/SeleniumHQ/docker-selenium/issues/87
DBUS_SESSION_BUS_ADDRESS: /dev/null

dependencies:
override:
- npm i
cache_directories:
- testapp/node_modules
post:
- ./node_modules/.bin/gulp lint
- ./node_modules/.bin/webdriver-manager update
- ./node_modules/.bin/webdriver-manager start:
background: true
- cd testapp && npm i
- npm start:
version: 2
jobs:
build:
docker:
- image: circleci/node:6.14-browsers
environment:
# Fix issue with selenium-server in containers.
# See http://github.com/SeleniumHQ/docker-selenium/issues/87
DBUS_SESSION_BUS_ADDRESS: /dev/null
steps:
- checkout

- run:
name: Install Dependencies
command: |
sudo apt-get update
sudo apt-get install python-pip tcpdump
# Have to update firefox, default is ESR.
sudo pip install --upgrade pip
sudo pip install mozdownload mozinstall
mozdownload --version latest --destination firefox.tar.bz2
mozinstall firefox.tar.bz2
sudo cp -R firefox/* /opt/firefox/
# Latest chrome is already installed in the default container.
# curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# sudo dpkg -i google-chrome.deb
# sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
# rm google-chrome.deb
- restore_cache:
key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}

- run:
name: NPM Install
command: |
npm i
cd testapp && npm i
- save_cache:
key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
- "node_modules"
- "testapp/node_modules"

- run:
name: Lint
command: ./node_modules/.bin/gulp lint

- run:
name: Selenium Start
background: true
- sudo apt-get update
# Install the latest Firefox beta
- pip install --upgrade pip
- pip install mozdownload mozinstall
- mozdownload --version latest --destination firefox.tar.bz2
- mozinstall firefox.tar.bz2
- sudo cp -R firefox/* /opt/firefox/
# Install the latest Chrome
- curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome.deb
- sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
- rm google-chrome.deb
# Extra tcp logging for BlockingProxy
- sudo tcpdump -i lo 'tcp && dst localhost' -w $CIRCLE_ARTIFACTS/localdump.pcap:
command: |
./node_modules/.bin/webdriver-manager update
./node_modules/.bin/webdriver-manager start
- run:
name: TestApp Start
background: true
command: |
npm start
# Seems like the new circleci container no longer permits packet introspection on lo, even for root.
# - run:
# name: Extra tcp logging for BlockingProxy
# background: true
# command: sudo tcpdump -i lo 'tcp && dst localhost' -w $CIRCLE_ARTIFACTS/localdump.pcap

test:
override:
- npm test
- run:
name: Test
command: npm test
4 changes: 2 additions & 2 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ executor.addCommandlineTest('node built/cli.js spec/errorTest/slowHttpAndTimeout
.expectExitCode(1)
.expectErrors([
{message: 'The following tasks were pending[\\s\\S]*\\$http: slowcall'},
{message: 'The following tasks were pending[\\s\\S]*' +
'\\$timeout: function \\(\\) {[\\s\\S]*' +
{message: 'The following tasks were pending:[\\s\\S]*' +
'- \\$timeout: function\\(\\) {[\\s\\S]*' +
'\\$scope\\.slowAngularTimeoutStatus = \'done\';[\\s\\S]' +
'*}'}
]);
Expand Down
2 changes: 1 addition & 1 deletion spec/errorTest/slowHttpAndTimeoutConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ exports.config = {

baseUrl: env.baseUrl + '/ng1/',

allScriptsTimeout: 10000
allScriptsTimeout: 4000 // Each test waits on something that has a 5 second tick.
};

0 comments on commit 1c6a1a8

Please sign in to comment.