You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Step 0: Start the docker machine (Mac and Windows users only)
11
+
12
+
Boot up docker machine (named `default`):
13
+
14
+
```bash
15
+
docker-machine start default
16
+
```
17
+
18
+
Set up the docker environment for `docker-compose`:
19
+
20
+
```bash
21
+
eval$(docker-machine env default)
22
+
```
23
+
24
+
the above evaluates the output of `docker-machine env default`.
25
+
26
+
27
+
### Step 1: Run the testing container
28
+
29
+
Plotly.js uses `docker-compose` to ease the creation/stopping/deletion of the testing docker container.
7
30
8
-
Plotly.js uses `docker-compose` to ease the creation/stopping/deletion of testing docker container,
9
-
please refer [installing docker-compose](https://docs.docker.com/compose/install/) for installation.
10
31
Inside your `plotly.js` directory, run
11
32
12
33
```bash
13
-
$ docker-compose up -d
34
+
docker-compose up -d
14
35
```
15
36
16
37
In the `docker-compose.yml` file, `latest` is the latest Plotly Image-Server docker container version
17
38
as listed on [hub.docker.com](https://hub.docker.com/r/plotly/imageserver/tags/) and
18
-
`imagetest` is the name of the docker container.
19
-
39
+
`imagetest` is the name of the docker container. The `-d` flag tells docker to start the containers in the background and leave them running.
20
40
21
-
### Run the tests
41
+
### Step 2: Run the image tests
22
42
23
43
Inside your `plotly.js` directory, run
24
44
25
45
```bash
26
46
npm run test-image
27
47
```
28
48
29
-
### SSH into docker
49
+
if some tests fail, compare their outputs using `npm run start-image_viewer`.
50
+
51
+
### Step 2b: Make a new baseline image
52
+
53
+
Inside your `plotly.js` directory, run
54
+
55
+
```bash
56
+
npm run baseline -- mock.json
57
+
```
58
+
59
+
where `mock.json` is the name of a `{"data": [], "layout": {}}` json file found in [`test/image/mocks/`](https://github.com/plotly/plotly.js/tree/master/test/image/mocks). The `"data"` and `"layout"` field are passed to `Plotly.plot` to produce an image saved in [`test/image/baslines`](https://github.com/plotly/plotly.js/tree/master/test/image/baselines).
60
+
61
+
### Step 3: Stop your testing container
62
+
63
+
Once done testing, inside your `plotly.js` directory, run
64
+
65
+
```bash
66
+
docker-compose stop
67
+
```
68
+
69
+
Mac and Windows user should also kill their docker-machine (named `default`) once done testing:
0 commit comments