Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Notebook Tests in Parallel GitHub Workflow Runs #307

Closed
ckunki opened this issue Jul 19, 2024 · 1 comment · Fixed by #312
Closed

Run Notebook Tests in Parallel GitHub Workflow Runs #307

ckunki opened this issue Jul 19, 2024 · 1 comment · Fixed by #312
Assignees
Labels
refactoring Code improvement without behavior change

Comments

@ckunki
Copy link
Contributor

ckunki commented Jul 19, 2024

Enable to run Notebook Tests in Parallel GitHub Workflow Runs.

Currently,

  • executing the tests for all Jupyter Notebooks inside the AI-Lab take very long.
  • Some notebook tests are disabled:

Sub Tasks

  • Implement a Nox task enumerating all notebook tests and returning a build matrix in JSON format
  • Add support for a CLI parameter enabling to execute only the specified notebook test
  • Change the GitHub workflow to
    • call the Nox task
    • build a dynamic build matrix
    • use the CLI parameter accordingly
  • Re-enable the disabled notebook tests named above

Enhancing notebook_test_runner.test_notebook()

  • By default execute all test
  • If CLI parameter is specified then only execute the selected test case
@ckunki ckunki added the refactoring Code improvement without behavior change label Jul 19, 2024
@ckunki ckunki changed the title Parallel Notebook Tests in GitHub Actions Run Notebook Tests in Parallel GitHub Workflow Runs Jul 19, 2024
@tkilias
Copy link
Collaborator

tkilias commented Jul 19, 2024

Suggestion for the parameterized fixture with cli parameter

@fixture(scope="module", params=[
    python_file.name
    for python_file in sorted(TEST_RESOURCE_PATH.glob("nbtest_*.py"))
    if python_file.is_file()
    ])
def notebook_test_file(request):
    if request.options.get("cli-parameter") == request.param:
        return request.param
    else:
        pytest.skip("Test disabled")


def test_notebook(notebook_test_container_with_log, notebook_test_file):
    ...

@ahsimb ahsimb self-assigned this Jul 26, 2024
ahsimb added a commit that referenced this issue Jul 29, 2024
ahsimb added a commit that referenced this issue Jul 29, 2024
ahsimb added a commit that referenced this issue Jul 29, 2024
ahsimb added a commit that referenced this issue Jul 29, 2024
ahsimb added a commit that referenced this issue Jul 30, 2024
ahsimb added a commit that referenced this issue Jul 30, 2024
ahsimb added a commit that referenced this issue Jul 30, 2024
* #307 Made each notebook test a separate job

* #307 Made each notebook test a separate job

* #307 Made each notebook test a separate job

* #307 Made each notebook test a separate job

* #307 Made each notebook test a separate job

* #307 Removed conftest.py

* #307 Changed run syntax

* #307 Restored conftest.py

* #307 Restored conftest.py

* #307 Added the rest of the notebook tests

* [code build]

* [CodeBuild]

* [CodeBuild]

* #307 Turned the notebook tests into a matrix

* #307 [CodeBuild]

* #307 Updated the changelog [CodeBuild]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code improvement without behavior change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants