Skip to content

Commit 8f98483

Browse files
committed
update testing container docs
1 parent f332f30 commit 8f98483

File tree

1 file changed

+54
-16
lines changed

1 file changed

+54
-16
lines changed

test/image/README.md

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,66 @@
11
# plotly.js image testing
22

3-
Test plotly.js with the Plotly Image-Server docker container.
3+
Test plotly.js with Plotly's image testing docker container.
44

5+
Requirements:
6+
- `docker` | [installation guidelines](http://docs.docker.com/engine/installation/)
7+
- `docker-machine` (for Mac and Windows users only) | [installation guidelines](https://docs.docker.com/machine/install-machine/)
8+
- `docker-compose` | [installation guidelines](https://docs.docker.com/compose/install/)
9+
10+
### 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 testing docker container.
530

6-
### Run the container with `docker compose`
731

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.
1032
Inside your `plotly.js` directory, run
1133

1234
```bash
13-
$ docker-compose up -d
35+
docker-compose up -d
1436
```
1537

1638
In the `docker-compose.yml` file, `latest` is the latest Plotly Image-Server docker container version
1739
as listed on [hub.docker.com](https://hub.docker.com/r/plotly/imageserver/tags/) and
18-
`imagetest` is the name of the docker container.
40+
`imagetest` is the name of the docker container. The `-d` flag tells docker to start the containers in the background and leave them running.
1941

2042

21-
### Run the tests
43+
### Step 2: Run the tests
2244

2345
Inside your `plotly.js` directory, run
2446

2547
```bash
2648
npm run test-image
2749
```
2850

29-
### SSH into docker
51+
if some tests fail, compare their outputs using `npm run start-image_viewer`.
52+
53+
### Step 3: Stop your testing container
54+
55+
Once done testing, inside your `plotly.js` directory, run
56+
57+
```bash
58+
docker-compose stop
59+
```
60+
61+
### Docker tricks
62+
63+
##### SSH into docker container
3064

3165
```bash
3266
ssh -p 2022 root@localhost # with password `root`
@@ -58,36 +92,40 @@ ssh-keygen -f "${HOME}/.ssh/known_hosts" -R [localhost]:2022
5892

5993
to remove host information.
6094

95+
##### List docker machines
96+
97+
```bash
98+
docker-machine ls
99+
```
61100

62-
### List all images
101+
##### List all images
63102

64103
```bash
65104
docker images
66105
```
67106

68-
### List all containers
107+
##### List all containers
69108

70109
```bash
71110
docker ps -a
72111
```
73112

74113
whereas `docker ps` lists only the started containers.
75114

76-
77-
### Stop your testing container
115+
##### Remove your testing container
78116

79117
Inside your `plotly.js` directory, run
80118

81119
```bash
82-
docker-compose stop
120+
docker-compose rm -f
83121
```
84122

85-
### Remove your testing container
123+
#### Remove your docker machine
86124

87-
Inside your `plotly.js` directory, run
125+
If named `default`:
88126

89127
```bash
90-
docker-compose rm -f
128+
docker-machine kill default
91129
```
92130

93131
For more comprehensive information about docker, please refer to the [docker docs](http://docs.docker.com/).

0 commit comments

Comments
 (0)