Skip to content

Commit c5c315e

Browse files
committed
Add tests for defining extraVolumes and extraVolumeMounts as dict
1 parent 2ed7e98 commit c5c315e

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

dev-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ singleuser:
159159
data-toml: *data-toml
160160
storage:
161161
type: none
162+
extraVolumes:
163+
test-volume:
164+
name: test-volume
165+
emptyDir: {}
166+
extraVolumeMounts:
167+
test-volume-mount:
168+
name: test-volume
169+
mountPath: /test-volume
162170
memory:
163171
guarantee: null
164172
networkPolicy:

tests/test_spawn.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,22 @@ def test_spawn_basic(
129129
assert (
130130
c.returncode == 0
131131
), "The singleuser.extraFiles configuration doesn't seem to have been honored!"
132+
133+
# check the extra volume and volume mount exists
134+
c = subprocess.run(
135+
[
136+
"kubectl",
137+
"exec",
138+
pod_name,
139+
"--",
140+
"sh",
141+
"-c",
142+
"if [ ! -d /test-volume ]; then exit 1; fi",
143+
]
144+
)
145+
assert (
146+
c.returncode == 0
147+
), "The singleuser.storage.extraVolumes and extraVolumeMounts configuration doesn't seem to have been honored!"
132148
finally:
133149
_delete_server(api_request, jupyter_user, request_data["test_timeout"])
134150

0 commit comments

Comments
 (0)