mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-09 02:54:05 +00:00
Better tests directory structure (#2231)
This commit is contained in:
38
tests/hierarchy/images_hierarchy.py
Normal file
38
tests/hierarchy/images_hierarchy.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# Copyright (c) Jupyter Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
from pathlib import Path
|
||||
|
||||
THIS_DIR = Path(__file__).parent.resolve()
|
||||
IMAGE_SPECIFIC_TESTS_DIR = THIS_DIR.parent / "image_specific_tests"
|
||||
|
||||
assert IMAGE_SPECIFIC_TESTS_DIR.exists(), f"{IMAGE_SPECIFIC_TESTS_DIR} does not exist."
|
||||
|
||||
# Please, take a look at the hierarchy of the images here:
|
||||
# https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#image-relationships
|
||||
ALL_IMAGES = {
|
||||
"docker-stacks-foundation": None,
|
||||
"base-notebook": "docker-stacks-foundation",
|
||||
"minimal-notebook": "base-notebook",
|
||||
"scipy-notebook": "minimal-notebook",
|
||||
"r-notebook": "minimal-notebook",
|
||||
"julia-notebook": "minimal-notebook",
|
||||
"tensorflow-notebook": "scipy-notebook",
|
||||
"pytorch-notebook": "scipy-notebook",
|
||||
"datascience-notebook": "scipy-notebook",
|
||||
"pyspark-notebook": "scipy-notebook",
|
||||
"all-spark-notebook": "pyspark-notebook",
|
||||
}
|
||||
|
||||
|
||||
def get_test_dirs(
|
||||
short_image_name: str | None,
|
||||
) -> list[Path]:
|
||||
if short_image_name is None:
|
||||
return []
|
||||
|
||||
test_dirs = get_test_dirs(ALL_IMAGES[short_image_name])
|
||||
if (
|
||||
current_image_tests_dir := IMAGE_SPECIFIC_TESTS_DIR / short_image_name
|
||||
).exists():
|
||||
test_dirs.append(current_image_tests_dir)
|
||||
return test_dirs
|
Reference in New Issue
Block a user