diff --git a/.github/workflows/run-notebook-tests.yml b/.github/workflows/run-notebook-tests.yml index 85906f48ac9..8686d74d828 100644 --- a/.github/workflows/run-notebook-tests.yml +++ b/.github/workflows/run-notebook-tests.yml @@ -39,6 +39,4 @@ jobs: python setup.py install - name: Test with pytest run: | - git diff --name-only ${{ github.base_ref }} examples/tutorials/translations/ examples/tutorials/translations/ > ./test/notebooks/git-diff.txt - pytest test/notebooks/test_notebooks.py::test_notebooks_basic_translations_diff - [ -e ./test/notebooks/git-diff.txt ] && rm ./test/notebooks/git-diff.txt + pytest test/notebooks/test_notebooks.py::test_notebooks_basic_translations diff --git a/test/notebooks/git-diff.txt b/test/notebooks/git-diff.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/notebooks/test_notebooks.py b/test/notebooks/test_notebooks.py index 6e3c7017c32..e8341324057 100644 --- a/test/notebooks/test_notebooks.py +++ b/test/notebooks/test_notebooks.py @@ -5,7 +5,6 @@ import urllib.request from pathlib import Path from zipfile import ZipFile -import codecs import pytest import nbformat @@ -33,21 +32,6 @@ Path(nb).name for part in ["10", "13b", "13c"] for nb in translated_notebooks if part in nb ] - -# Include only the translations that have been changed -gitdiff = Path("test/notebooks/git-diff.txt") -changed_files = [] -if gitdiff.is_file(): - changed_files = open(gitdiff, "r") - changed_files = changed_files.readlines() - changed_files = [ - codecs.decode(file.replace('"', "").replace("\n", ""), "unicode-escape") - .encode("latin-1") - .decode() - for file in changed_files - ] -translated_notebooks_diff = list(set(changed_files) & set(translated_notebooks)) - # buggy notebooks with explanation what does not work exclusion_list_notebooks = [ # Part 10 needs either torch.log2 to be implemented or numpy to be hooked @@ -123,30 +107,6 @@ def test_notebooks_basic_translations(isolated_filesystem, translated_notebook): assert isinstance(res, nbformat.notebooknode.NotebookNode) -@pytest.mark.parametrize( - "translated_notebook", sorted(set(translated_notebooks_diff) - set(excluded_notebooks)) -) -def test_notebooks_basic_translations_diff( - isolated_filesystem, translated_notebook -): # pragma: no cover - """ - Test Notebooks in the tutorial translations folder if they have been - modified in the current pull request. This test should not consider any - notebooks locally. It should be used on Github Actions. - """ - notebook = "/".join(translated_notebook.split("/")[-2:]) - notebook = f"translations/{notebook}" - list_name = Path(f"examples/tutorials/{notebook}") - tested_notebooks.append(str(list_name)) - res = pm.execute_notebook( - notebook, - "/dev/null", - parameters={"epochs": 1, "n_test_batches": 5, "n_train_items": 64, "n_test_items": 64}, - timeout=300, - ) - assert isinstance(res, nbformat.notebooknode.NotebookNode) - - @pytest.mark.parametrize("notebook", sorted(set(advanced_notebooks) - set(excluded_notebooks))) def test_notebooks_advanced(isolated_filesystem, notebook): notebook = notebook.replace("examples/tutorials/", "")