Skip to content

Commit

Permalink
Add note about how to test local repositories. Add a flag for local r…
Browse files Browse the repository at this point in the history
…epository testing.
  • Loading branch information
HazenBabcock committed Nov 26, 2016
1 parent 2cf4258 commit 441ffca
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The PLplot docker image repository is [here](https://hub.docker.com/u/plplot/)

### Basic Testing ###

#### SF repository master ####
```sh
docker run plplot/XXX 2>&1 | tee XXX.txt
```
Expand All @@ -21,15 +22,27 @@ Where XXX is a docker image, for example:
docker run plplot/debian-latest 2>&1 | tee debian-latest.txt
```

#### Local repository ####

```sh
docker run -v /absolute/path/to/local/plplot:/plplot_repo plplot/debian-latest 2>&1 | tee debian-latest.txt
```

### Comprehensive Testing ###

```sh
python pull_all.py # This will pull the latest images.
python test_all.py
```

Note: By default test_all.py will test two images at once, if you want to run more (or less) tests in parallel use the --max_processes argument.
By default test_all.py will test two images at once, if you want to run more (or less) tests in parallel use the --max_processes argument.

```sh
python test_all.py --max_processes 10
```

If you want to test a local repository use the --plplot_repo argument.

```sh
python test_all.py --plplot_repo /absolute/path/to/local/plplot_repo
```
8 changes: 7 additions & 1 deletion test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@
parser.add_argument('--max_processes', dest='maxp', type=int, required=False, default=2,
help = "The maximum number of processes to run in parallel.")

parser.add_argument('--plplot_repo', dest='plplot_repo', type=str, required=False, default="",
help = "Absolute path to a local repository.")

args = parser.parse_args()


def mp_worker(docker_image):
print("Starting", docker_image)
cmd = ["docker", "run", docker_image]
if (len(args.plplot_repo) > 0):
cmd = ["docker", "run", "-v", args.plplot_repo + ":/plplot_repo", docker_image]
else:
cmd = ["docker", "run", docker_image]
out = subprocess.check_output(cmd, stderr = subprocess.STDOUT)
with open(docker_image.split("/")[1] + ".txt", "wb") as outfp:
outfp.write(out)
Expand Down

0 comments on commit 441ffca

Please sign in to comment.