Skip to content

Commit ac00cfd

Browse files
committed
circleci: add test-image
1 parent 623122b commit ac00cfd

Some content is hidden

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

49 files changed

+262008
-4
lines changed

.circleci/config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ workflows:
2929
requires:
3030
- test-node-v6
3131
- test-node-v8
32+
- test-image:
33+
requires:
34+
- docker-build-and-push
3235

3336
version: 2
3437
jobs:
@@ -91,6 +94,21 @@ jobs:
9194
docker:
9295
- image: circleci/node:8.11-stretch-browsers
9396

97+
test-image:
98+
docker:
99+
- image: quay.io/plotly/image-exporter:$CIRCLE_SHA1
100+
steps:
101+
- checkout
102+
- run:
103+
name: Run image test
104+
command: |
105+
set -e
106+
cd test/image
107+
./render_mocks_cli build
108+
./compare_images baselines build
109+
- store_artifacts:
110+
path: test/image
111+
94112
docker-build-and-push:
95113
docker:
96114
- image: circleci/node:8.11-stretch-browsers

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ coverage
1010
deployment/*.retry
1111

1212
/yarn-error.log
13+
14+
test/image/build
15+
test/image/diff

deployment/ImageMagickPolicy.xml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE policymap [
3+
<!ELEMENT policymap (policy)+>
4+
<!ELEMENT policy (#PCDATA)>
5+
<!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED>
6+
<!ATTLIST policy name CDATA #IMPLIED>
7+
<!ATTLIST policy rights CDATA #IMPLIED>
8+
<!ATTLIST policy pattern CDATA #IMPLIED>
9+
<!ATTLIST policy value CDATA #IMPLIED>
10+
]>
11+
<!--
12+
Configure ImageMagick policies.
13+
14+
Domains include system, delegate, coder, filter, path, or resource.
15+
16+
Rights include none, read, write, and execute. Use | to combine them,
17+
for example: "read | write" to permit read from, or write to, a path.
18+
19+
Use a glob expression as a pattern.
20+
21+
Suppose we do not want users to process MPEG video images:
22+
23+
<policy domain="delegate" rights="none" pattern="mpeg:decode" />
24+
25+
Here we do not want users reading images from HTTP:
26+
27+
<policy domain="coder" rights="none" pattern="HTTP" />
28+
29+
Lets prevent users from executing any image filters:
30+
31+
<policy domain="filter" rights="none" pattern="*" />
32+
33+
The /repository file system is restricted to read only. We use a glob
34+
expression to match all paths that start with /repository:
35+
36+
<policy domain="path" rights="read" pattern="/repository/*" />
37+
38+
Any large image is cached to disk rather than memory:
39+
40+
<policy domain="resource" name="area" value="1GB"/>
41+
42+
Define arguments for the memory, map, area, and disk resources with
43+
SI prefixes (.e.g 100MB). In addition, resource policies are maximums for
44+
each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
45+
exceeds policy maximum so memory limit is 1GB).
46+
-->
47+
<policymap>
48+
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
49+
<!-- <policy domain="resource" name="memory" value="2GiB"/> -->
50+
<!-- <policy domain="resource" name="map" value="4GiB"/> -->
51+
<!-- <policy domain="resource" name="area" value="1GB"/> -->
52+
<!-- <policy domain="resource" name="disk" value="16EB"/> -->
53+
<!-- <policy domain="resource" name="file" value="768"/> -->
54+
<!-- <policy domain="resource" name="thread" value="4"/> -->
55+
<!-- <policy domain="resource" name="throttle" value="0"/> -->
56+
<!-- <policy domain="resource" name="time" value="3600"/> -->
57+
<!-- <policy domain="system" name="precision" value="6"/> -->
58+
<!-- <policy domain="cache" name="shared-secret" value="passphrase"/> -->
59+
60+
<policy domain="path" rights="none" pattern="@*" />
61+
<!--
62+
<policy domain="coder" rights="none" pattern="EPHEMERAL" />
63+
<policy domain="coder" rights="none" pattern="URL" />
64+
<policy domain="coder" rights="none" pattern="HTTPS" />
65+
<policy domain="coder" rights="none" pattern="MVG" />
66+
<policy domain="coder" rights="none" pattern="MSL" />
67+
<policy domain="coder" rights="none" pattern="TEXT" />
68+
<policy domain="coder" rights="none" pattern="SHOW" />
69+
<policy domain="coder" rights="none" pattern="WIN" />
70+
<policy domain="coder" rights="none" pattern="PLT" />
71+
-->
72+
73+
<!-- disable ghostscript format types -->
74+
<!--
75+
<policy domain="coder" rights="none" pattern="PS" />
76+
<policy domain="coder" rights="none" pattern="EPS" />
77+
<policy domain="coder" rights="none" pattern="PDF" />
78+
<policy domain="coder" rights="none" pattern="XPS" />
79+
-->
80+
<policy domain="coder" rights="read|write" pattern="*" />
81+
82+
</policymap>

deployment/entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22

33
if [[ $1 == "--help" || $1 == "--version" || $1 == "graph" ]]; then
4-
xvfb-run --server-args "-screen 0 640x480x24" -a /var/www/image-exporter/bin/orca.js $@
4+
xvfb-run --server-args "-screen 0 640x480x24" -a /var/www/image-exporter/bin/orca.js "$@"
55
elif [[ $1 == "serve" ]]; then
66
shift 1 # Remove argument "serve" since it is assumed in the following
7-
/run_server $@
7+
/run_server "$@"
88
else # By default, run the server
9-
/run_server $@
9+
/run_server "$@"
1010
fi

deployment/run_server

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BUILD_DIR=/var/www/image-exporter/build
1414
if [[ -n "${PLOTLY_JS_SRC}" ]]; then
1515
# Fetch plotly js bundle and save it locally:
1616
mkdir -p $BUILD_DIR
17-
wget --retry-connrefused --no-check-certificate -O $BUILD_DIR/plotly-bundle.js $PLOTLY_JS_SRC
17+
wget --retry-connrefused --no-check-certificate -O $BUILD_DIR/plotly-bundle.js "$PLOTLY_JS_SRC"
1818
PLOTLYJS_ARG="--plotlyJS $BUILD_DIR/plotly-bundle.js"
1919
fi
2020

test/image/baselines/29.emf

177 KB
Binary file not shown.

0 commit comments

Comments
 (0)