From 6d04f39de677a6933a3925497c573c284c5164ae Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 17 Feb 2022 16:34:15 +0000 Subject: [PATCH 01/13] Run tests on all children images --- .github/workflows/docker-amd64.yml | 4 -- .github/workflows/docker.yml | 4 -- Makefile | 5 +- all-spark-notebook/.dockerignore | 1 - base-notebook/.dockerignore | 1 - datascience-notebook/.dockerignore | 1 - docs/contributing/tests.md | 42 +++++++++------- minimal-notebook/.dockerignore | 1 - pyspark-notebook/.dockerignore | 1 - r-notebook/.dockerignore | 1 - scipy-notebook/.dockerignore | 1 - tensorflow-notebook/.dockerignore | 1 - test/README.md | 15 ------ test/test_units.py | 35 ------------- tests/README.md | 3 ++ .../all-spark-notebook}/data/issue_1168.ipynb | 0 .../data/local_pyspark.ipynb | 0 .../data/local_sparkR.ipynb | 0 .../data/local_sparklyr.ipynb | 0 .../data/local_spylon.ipynb | 0 .../test_spark_notebooks.py | 0 .../base-notebook}/test_container_options.py | 0 .../base-notebook}/test_notebook.py | 0 .../base-notebook}/test_outdated.py | 0 .../base-notebook}/test_package_managers.py | 0 .../base-notebook}/test_packages.py | 0 .../base-notebook}/test_pandoc.py | 0 .../base-notebook}/test_python.py | 0 .../base-notebook}/test_start_container.py | 0 conftest.py => tests/conftest.py | 0 .../datascience-notebook}/test_julia.py | 0 tests/images_hierarchy.py | 30 +++++++++++ .../minimal-notebook}/data/Jupyter_logo.svg | 0 .../data/notebook_math.ipynb | 0 .../minimal-notebook}/data/notebook_svg.ipynb | 0 .../minimal-notebook}/test_inkscape.py | 0 .../minimal-notebook}/test_nbconvert.py | 0 {test => tests}/package_helper.py | 0 .../pyspark-notebook}/test_spark.py | 0 .../pyspark-notebook}/units/unit_spark.py | 0 pytest.ini => tests/pytest.ini | 0 tests/run_tests.py | 50 +++++++++++++++++++ .../scipy-notebook}/data/matplotlib_1.py | 0 .../data/matplotlib_fonts_1.py | 0 .../scipy-notebook}/test_extensions.py | 0 .../scipy-notebook}/test_matplotlib.py | 0 .../scipy-notebook}/units/unit_pandas.py | 0 .../units/unit_tensorflow.py | 0 tests/test_units.py | 39 +++++++++++++++ 49 files changed, 147 insertions(+), 88 deletions(-) delete mode 100644 test/README.md delete mode 100644 test/test_units.py create mode 100644 tests/README.md rename {all-spark-notebook/test => tests/all-spark-notebook}/data/issue_1168.ipynb (100%) rename {all-spark-notebook/test => tests/all-spark-notebook}/data/local_pyspark.ipynb (100%) rename {all-spark-notebook/test => tests/all-spark-notebook}/data/local_sparkR.ipynb (100%) rename {all-spark-notebook/test => tests/all-spark-notebook}/data/local_sparklyr.ipynb (100%) rename {all-spark-notebook/test => tests/all-spark-notebook}/data/local_spylon.ipynb (100%) rename {all-spark-notebook/test => tests/all-spark-notebook}/test_spark_notebooks.py (100%) rename {base-notebook/test => tests/base-notebook}/test_container_options.py (100%) rename {test => tests/base-notebook}/test_notebook.py (100%) rename {test => tests/base-notebook}/test_outdated.py (100%) rename {base-notebook/test => tests/base-notebook}/test_package_managers.py (100%) rename {test => tests/base-notebook}/test_packages.py (100%) rename {base-notebook/test => tests/base-notebook}/test_pandoc.py (100%) rename {base-notebook/test => tests/base-notebook}/test_python.py (100%) rename {base-notebook/test => tests/base-notebook}/test_start_container.py (100%) rename conftest.py => tests/conftest.py (100%) rename {datascience-notebook/test => tests/datascience-notebook}/test_julia.py (100%) create mode 100644 tests/images_hierarchy.py rename {minimal-notebook/test => tests/minimal-notebook}/data/Jupyter_logo.svg (100%) rename {minimal-notebook/test => tests/minimal-notebook}/data/notebook_math.ipynb (100%) rename {minimal-notebook/test => tests/minimal-notebook}/data/notebook_svg.ipynb (100%) rename {minimal-notebook/test => tests/minimal-notebook}/test_inkscape.py (100%) rename {minimal-notebook/test => tests/minimal-notebook}/test_nbconvert.py (100%) rename {test => tests}/package_helper.py (100%) rename {pyspark-notebook/test => tests/pyspark-notebook}/test_spark.py (100%) rename {pyspark-notebook/test => tests/pyspark-notebook}/units/unit_spark.py (100%) rename pytest.ini => tests/pytest.ini (100%) create mode 100755 tests/run_tests.py rename {scipy-notebook/test => tests/scipy-notebook}/data/matplotlib_1.py (100%) rename {scipy-notebook/test => tests/scipy-notebook}/data/matplotlib_fonts_1.py (100%) rename {scipy-notebook/test => tests/scipy-notebook}/test_extensions.py (100%) rename {scipy-notebook/test => tests/scipy-notebook}/test_matplotlib.py (100%) rename {scipy-notebook/test => tests/scipy-notebook}/units/unit_pandas.py (100%) rename {tensorflow-notebook/test => tests/tensorflow-notebook}/units/unit_tensorflow.py (100%) create mode 100644 tests/test_units.py diff --git a/.github/workflows/docker-amd64.yml b/.github/workflows/docker-amd64.yml index b853e4a4..f6305c16 100644 --- a/.github/workflows/docker-amd64.yml +++ b/.github/workflows/docker-amd64.yml @@ -19,9 +19,7 @@ on: - "tagging/**" - "test/**" - - "conftest.py" - "Makefile" - - "pytest.ini" - "requirements-dev.txt" push: branches: @@ -41,9 +39,7 @@ on: - "tagging/**" - "test/**" - - "conftest.py" - "Makefile" - - "pytest.ini" - "requirements-dev.txt" workflow_dispatch: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index be1d1eb0..1698c10c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,9 +19,7 @@ on: - "tagging/**" - "test/**" - - "conftest.py" - "Makefile" - - "pytest.ini" - "requirements-dev.txt" push: branches: @@ -41,9 +39,7 @@ on: - "tagging/**" - "test/**" - - "conftest.py" - "Makefile" - - "pytest.ini" - "requirements-dev.txt" workflow_dispatch: diff --git a/Makefile b/Makefile index 13673150..03dadc7a 100644 --- a/Makefile +++ b/Makefile @@ -205,9 +205,8 @@ run-sudo-shell/%: ## run a bash in interactive mode as root in a stack -test/%: ## run tests against a stack (only common tests or common tests + specific tests) +test/%: ## run tests against a stack @echo "::group::test/$(OWNER)/$(notdir $@)" - @if [ ! -d "$(notdir $@)/test" ]; then TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest --numprocesses=auto -m "not info" test; \ - else TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest --numprocesses=auto -m "not info" test $(notdir $@)/test; fi + tests/run_tests.py --short-image-name "$(notdir $@)" --owner "$(OWNER)" @echo "::endgroup::" test-all: $(foreach I, $(ALL_IMAGES), test/$(I)) ## test all stacks diff --git a/all-spark-notebook/.dockerignore b/all-spark-notebook/.dockerignore index 39be42a7..9dea340f 100644 --- a/all-spark-notebook/.dockerignore +++ b/all-spark-notebook/.dockerignore @@ -1,3 +1,2 @@ # Documentation README.md -test diff --git a/base-notebook/.dockerignore b/base-notebook/.dockerignore index 39be42a7..9dea340f 100644 --- a/base-notebook/.dockerignore +++ b/base-notebook/.dockerignore @@ -1,3 +1,2 @@ # Documentation README.md -test diff --git a/datascience-notebook/.dockerignore b/datascience-notebook/.dockerignore index 39be42a7..9dea340f 100644 --- a/datascience-notebook/.dockerignore +++ b/datascience-notebook/.dockerignore @@ -1,3 +1,2 @@ # Documentation README.md -test diff --git a/docs/contributing/tests.md b/docs/contributing/tests.md index 512b6088..87064a6a 100644 --- a/docs/contributing/tests.md +++ b/docs/contributing/tests.md @@ -1,34 +1,38 @@ # Image Tests -We greatly appreciate pull requests that extend the automated tests that vet the basic functionality -of the Docker images. +We greatly appreciate pull requests that extend the automated tests that vet the basic functionality of the Docker images. ## How the Tests Work GitHub Action executes `make build-test-all` against pull requests submitted to the `jupyter/docker-stacks` repository. -This `make` command builds every docker image. -After building each image, the `make` command executes `pytest` to run both image-specific tests like those in -[base-notebook/test/](https://github.com/jupyter/docker-stacks/tree/master/base-notebook/test) and -common tests defined in [test/](https://github.com/jupyter/docker-stacks/tree/master/test). -Both kinds of tests make use of global [pytest fixtures](https://docs.pytest.org/en/latest/reference/fixtures.html) -defined in the [conftest.py](https://github.com/jupyter/docker-stacks/blob/master/conftest.py) file at the root of the projects. +This `make` command builds and then tests every docker image. + +We use `pytest` module to run tests on the image. +`conftest.py` and `pytest.ini` in the `test` folder define the environment in which tests are run. +More info on `pytest` can be found [here](https://docs.pytest.org/en/latest/contents.html). + +All the actual test files are located in folders like `test/-notebook`. + +```{note} +If your test is located in `test/-notebook`, it will be run against `jupyter/-notebook` image and against all the images inherited from this image. +``` + +Many tests make use of global [pytest fixtures](https://docs.pytest.org/en/latest/reference/fixtures.html) +defined in the [conftest.py](https://github.com/jupyter/docker-stacks/blob/master/tests/conftest.py) file. ## Unit tests If you want to run a python script in one of our images, you could add a unit test. -You can do this by creating a `-notebook/test/units/` directory, if it doesn't already exist and put your file there. -File in this folder will run automatically when tests are run. -You could see an example for tensorflow package [here](https://github.com/jupyter/docker-stacks/blob/HEAD/tensorflow-notebook/test/units/unit_tensorflow.py). +You can do this by creating a `test/-notebook/units/` directory, if it doesn't already exist and put your file there. +Files in this folder will run automatically when tests are run. +You could see an example for tensorflow package [here](https://github.com/jupyter/docker-stacks/blob/HEAD/tests/tensorflow-notebook/units/unit_tensorflow.py). ## Contributing New Tests Please follow the process below to add new tests: -1. If the test should run against every image built, add your test code to one of the modules in - [test/](https://github.com/jupyter/docker-stacks/tree/master/test) or create a new module. -2. If your test should run against a single image, add your test code to one of the modules in - `some-notebook/test/` or create a new module. -3. Build one or more images you intend to test and run the tests locally. +1. Add your test code to one of the modules in `-notebook/tests/` directory or create a new module. +2. Build one or more images you intend to test and run the tests locally. If you use `make`, call: ```bash @@ -36,7 +40,7 @@ Please follow the process below to add new tests: make test/somestack-notebook ``` -4. [Submit a pull request](https://github.com/PointCloudLibrary/pcl/wiki/A-step-by-step-guide-on-preparing-and-submitting-a-pull-request) +3. [Submit a pull request](https://github.com/PointCloudLibrary/pcl/wiki/A-step-by-step-guide-on-preparing-and-submitting-a-pull-request) (PR) with your changes. -5. Watch for GitHub to report a build success or failure for your PR on GitHub. -6. Discuss changes with the maintainers and address any issues running the tests on GitHub. +4. Watch for GitHub to report a build success or failure for your PR on GitHub. +5. Discuss changes with the maintainers and address any issues running the tests on GitHub. diff --git a/minimal-notebook/.dockerignore b/minimal-notebook/.dockerignore index 39be42a7..9dea340f 100644 --- a/minimal-notebook/.dockerignore +++ b/minimal-notebook/.dockerignore @@ -1,3 +1,2 @@ # Documentation README.md -test diff --git a/pyspark-notebook/.dockerignore b/pyspark-notebook/.dockerignore index 39be42a7..9dea340f 100644 --- a/pyspark-notebook/.dockerignore +++ b/pyspark-notebook/.dockerignore @@ -1,3 +1,2 @@ # Documentation README.md -test diff --git a/r-notebook/.dockerignore b/r-notebook/.dockerignore index 39be42a7..9dea340f 100644 --- a/r-notebook/.dockerignore +++ b/r-notebook/.dockerignore @@ -1,3 +1,2 @@ # Documentation README.md -test diff --git a/scipy-notebook/.dockerignore b/scipy-notebook/.dockerignore index 39be42a7..9dea340f 100644 --- a/scipy-notebook/.dockerignore +++ b/scipy-notebook/.dockerignore @@ -1,3 +1,2 @@ # Documentation README.md -test diff --git a/tensorflow-notebook/.dockerignore b/tensorflow-notebook/.dockerignore index 39be42a7..9dea340f 100644 --- a/tensorflow-notebook/.dockerignore +++ b/tensorflow-notebook/.dockerignore @@ -1,3 +1,2 @@ # Documentation README.md -test diff --git a/test/README.md b/test/README.md deleted file mode 100644 index 3b32fc28..00000000 --- a/test/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Docker stacks testing - -We test our images using `pytest` module. - -`conftest.py` and `pytest.ini` in the root of our repository define the environment in which tests are run. -More info on pytest can be found [here](https://docs.pytest.org/en/latest/contents.html). - -There are two kinds of tests we use: - -- General tests - these are located in [this](https://github.com/jupyter/docker-stacks/blob/master/test) folder -- Image specific tests - for example, [base-notebook/test](https://github.com/jupyter/docker-stacks/blob/master/base-notebook/test) folder - -We also have a way to easily run arbitrary python files in a container. -This is useful for running unit tests of packages we use, so we put these files in `{image}/test/units` folder. -An example of such a test is [unit_pandas.py](https://github.com/jupyter/docker-stacks/blob/master/scipy-notebook/test/units/unit_pandas.py). diff --git a/test/test_units.py b/test/test_units.py deleted file mode 100644 index d9ed5329..00000000 --- a/test/test_units.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) Jupyter Development Team. -# Distributed under the terms of the Modified BSD License. - -import logging -from pathlib import Path - -from conftest import TrackedContainer - -LOGGER = logging.getLogger(__name__) -THIS_DIR = Path(__file__).parent.resolve() - - -def test_units(container: TrackedContainer) -> None: - """Various units tests - Add a py file in the {image}/test/units dir and it will be automatically tested - """ - short_image_name = container.image_name[container.image_name.rfind("/") + 1 :] - host_data_dir = THIS_DIR / f"../{short_image_name}/test/units" - LOGGER.info(f"Searching for units tests in {host_data_dir}") - cont_data_dir = "/home/jovyan/data" - - if not host_data_dir.exists(): - LOGGER.info(f"Not found unit tests for image: {container.image_name}") - return - - for test_file in host_data_dir.iterdir(): - test_file_name = test_file.name - LOGGER.info(f"Running unit test: {test_file_name}") - - container.run_and_wait( - timeout=30, - volumes={str(host_data_dir): {"bind": cont_data_dir, "mode": "ro"}}, - tty=True, - command=["start.sh", "python", f"{cont_data_dir}/{test_file_name}"], - ) diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000..a9f230dd --- /dev/null +++ b/tests/README.md @@ -0,0 +1,3 @@ +# Docker stacks testing + +Please, refer to the [corresponding section of documentation](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/tests.html) to see how the tests are run. diff --git a/all-spark-notebook/test/data/issue_1168.ipynb b/tests/all-spark-notebook/data/issue_1168.ipynb similarity index 100% rename from all-spark-notebook/test/data/issue_1168.ipynb rename to tests/all-spark-notebook/data/issue_1168.ipynb diff --git a/all-spark-notebook/test/data/local_pyspark.ipynb b/tests/all-spark-notebook/data/local_pyspark.ipynb similarity index 100% rename from all-spark-notebook/test/data/local_pyspark.ipynb rename to tests/all-spark-notebook/data/local_pyspark.ipynb diff --git a/all-spark-notebook/test/data/local_sparkR.ipynb b/tests/all-spark-notebook/data/local_sparkR.ipynb similarity index 100% rename from all-spark-notebook/test/data/local_sparkR.ipynb rename to tests/all-spark-notebook/data/local_sparkR.ipynb diff --git a/all-spark-notebook/test/data/local_sparklyr.ipynb b/tests/all-spark-notebook/data/local_sparklyr.ipynb similarity index 100% rename from all-spark-notebook/test/data/local_sparklyr.ipynb rename to tests/all-spark-notebook/data/local_sparklyr.ipynb diff --git a/all-spark-notebook/test/data/local_spylon.ipynb b/tests/all-spark-notebook/data/local_spylon.ipynb similarity index 100% rename from all-spark-notebook/test/data/local_spylon.ipynb rename to tests/all-spark-notebook/data/local_spylon.ipynb diff --git a/all-spark-notebook/test/test_spark_notebooks.py b/tests/all-spark-notebook/test_spark_notebooks.py similarity index 100% rename from all-spark-notebook/test/test_spark_notebooks.py rename to tests/all-spark-notebook/test_spark_notebooks.py diff --git a/base-notebook/test/test_container_options.py b/tests/base-notebook/test_container_options.py similarity index 100% rename from base-notebook/test/test_container_options.py rename to tests/base-notebook/test_container_options.py diff --git a/test/test_notebook.py b/tests/base-notebook/test_notebook.py similarity index 100% rename from test/test_notebook.py rename to tests/base-notebook/test_notebook.py diff --git a/test/test_outdated.py b/tests/base-notebook/test_outdated.py similarity index 100% rename from test/test_outdated.py rename to tests/base-notebook/test_outdated.py diff --git a/base-notebook/test/test_package_managers.py b/tests/base-notebook/test_package_managers.py similarity index 100% rename from base-notebook/test/test_package_managers.py rename to tests/base-notebook/test_package_managers.py diff --git a/test/test_packages.py b/tests/base-notebook/test_packages.py similarity index 100% rename from test/test_packages.py rename to tests/base-notebook/test_packages.py diff --git a/base-notebook/test/test_pandoc.py b/tests/base-notebook/test_pandoc.py similarity index 100% rename from base-notebook/test/test_pandoc.py rename to tests/base-notebook/test_pandoc.py diff --git a/base-notebook/test/test_python.py b/tests/base-notebook/test_python.py similarity index 100% rename from base-notebook/test/test_python.py rename to tests/base-notebook/test_python.py diff --git a/base-notebook/test/test_start_container.py b/tests/base-notebook/test_start_container.py similarity index 100% rename from base-notebook/test/test_start_container.py rename to tests/base-notebook/test_start_container.py diff --git a/conftest.py b/tests/conftest.py similarity index 100% rename from conftest.py rename to tests/conftest.py diff --git a/datascience-notebook/test/test_julia.py b/tests/datascience-notebook/test_julia.py similarity index 100% rename from datascience-notebook/test/test_julia.py rename to tests/datascience-notebook/test_julia.py diff --git a/tests/images_hierarchy.py b/tests/images_hierarchy.py new file mode 100644 index 00000000..f40abcf1 --- /dev/null +++ b/tests/images_hierarchy.py @@ -0,0 +1,30 @@ +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. +from pathlib import Path +from typing import Optional + +THIS_DIR = Path(__file__).parent.resolve() + + +ALL_IMAGES = { + "base-notebook": None, + "minimal-notebook": "base-notebook", + "scipy-notebook": "minimal-notebook", + "r-notebook": "minimal-notebook", + "tensorflow-notebook": "scipy-notebook", + "datascience-notebook": "scipy-notebook", + "pyspark-notebook": "scipy-notebook", + "all-spark-notebook": "pyspark-notebook", +} + + +def get_test_dirs( + short_image_name: Optional[str], +) -> list[Path]: + if short_image_name is None: + return [] # type: ignore + + test_dirs = get_test_dirs(ALL_IMAGES[short_image_name]) + if (current_image_tests_dir := THIS_DIR / short_image_name).exists(): + test_dirs.append(current_image_tests_dir) + return test_dirs diff --git a/minimal-notebook/test/data/Jupyter_logo.svg b/tests/minimal-notebook/data/Jupyter_logo.svg similarity index 100% rename from minimal-notebook/test/data/Jupyter_logo.svg rename to tests/minimal-notebook/data/Jupyter_logo.svg diff --git a/minimal-notebook/test/data/notebook_math.ipynb b/tests/minimal-notebook/data/notebook_math.ipynb similarity index 100% rename from minimal-notebook/test/data/notebook_math.ipynb rename to tests/minimal-notebook/data/notebook_math.ipynb diff --git a/minimal-notebook/test/data/notebook_svg.ipynb b/tests/minimal-notebook/data/notebook_svg.ipynb similarity index 100% rename from minimal-notebook/test/data/notebook_svg.ipynb rename to tests/minimal-notebook/data/notebook_svg.ipynb diff --git a/minimal-notebook/test/test_inkscape.py b/tests/minimal-notebook/test_inkscape.py similarity index 100% rename from minimal-notebook/test/test_inkscape.py rename to tests/minimal-notebook/test_inkscape.py diff --git a/minimal-notebook/test/test_nbconvert.py b/tests/minimal-notebook/test_nbconvert.py similarity index 100% rename from minimal-notebook/test/test_nbconvert.py rename to tests/minimal-notebook/test_nbconvert.py diff --git a/test/package_helper.py b/tests/package_helper.py similarity index 100% rename from test/package_helper.py rename to tests/package_helper.py diff --git a/pyspark-notebook/test/test_spark.py b/tests/pyspark-notebook/test_spark.py similarity index 100% rename from pyspark-notebook/test/test_spark.py rename to tests/pyspark-notebook/test_spark.py diff --git a/pyspark-notebook/test/units/unit_spark.py b/tests/pyspark-notebook/units/unit_spark.py similarity index 100% rename from pyspark-notebook/test/units/unit_spark.py rename to tests/pyspark-notebook/units/unit_spark.py diff --git a/pytest.ini b/tests/pytest.ini similarity index 100% rename from pytest.ini rename to tests/pytest.ini diff --git a/tests/run_tests.py b/tests/run_tests.py new file mode 100755 index 00000000..a7f9ac15 --- /dev/null +++ b/tests/run_tests.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. +import argparse +import logging +from pathlib import Path + +import plumbum +from plumbum.cmd import pytest + +from images_hierarchy import get_test_dirs + +THIS_DIR = Path(__file__).parent.resolve() + + +LOGGER = logging.getLogger(__name__) + + +def test_image(short_image_name: str, owner: str) -> None: + LOGGER.info(f"Testing image: {short_image_name}") + test_dirs = get_test_dirs(short_image_name) + LOGGER.info(f"Test dirs to be run: {test_dirs}") + with plumbum.local.env(TEST_IMAGE=f"{owner}/{short_image_name}"): + ( + pytest[ + "--numprocesses", + "auto", + "-m", + "not info", + THIS_DIR / "test_units.py", + test_dirs, + ] + & plumbum.FG + ) + + +if __name__ == "__main__": + logging.basicConfig(level=logging.INFO) + + arg_parser = argparse.ArgumentParser() + arg_parser.add_argument( + "--short-image-name", + required=True, + help="Short image name to run test on", + ) + arg_parser.add_argument("--owner", required=True, help="Owner of the image") + + args = arg_parser.parse_args() + + test_image(args.short_image_name, args.owner) diff --git a/scipy-notebook/test/data/matplotlib_1.py b/tests/scipy-notebook/data/matplotlib_1.py similarity index 100% rename from scipy-notebook/test/data/matplotlib_1.py rename to tests/scipy-notebook/data/matplotlib_1.py diff --git a/scipy-notebook/test/data/matplotlib_fonts_1.py b/tests/scipy-notebook/data/matplotlib_fonts_1.py similarity index 100% rename from scipy-notebook/test/data/matplotlib_fonts_1.py rename to tests/scipy-notebook/data/matplotlib_fonts_1.py diff --git a/scipy-notebook/test/test_extensions.py b/tests/scipy-notebook/test_extensions.py similarity index 100% rename from scipy-notebook/test/test_extensions.py rename to tests/scipy-notebook/test_extensions.py diff --git a/scipy-notebook/test/test_matplotlib.py b/tests/scipy-notebook/test_matplotlib.py similarity index 100% rename from scipy-notebook/test/test_matplotlib.py rename to tests/scipy-notebook/test_matplotlib.py diff --git a/scipy-notebook/test/units/unit_pandas.py b/tests/scipy-notebook/units/unit_pandas.py similarity index 100% rename from scipy-notebook/test/units/unit_pandas.py rename to tests/scipy-notebook/units/unit_pandas.py diff --git a/tensorflow-notebook/test/units/unit_tensorflow.py b/tests/tensorflow-notebook/units/unit_tensorflow.py similarity index 100% rename from tensorflow-notebook/test/units/unit_tensorflow.py rename to tests/tensorflow-notebook/units/unit_tensorflow.py diff --git a/tests/test_units.py b/tests/test_units.py new file mode 100644 index 00000000..1881db5e --- /dev/null +++ b/tests/test_units.py @@ -0,0 +1,39 @@ +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. + +import logging + +from conftest import TrackedContainer +from images_hierarchy import get_test_dirs + +LOGGER = logging.getLogger(__name__) + + +def test_units(container: TrackedContainer) -> None: + """Various units tests + Add a py file in the `test/{somestack}-notebook/units` dir and it will be automatically tested + """ + short_image_name = container.image_name[container.image_name.rfind("/") + 1 :] + LOGGER.info(f"Running unit tests for: {short_image_name}") + + test_dirs = get_test_dirs(short_image_name) + + for test_dir in test_dirs: + host_data_dir = test_dir / "units" + LOGGER.info(f"Searching for units tests in {host_data_dir}") + cont_data_dir = "/home/jovyan/data" + + if not host_data_dir.exists(): + LOGGER.info(f"Not found unit tests for image: {container.image_name}") + return + + for test_file in host_data_dir.iterdir(): + test_file_name = test_file.name + LOGGER.info(f"Running unit test: {test_file_name}") + + container.run_and_wait( + timeout=30, + volumes={str(host_data_dir): {"bind": cont_data_dir, "mode": "ro"}}, + tty=True, + command=["start.sh", "python", f"{cont_data_dir}/{test_file_name}"], + ) From cea692e4e4847b1c9e9ba666bda1a23bfc5bc638 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 17 Feb 2022 16:37:31 +0000 Subject: [PATCH 02/13] Rename --- .github/workflows/docker-amd64.yml | 4 ++-- .github/workflows/docker.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-amd64.yml b/.github/workflows/docker-amd64.yml index f6305c16..095f403c 100644 --- a/.github/workflows/docker-amd64.yml +++ b/.github/workflows/docker-amd64.yml @@ -18,7 +18,7 @@ on: - "tensorflow-notebook/**" - "tagging/**" - - "test/**" + - "tests/**" - "Makefile" - "requirements-dev.txt" push: @@ -38,7 +38,7 @@ on: - "tensorflow-notebook/**" - "tagging/**" - - "test/**" + - "tests**" - "Makefile" - "requirements-dev.txt" workflow_dispatch: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1698c10c..9034d5f5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -18,7 +18,7 @@ on: - "tensorflow-notebook/**" - "tagging/**" - - "test/**" + - "tests/**" - "Makefile" - "requirements-dev.txt" push: @@ -38,7 +38,7 @@ on: - "tensorflow-notebook/**" - "tagging/**" - - "test/**" + - "tests/**" - "Makefile" - "requirements-dev.txt" workflow_dispatch: From b4222a3062aceb0a4a7e2876e35c1fd721b9ff1f Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 17 Feb 2022 16:49:04 +0000 Subject: [PATCH 03/13] Update --- tests/base-notebook/test_packages.py | 19 +++++++++---------- tests/{ => base-notebook}/test_units.py | 0 tests/run_tests.py | 4 ---- 3 files changed, 9 insertions(+), 14 deletions(-) rename tests/{ => base-notebook}/test_units.py (100%) diff --git a/tests/base-notebook/test_packages.py b/tests/base-notebook/test_packages.py index 30d48211..169bdb1e 100644 --- a/tests/base-notebook/test_packages.py +++ b/tests/base-notebook/test_packages.py @@ -18,19 +18,18 @@ However it could be easily changed (or completed) to cover also dependencies `pa Example: - $ make test/datascience-notebook + $ make test/base-notebook # [...] # test/test_packages.py::test_python_packages - # --------------------------------------------------------------------------------------------- live log setup ---------------------------------------------------------------------------------------------- - # 2020-03-08 09:56:04 [ INFO] Starting container jupyter/datascience-notebook ... (package_helper.py:51) - # 2020-03-08 09:56:04 [ INFO] Running jupyter/datascience-notebook with args {'detach': True, 'ports': {'8888/tcp': 8888}, 'tty': True, 'command': ['start.sh', 'bash', '-c', 'sleep infinity']} ... (conftest.py:78) - # 2020-03-08 09:56:04 [ INFO] Grabing the list of manually requested packages ... (package_helper.py:76) - # ---------------------------------------------------------------------------------------------- live log call ---------------------------------------------------------------------------------------------- - # 2020-03-08 09:56:07 [ INFO] Testing the import of packages ... (test_packages.py:125) - # 2020-03-08 09:56:07 [ INFO] Trying to import conda (test_packages.py:127) - # 2020-03-08 09:56:07 [ INFO] Trying to import notebook (test_packages.py:127) - # 2020-03-08 09:56:08 [ INFO] Trying to import jupyterhub (test_packages.py:127) + # tests/base-notebook/test_packages.py::test_python_packages + # ---------------------------------------------------------------------------------------------- live log setup ---------------------------------------------------------------------------------------------- + # 2022-02-17 16:44:36 [ INFO] Starting container jupyter/base-notebook ... (package_helper.py:55) + # 2022-02-17 16:44:36 [ INFO] Running jupyter/base-notebook with args {'detach': True, 'tty': True, 'command': ['start.sh', 'bash', '-c', 'sleep infinity']} ... (conftest.py:95) + # 2022-02-17 16:44:37 [ INFO] Grabing the list of manually requested packages ... (package_helper.py:83) + # ---------------------------------------------------------------------------------------------- live log call ----------------------------------------------------------------------------------------------- + # 2022-02-17 16:44:38 [ INFO] Testing the import of packages ... (test_packages.py:144) + # 2022-02-17 16:44:38 [ INFO] Trying to import mamba (test_packages.py:146) # [...] """ diff --git a/tests/test_units.py b/tests/base-notebook/test_units.py similarity index 100% rename from tests/test_units.py rename to tests/base-notebook/test_units.py diff --git a/tests/run_tests.py b/tests/run_tests.py index a7f9ac15..664ebcc2 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -3,15 +3,12 @@ # Distributed under the terms of the Modified BSD License. import argparse import logging -from pathlib import Path import plumbum from plumbum.cmd import pytest from images_hierarchy import get_test_dirs -THIS_DIR = Path(__file__).parent.resolve() - LOGGER = logging.getLogger(__name__) @@ -27,7 +24,6 @@ def test_image(short_image_name: str, owner: str) -> None: "auto", "-m", "not info", - THIS_DIR / "test_units.py", test_dirs, ] & plumbum.FG From 448c973be3eeb93629e5434c356a244d70216eb2 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 17 Feb 2022 16:51:29 +0000 Subject: [PATCH 04/13] Fix --- Makefile | 2 +- docs/contributing/tests.md | 8 ++++---- tests/base-notebook/test_units.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 03dadc7a..f98bf318 100644 --- a/Makefile +++ b/Makefile @@ -113,7 +113,7 @@ build-all-multi: $(foreach I, $(MULTI_IMAGES), build-multi/$(I)) $(foreach I, $( check-outdated/%: ## check the outdated mamba/conda packages in a stack and produce a report (experimental) - @TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest test/test_outdated.py + @TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest tests/base-notebook/test_outdated.py check-outdated-all: $(foreach I, $(ALL_IMAGES), check-outdated/$(I)) ## check all the stacks for outdated packages diff --git a/docs/contributing/tests.md b/docs/contributing/tests.md index 87064a6a..bc563b89 100644 --- a/docs/contributing/tests.md +++ b/docs/contributing/tests.md @@ -8,13 +8,13 @@ GitHub Action executes `make build-test-all` against pull requests submitted to This `make` command builds and then tests every docker image. We use `pytest` module to run tests on the image. -`conftest.py` and `pytest.ini` in the `test` folder define the environment in which tests are run. +`conftest.py` and `pytest.ini` in the `tests` folder define the environment in which tests are run. More info on `pytest` can be found [here](https://docs.pytest.org/en/latest/contents.html). -All the actual test files are located in folders like `test/-notebook`. +All the actual test files are located in folders like `tests/-notebook`. ```{note} -If your test is located in `test/-notebook`, it will be run against `jupyter/-notebook` image and against all the images inherited from this image. +If your test is located in `tests/-notebook`, it will be run against `jupyter/-notebook` image and against all the images inherited from this image. ``` Many tests make use of global [pytest fixtures](https://docs.pytest.org/en/latest/reference/fixtures.html) @@ -23,7 +23,7 @@ defined in the [conftest.py](https://github.com/jupyter/docker-stacks/blob/maste ## Unit tests If you want to run a python script in one of our images, you could add a unit test. -You can do this by creating a `test/-notebook/units/` directory, if it doesn't already exist and put your file there. +You can do this by creating a `tests/-notebook/units/` directory, if it doesn't already exist and put your file there. Files in this folder will run automatically when tests are run. You could see an example for tensorflow package [here](https://github.com/jupyter/docker-stacks/blob/HEAD/tests/tensorflow-notebook/units/unit_tensorflow.py). diff --git a/tests/base-notebook/test_units.py b/tests/base-notebook/test_units.py index 1881db5e..b0d7af50 100644 --- a/tests/base-notebook/test_units.py +++ b/tests/base-notebook/test_units.py @@ -11,7 +11,7 @@ LOGGER = logging.getLogger(__name__) def test_units(container: TrackedContainer) -> None: """Various units tests - Add a py file in the `test/{somestack}-notebook/units` dir and it will be automatically tested + Add a py file in the `tests/{somestack}-notebook/units` dir and it will be automatically tested """ short_image_name = container.image_name[container.image_name.rfind("/") + 1 :] LOGGER.info(f"Running unit tests for: {short_image_name}") From 0a8ad5da33cf1265f2bcc0abc7ebcc727a52a233 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 17 Feb 2022 18:04:34 +0000 Subject: [PATCH 05/13] Fix bug --- tests/base-notebook/test_units.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/base-notebook/test_units.py b/tests/base-notebook/test_units.py index b0d7af50..e0d44cba 100644 --- a/tests/base-notebook/test_units.py +++ b/tests/base-notebook/test_units.py @@ -25,7 +25,7 @@ def test_units(container: TrackedContainer) -> None: if not host_data_dir.exists(): LOGGER.info(f"Not found unit tests for image: {container.image_name}") - return + continue for test_file in host_data_dir.iterdir(): test_file_name = test_file.name From 5d06f07b534276204fc9b6879ba46249e3509b63 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 18 Feb 2022 13:18:51 +0000 Subject: [PATCH 06/13] Update .github/workflows/docker-amd64.yml --- .github/workflows/docker-amd64.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-amd64.yml b/.github/workflows/docker-amd64.yml index 095f403c..c41084ed 100644 --- a/.github/workflows/docker-amd64.yml +++ b/.github/workflows/docker-amd64.yml @@ -38,7 +38,7 @@ on: - "tensorflow-notebook/**" - "tagging/**" - - "tests**" + - "tests/**" - "Makefile" - "requirements-dev.txt" workflow_dispatch: From 46615f7f9c714990c132a6c7aebe12e6cea82166 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 18 Feb 2022 13:20:06 +0000 Subject: [PATCH 07/13] Update docs/contributing/tests.md --- docs/contributing/tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/tests.md b/docs/contributing/tests.md index bc563b89..8669b0f6 100644 --- a/docs/contributing/tests.md +++ b/docs/contributing/tests.md @@ -11,7 +11,7 @@ We use `pytest` module to run tests on the image. `conftest.py` and `pytest.ini` in the `tests` folder define the environment in which tests are run. More info on `pytest` can be found [here](https://docs.pytest.org/en/latest/contents.html). -All the actual test files are located in folders like `tests/-notebook`. +All the actual test files are located in folders like `tests/-notebook/`. ```{note} If your test is located in `tests/-notebook`, it will be run against `jupyter/-notebook` image and against all the images inherited from this image. From 76269c681d3d866d53335ff78c8d4bc0ebf5a582 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 18 Feb 2022 13:23:31 +0000 Subject: [PATCH 08/13] Apply suggestions from code review --- docs/contributing/tests.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/contributing/tests.md b/docs/contributing/tests.md index 8669b0f6..dbb5bd7d 100644 --- a/docs/contributing/tests.md +++ b/docs/contributing/tests.md @@ -14,7 +14,7 @@ More info on `pytest` can be found [here](https://docs.pytest.org/en/latest/cont All the actual test files are located in folders like `tests/-notebook/`. ```{note} -If your test is located in `tests/-notebook`, it will be run against `jupyter/-notebook` image and against all the images inherited from this image. +If your test is located in `tests/-notebook/`, it will be run against `jupyter/-notebook` image and against all the images inherited from this image. ``` Many tests make use of global [pytest fixtures](https://docs.pytest.org/en/latest/reference/fixtures.html) @@ -24,14 +24,14 @@ defined in the [conftest.py](https://github.com/jupyter/docker-stacks/blob/maste If you want to run a python script in one of our images, you could add a unit test. You can do this by creating a `tests/-notebook/units/` directory, if it doesn't already exist and put your file there. -Files in this folder will run automatically when tests are run. +Files in this folder will be executed in container when tests are run. You could see an example for tensorflow package [here](https://github.com/jupyter/docker-stacks/blob/HEAD/tests/tensorflow-notebook/units/unit_tensorflow.py). ## Contributing New Tests Please follow the process below to add new tests: -1. Add your test code to one of the modules in `-notebook/tests/` directory or create a new module. +1. Add your test code to one of the modules in `tests/-notebook/` directory or create a new module. 2. Build one or more images you intend to test and run the tests locally. If you use `make`, call: From 87b6f94246e22a2d398f5e65643ad9d7853769ae Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 21 Feb 2022 13:25:42 +0000 Subject: [PATCH 09/13] Apply suggestions from code review Co-authored-by: Tania Allard --- docs/contributing/tests.md | 12 ++++++++---- tests/README.md | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/contributing/tests.md b/docs/contributing/tests.md index dbb5bd7d..e7b897c3 100644 --- a/docs/contributing/tests.md +++ b/docs/contributing/tests.md @@ -4,7 +4,11 @@ We greatly appreciate pull requests that extend the automated tests that vet the ## How the Tests Work -GitHub Action executes `make build-test-all` against pull requests submitted to the `jupyter/docker-stacks` repository. +A [GitHub Action workflow](https://github.com/jupyter/docker-stacks/blob/master/.github/workflows/docker.yml) +runs the following commands against pull requests submitted to the `jupyter/docker-stacks` repository: + +1. ` make -C main build-all-multi` - which builds all the Docker images +2. `make -C main test-all` - which tests the newly created Docker images This `make` command builds and then tests every docker image. We use `pytest` module to run tests on the image. @@ -14,7 +18,7 @@ More info on `pytest` can be found [here](https://docs.pytest.org/en/latest/cont All the actual test files are located in folders like `tests/-notebook/`. ```{note} -If your test is located in `tests/-notebook/`, it will be run against `jupyter/-notebook` image and against all the images inherited from this image. +If your test is located in `tests/-notebook/`, it will be run against `jupyter/-notebook` image and against all the [images inherited from this image](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#image-relationships. ``` Many tests make use of global [pytest fixtures](https://docs.pytest.org/en/latest/reference/fixtures.html) @@ -24,8 +28,8 @@ defined in the [conftest.py](https://github.com/jupyter/docker-stacks/blob/maste If you want to run a python script in one of our images, you could add a unit test. You can do this by creating a `tests/-notebook/units/` directory, if it doesn't already exist and put your file there. -Files in this folder will be executed in container when tests are run. -You could see an example for tensorflow package [here](https://github.com/jupyter/docker-stacks/blob/HEAD/tests/tensorflow-notebook/units/unit_tensorflow.py). +Files in this folder will be executed in the container when tests are run. +You could see an [example for the TensorFlow package here](https://github.com/jupyter/docker-stacks/blob/HEAD/tests/tensorflow-notebook/units/unit_tensorflow.py). ## Contributing New Tests diff --git a/tests/README.md b/tests/README.md index a9f230dd..b477e2d1 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,3 +1,3 @@ # Docker stacks testing -Please, refer to the [corresponding section of documentation](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/tests.html) to see how the tests are run. +Please, refer to the [testing section of documentation](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/tests.html) to see how the tests are run. From 75ad86fa9fe92a70e038564cd90523573aedd652 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Feb 2022 13:26:03 +0000 Subject: [PATCH 10/13] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/contributing/tests.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/contributing/tests.md b/docs/contributing/tests.md index e7b897c3..63b98b15 100644 --- a/docs/contributing/tests.md +++ b/docs/contributing/tests.md @@ -7,9 +7,9 @@ We greatly appreciate pull requests that extend the automated tests that vet the A [GitHub Action workflow](https://github.com/jupyter/docker-stacks/blob/master/.github/workflows/docker.yml) runs the following commands against pull requests submitted to the `jupyter/docker-stacks` repository: -1. ` make -C main build-all-multi` - which builds all the Docker images +1. `make -C main build-all-multi` - which builds all the Docker images 2. `make -C main test-all` - which tests the newly created Docker images -This `make` command builds and then tests every docker image. + This `make` command builds and then tests every docker image. We use `pytest` module to run tests on the image. `conftest.py` and `pytest.ini` in the `tests` folder define the environment in which tests are run. @@ -18,7 +18,7 @@ More info on `pytest` can be found [here](https://docs.pytest.org/en/latest/cont All the actual test files are located in folders like `tests/-notebook/`. ```{note} -If your test is located in `tests/-notebook/`, it will be run against `jupyter/-notebook` image and against all the [images inherited from this image](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#image-relationships. +If your test is located in `tests/-notebook/`, it will be run against `jupyter/-notebook` image and against all the [images inherited from this image](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#image-relationships. ``` Many tests make use of global [pytest fixtures](https://docs.pytest.org/en/latest/reference/fixtures.html) From 6ad4ae7112f2159b1129c15b8b6a032dde3377a4 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 21 Feb 2022 13:26:56 +0000 Subject: [PATCH 11/13] Update docs/contributing/tests.md --- docs/contributing/tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/tests.md b/docs/contributing/tests.md index 63b98b15..298dcdee 100644 --- a/docs/contributing/tests.md +++ b/docs/contributing/tests.md @@ -15,7 +15,7 @@ We use `pytest` module to run tests on the image. `conftest.py` and `pytest.ini` in the `tests` folder define the environment in which tests are run. More info on `pytest` can be found [here](https://docs.pytest.org/en/latest/contents.html). -All the actual test files are located in folders like `tests/-notebook/`. +The actual image-specific test files are located in folders like `tests/-notebook/`. ```{note} If your test is located in `tests/-notebook/`, it will be run against `jupyter/-notebook` image and against all the [images inherited from this image](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#image-relationships. From d22a074411114f1dde4db53e71e7f5f392317739 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 21 Feb 2022 13:28:49 +0000 Subject: [PATCH 12/13] Update images_hierarchy.py --- tests/images_hierarchy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/images_hierarchy.py b/tests/images_hierarchy.py index f40abcf1..093883e2 100644 --- a/tests/images_hierarchy.py +++ b/tests/images_hierarchy.py @@ -5,7 +5,8 @@ from typing import Optional THIS_DIR = Path(__file__).parent.resolve() - +# 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 = { "base-notebook": None, "minimal-notebook": "base-notebook", From 3088589c06b9572d343c1422161e74aca0a7e013 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 21 Feb 2022 16:17:26 +0000 Subject: [PATCH 13/13] Move matplotlib tests to specific folder --- tests/scipy-notebook/data/{ => matplotlib}/matplotlib_1.py | 0 .../scipy-notebook/data/{ => matplotlib}/matplotlib_fonts_1.py | 0 tests/scipy-notebook/test_matplotlib.py | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename tests/scipy-notebook/data/{ => matplotlib}/matplotlib_1.py (100%) rename tests/scipy-notebook/data/{ => matplotlib}/matplotlib_fonts_1.py (100%) diff --git a/tests/scipy-notebook/data/matplotlib_1.py b/tests/scipy-notebook/data/matplotlib/matplotlib_1.py similarity index 100% rename from tests/scipy-notebook/data/matplotlib_1.py rename to tests/scipy-notebook/data/matplotlib/matplotlib_1.py diff --git a/tests/scipy-notebook/data/matplotlib_fonts_1.py b/tests/scipy-notebook/data/matplotlib/matplotlib_fonts_1.py similarity index 100% rename from tests/scipy-notebook/data/matplotlib_fonts_1.py rename to tests/scipy-notebook/data/matplotlib/matplotlib_fonts_1.py diff --git a/tests/scipy-notebook/test_matplotlib.py b/tests/scipy-notebook/test_matplotlib.py index 471a1834..bf5aacbc 100644 --- a/tests/scipy-notebook/test_matplotlib.py +++ b/tests/scipy-notebook/test_matplotlib.py @@ -35,7 +35,7 @@ def test_matplotlib( - Test that matplotlib is able to plot a graph and write it as an image - Test matplotlib latex fonts, which depend on the cm-super package """ - host_data_dir = THIS_DIR / "data" + host_data_dir = THIS_DIR / "data/matplotlib" cont_data_dir = "/home/jovyan/data" output_dir = "/tmp" LOGGER.info(description)