Skip to content

Commit 23e195f

Browse files
bollwyvlconsideRatio
authored andcommitted
add path check in conda/repo-dir, more docs in conftest.py
1 parent df733fc commit 23e195f

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

tests/conda/r3.6-target-repo-dir-flag/verify.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
import sys
33
import os
4+
from glob import glob
45

56
# conda should still be in /srv/conda
67
# and Python should still be in $NB_PYTHON_PREFIX
@@ -15,3 +16,12 @@
1516

1617
# Repo should be writable
1718
assert os.access("/srv/repo", os.W_OK)
19+
20+
# All files in repo dir should be readable and writeable
21+
for path in glob("/src/repo/**/*", recursive=True):
22+
assert os.access(path, os.R_OK)
23+
assert os.access(path, os.W_OK)
24+
25+
# Should be able to make a new file
26+
with open("/srv/repo/writeable", "w") as fp:
27+
fp.write("writeable")

tests/conftest.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
"""
22
Custom test collector for our integration tests.
33
4-
Each directory that has a script named 'verify' is considered
5-
a test. jupyter-repo2docker is run on that directory,
6-
and then ./verify is run inside the built container. It should
7-
return a non-zero exit code for the test to be considered a
8-
success.
4+
5+
Test lifecycle:
6+
- Find all directories that contain `verify` or `*.repos.yaml`
7+
- If `verify` is found:
8+
- Run `jupyter-repo2docker` on the test directory.
9+
- Extra arguments may be added as YAML list of strings in `extra-args.yaml`.
10+
- Run `./verify` inside the built container.
11+
- It should return a non-zero exit code for the test to be considered a
12+
successful.
13+
- If a `*.repos.yaml` is found:
14+
- For each entry of the form `{name, url, ref, verify}`
15+
- Run `jupyter-repo2docker` with the `url` and `ref`
16+
- Run the `verify` inside the built container
917
"""
1018

1119
import os

0 commit comments

Comments
 (0)