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

Commit 1c6a1a8

Browse files
krotscheckqiyigg
authored andcommitted
fix(circleci): Switch to using circleci v2 syntax and fix build errors (#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.
1 parent 60cc0dc commit 1c6a1a8

File tree

3 files changed

+72
-40
lines changed

3 files changed

+72
-40
lines changed

Diff for: circle.yml

+69-37
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,72 @@
1-
machine:
2-
node:
3-
version: 6.9.1
4-
environment:
5-
# Fix issue with selenium-server in containers.
6-
# See http://github.com/SeleniumHQ/docker-selenium/issues/87
7-
DBUS_SESSION_BUS_ADDRESS: /dev/null
8-
9-
dependencies:
10-
override:
11-
- npm i
12-
cache_directories:
13-
- testapp/node_modules
14-
post:
15-
- ./node_modules/.bin/gulp lint
16-
- ./node_modules/.bin/webdriver-manager update
17-
- ./node_modules/.bin/webdriver-manager start:
18-
background: true
19-
- cd testapp && npm i
20-
- npm start:
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/node:6.14-browsers
6+
environment:
7+
# Fix issue with selenium-server in containers.
8+
# See http://github.com/SeleniumHQ/docker-selenium/issues/87
9+
DBUS_SESSION_BUS_ADDRESS: /dev/null
10+
steps:
11+
- checkout
12+
13+
- run:
14+
name: Install Dependencies
15+
command: |
16+
sudo apt-get update
17+
sudo apt-get install python-pip tcpdump
18+
19+
# Have to update firefox, default is ESR.
20+
sudo pip install --upgrade pip
21+
sudo pip install mozdownload mozinstall
22+
mozdownload --version latest --destination firefox.tar.bz2
23+
mozinstall firefox.tar.bz2
24+
sudo cp -R firefox/* /opt/firefox/
25+
26+
# Latest chrome is already installed in the default container.
27+
# curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
28+
# sudo dpkg -i google-chrome.deb
29+
# sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
30+
# rm google-chrome.deb
31+
32+
- restore_cache:
33+
key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}
34+
35+
- run:
36+
name: NPM Install
37+
command: |
38+
npm i
39+
cd testapp && npm i
40+
41+
- save_cache:
42+
key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}
43+
paths:
44+
- "node_modules"
45+
- "testapp/node_modules"
46+
47+
- run:
48+
name: Lint
49+
command: ./node_modules/.bin/gulp lint
50+
51+
- run:
52+
name: Selenium Start
2153
background: true
22-
- sudo apt-get update
23-
# Install the latest Firefox beta
24-
- pip install --upgrade pip
25-
- pip install mozdownload mozinstall
26-
- mozdownload --version latest --destination firefox.tar.bz2
27-
- mozinstall firefox.tar.bz2
28-
- sudo cp -R firefox/* /opt/firefox/
29-
# Install the latest Chrome
30-
- curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
31-
- sudo dpkg -i google-chrome.deb
32-
- sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
33-
- rm google-chrome.deb
34-
# Extra tcp logging for BlockingProxy
35-
- sudo tcpdump -i lo 'tcp && dst localhost' -w $CIRCLE_ARTIFACTS/localdump.pcap:
54+
command: |
55+
./node_modules/.bin/webdriver-manager update
56+
./node_modules/.bin/webdriver-manager start
57+
58+
- run:
59+
name: TestApp Start
3660
background: true
61+
command: |
62+
npm start
63+
64+
# Seems like the new circleci container no longer permits packet introspection on lo, even for root.
65+
# - run:
66+
# name: Extra tcp logging for BlockingProxy
67+
# background: true
68+
# command: sudo tcpdump -i lo 'tcp && dst localhost' -w $CIRCLE_ARTIFACTS/localdump.pcap
3769

38-
test:
39-
override:
40-
- npm test
70+
- run:
71+
name: Test
72+
command: npm test

Diff for: scripts/test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ executor.addCommandlineTest('node built/cli.js spec/errorTest/slowHttpAndTimeout
129129
.expectExitCode(1)
130130
.expectErrors([
131131
{message: 'The following tasks were pending[\\s\\S]*\\$http: slowcall'},
132-
{message: 'The following tasks were pending[\\s\\S]*' +
133-
'\\$timeout: function \\(\\) {[\\s\\S]*' +
132+
{message: 'The following tasks were pending:[\\s\\S]*' +
133+
'- \\$timeout: function\\(\\) {[\\s\\S]*' +
134134
'\\$scope\\.slowAngularTimeoutStatus = \'done\';[\\s\\S]' +
135135
'*}'}
136136
]);

Diff for: spec/errorTest/slowHttpAndTimeoutConf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ exports.config = {
1515

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

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

0 commit comments

Comments
 (0)