Skip to content

Commit fc46ec1

Browse files
authored
RHAIENG-308, opendatahub-io#2242: tests(make): handle rstudio in a rhds-compatible manner (opendatahub-io#2277)
1 parent 1bd738f commit fc46ec1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tests/manifests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ def get_source_of_truth_filepath(
185185
filename = f"jupyter-{notebook_id}-{file_suffix}"
186186

187187
elif RSTUDIO_NOTEBOOK_ID in notebook_id:
188-
filename = f"rstudio-gpu-{file_suffix}"
188+
imagestream_filename = f"rstudio-gpu-{file_suffix}"
189+
buildconfig_filename = "cuda-rstudio-buildconfig.yaml"
190+
_ = imagestream_filename
191+
filename = buildconfig_filename
189192

190193
if not filename:
191194
raise ValueError(

tests/test_main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,12 @@ def load_manifests_file_for(directory: pathlib.Path) -> Manifest:
378378
f"Computed filepath '{manifest_file}' does not exist."
379379
)
380380

381-
imagestream = yaml.safe_load(manifest_file.read_text())
381+
# BEWARE: rhds rstudio has imagestream bundled in the buildconfig yaml
382+
if "buildconfig" in manifest_file.name:
383+
# imagestream is the first document in the file
384+
imagestream = next(yaml.safe_load_all(manifest_file.read_text()))
385+
else:
386+
imagestream = yaml.safe_load(manifest_file.read_text())
382387
recommended_tags = [
383388
tag
384389
for tag in imagestream["spec"]["tags"]

0 commit comments

Comments
 (0)