Skip to content

Commit 03be8ff

Browse files
committedSep 10, 2018
Merge branch 'master' into compress-attr-transform-by-default
2 parents 3485c0e + 178feb5 commit 03be8ff

File tree

1,849 files changed

+1216015
-516488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,849 files changed

+1216015
-516488
lines changed
 

‎.circleci/config.yml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
version: 2.0
2+
3+
# Inspired by:
4+
# https://github.com/CircleCI-Public/circleci-demo-workflows/blob/workspace-forwarding/.circleci/config.yml
5+
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
6+
#
7+
# For list of official CircleCI node.js images, go to:
8+
# https://hub.docker.com/r/circleci/node/tags/
9+
10+
jobs:
11+
build:
12+
docker:
13+
- image: circleci/node:10.9.0
14+
working_directory: ~/plotly.js
15+
steps:
16+
- checkout
17+
- restore_cache:
18+
keys:
19+
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package-lock.json" }}
20+
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-master-{{ checksum "package-lock.json" }}
21+
- run:
22+
name: Install dependencies
23+
command: |
24+
npm install
25+
- run:
26+
name: List dependency versions
27+
command: |
28+
echo "npm: $(npm --version)"
29+
echo "node: $(node --version)"
30+
npm ls || true
31+
- run:
32+
name: Pretest
33+
command: |
34+
npm run pretest
35+
npm run cibuild
36+
- save_cache:
37+
paths:
38+
- node_modules
39+
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package.json" }}
40+
- persist_to_workspace:
41+
root: .
42+
paths:
43+
- node_modules
44+
- build
45+
- dist
46+
47+
test-jasmine:
48+
docker:
49+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
50+
- image: circleci/node:10.9.0-browsers
51+
working_directory: ~/plotly.js
52+
steps:
53+
- checkout
54+
- attach_workspace:
55+
at: ~/plotly.js
56+
- run:
57+
name: Run jasmine tests (batch 1)
58+
command: ./.circleci/test.sh jasmine
59+
60+
test-jasmine2:
61+
docker:
62+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
63+
- image: circleci/node:10.9.0-browsers
64+
working_directory: ~/plotly.js
65+
steps:
66+
- checkout
67+
- attach_workspace:
68+
at: ~/plotly.js
69+
- run:
70+
name: Run jasmine tests (batch 2)
71+
command: ./.circleci/test.sh jasmine2
72+
73+
test-image:
74+
docker:
75+
- image: plotly/testbed:latest
76+
working_directory: /var/www/streambed/image_server/plotly.js/
77+
steps:
78+
- checkout
79+
- attach_workspace:
80+
at: /var/www/streambed/image_server/plotly.js/
81+
- run:
82+
name: Run and setup container
83+
command: |
84+
supervisord &
85+
npm run docker -- setup
86+
- run:
87+
name: Run image tests
88+
command: ./.circleci/test.sh image
89+
- store_artifacts:
90+
path: build
91+
92+
test-image2:
93+
docker:
94+
- image: plotly/testbed:latest
95+
working_directory: /var/www/streambed/image_server/plotly.js/
96+
steps:
97+
- checkout
98+
- attach_workspace:
99+
at: /var/www/streambed/image_server/plotly.js/
100+
- run:
101+
name: Run and setup container
102+
command: |
103+
supervisord &
104+
npm run docker -- setup
105+
- run:
106+
name: Run image tests
107+
command: ./.circleci/test.sh image2
108+
- store_artifacts:
109+
path: build
110+
111+
test-syntax:
112+
docker:
113+
- image: circleci/node:10.9.0
114+
working_directory: ~/plotly.js
115+
steps:
116+
- checkout
117+
- attach_workspace:
118+
at: ~/plotly.js
119+
- run:
120+
name: Run syntax tests
121+
command: ./.circleci/test.sh syntax
122+
123+
workflows:
124+
version: 2
125+
build-and-test:
126+
jobs:
127+
- build
128+
- test-jasmine:
129+
requires:
130+
- build
131+
- test-jasmine2:
132+
requires:
133+
- build
134+
- test-image:
135+
requires:
136+
- build
137+
- test-image2:
138+
requires:
139+
- build
140+
- test-syntax:
141+
requires:
142+
- build

‎.circleci/test.sh

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/bin/bash
2+
3+
# override CircleCi's default run settings
4+
set +e
5+
set +o pipefail
6+
7+
ROOT=$(dirname $0)/..
8+
EXIT_STATE=0
9+
MAX_AUTO_RETRY=5
10+
11+
log () {
12+
echo -e "\n$1"
13+
}
14+
15+
# inspired by https://unix.stackexchange.com/a/82602
16+
retry () {
17+
local n=1
18+
19+
until [ $n -ge $MAX_AUTO_RETRY ]; do
20+
"$@" --failFast && break
21+
log "run $n of $MAX_AUTO_RETRY failed, trying again ..."
22+
n=$[$n+1]
23+
done
24+
25+
if [ $n -eq $MAX_AUTO_RETRY ]; then
26+
log "one last time, w/o failing fast"
27+
"$@" && n=0
28+
fi
29+
30+
if [ $n -eq $MAX_AUTO_RETRY ]; then
31+
log "all $n runs failed, moving on."
32+
EXIT_STATE=1
33+
fi
34+
}
35+
36+
# set timezone to Alaska time (arbitrary timezone to test date logic)
37+
set_tz () {
38+
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
39+
export TZ='America/Anchorage'
40+
}
41+
42+
case $1 in
43+
44+
jasmine)
45+
set_tz
46+
47+
npm run test-jasmine -- --skip-tags=gl,noCI,flaky || EXIT_STATE=$?
48+
retry npm run test-jasmine -- --tags=flaky --skip-tags=noCI
49+
npm run test-bundle || EXIT_STATE=$?
50+
51+
exit $EXIT_STATE
52+
;;
53+
54+
jasmine2)
55+
set_tz
56+
57+
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --tag=gl))
58+
59+
for s in ${SHARDS[@]}; do
60+
retry npm run test-jasmine -- "$s" --tags=gl --skip-tags=noCI
61+
done
62+
63+
exit $EXIT_STATE
64+
;;
65+
66+
image)
67+
npm run test-image || EXIT_STATE=$?
68+
exit $EXIT_STATE
69+
;;
70+
71+
image2)
72+
npm run test-export || EXIT_STATE=$?
73+
npm run test-image-gl2d || EXIT_STATE=$?
74+
exit $EXIT_STATE
75+
;;
76+
77+
syntax)
78+
npm run lint || EXIT_STATE=$?
79+
npm run test-syntax || EXIT_STATE=$?
80+
exit $EXIT_STATE
81+
;;
82+
83+
esac

0 commit comments

Comments
 (0)