Skip to content

Commit

Permalink
Run tests marked with notebook marker in examples workflow (#1146)
Browse files Browse the repository at this point in the history
* Run tf notebook tests if tf-examples

* same for gpu tests

* trigger example tests

* Same for 'chagned' workflows

* change marker: example -> examples

* more example -> examples
  • Loading branch information
edknv authored Jun 14, 2023
1 parent 92833fa commit 07826b8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if [[ "${{ github.ref }}" != 'refs/heads/main' ]]; then
extra_pytest_markers="and changed"
fi
cd ${{ github.workspace }}; PYTEST_MARKERS="unit and not (example or integration) $extra_pytest_markers" MERLIN_BRANCH=$branch COMPARE_BRANCH=${{ github.base_ref }} tox -e py38-gpu
cd ${{ github.workspace }}; PYTEST_MARKERS="unit and not (examples or integration or notebook) $extra_pytest_markers" MERLIN_BRANCH=$branch COMPARE_BRANCH=${{ github.base_ref }} tox -e py38-gpu
tests-examples:
runs-on: 1GPU
Expand All @@ -55,4 +55,4 @@ jobs:
if [[ "${{ github.ref }}" != 'refs/heads/main' ]]; then
extra_pytest_markers="and changed"
fi
cd ${{ github.workspace }}; PYTEST_MARKERS="example $extra_pytest_markers" MERLIN_BRANCH=$branch COMPARE_BRANCH=${{ github.base_ref }} tox -e py38-gpu
cd ${{ github.workspace }}; PYTEST_MARKERS="(examples or notebook) $extra_pytest_markers" MERLIN_BRANCH=$branch COMPARE_BRANCH=${{ github.base_ref }} tox -e py38-gpu
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ tests-changed:
coverage html --include 'merlin/models/*'

tests-tf:
coverage run -m pytest --durations=100 --dist=loadfile --numprocesses=auto -rsx tests -m "tensorflow and not (integration or example)" || exit 1
coverage run -m pytest --durations=100 --dist=loadfile --numprocesses=auto -rsx tests -m "tensorflow and not (integration or examples or notebook)" || exit 1
coverage report --include 'merlin/models/*'
coverage html --include 'merlin/models/*'

tests-tf-examples:
coverage run -m pytest -rsx tests -m "tensorflow and example" || exit 1
coverage run -m pytest -rsx tests -m "tensorflow and (examples or notebook)" || exit 1
coverage report --include 'merlin/models/*'
coverage html --include 'merlin/models/*'

Expand All @@ -37,12 +37,12 @@ tests-tf-integration:
coverage html --include 'merlin/models/*'

tests-tf-changed:
coverage run -m pytest --durations=100 --dist=loadfile --numprocesses=auto -rsx tests -m "tensorflow and changed and not (integration or example) or always" || exit 1
coverage run -m pytest --durations=100 --dist=loadfile --numprocesses=auto -rsx tests -m "tensorflow and changed and not (integration or examples or notebook) or always" || exit 1
coverage report --include 'merlin/models/*'
coverage html --include 'merlin/models/*'

tests-tf-examples-changed:
coverage run -m pytest -rsx tests -m "tensorflow and changed and example" || exit 1
coverage run -m pytest -rsx tests -m "tensorflow and changed and (examples or notebook)" || exit 1
coverage report --include 'merlin/models/*'
coverage html --include 'merlin/models/*'

Expand Down Expand Up @@ -121,4 +121,4 @@ docs:
cd docs/build/html/ && python -m http.server


.PHONY: install tests lint tests-tf tests-tf-examples tests-torch tests-implicit tests-lightfm tests-datasets dist clean docstrings docs
.PHONY: install tests lint tests-tf tests-tf-examples tests-torch tests-implicit tests-lightfm tests-datasets dist clean docstrings docs
2 changes: 1 addition & 1 deletion examples/01-Getting-started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Copyright 2022 NVIDIA Corporation. All Rights Reserved.\n",
"# Copyright 2023 NVIDIA Corporation. All Rights Reserved.\n",
"#\n",
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n",
"# you may not use this file except in compliance with the License.\n",
Expand Down
2 changes: 1 addition & 1 deletion merlin/models/utils/ci_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"lightfm": "lightfm",
"xgb": "xgboost",
}
OTHER_MARKERS = {"unit", "integration", "example", "datasets", "horovod", "transformers"}
OTHER_MARKERS = {"unit", "integration", "examples", "datasets", "horovod", "transformers"}
SHARED_MODULES = {
"/datasets/",
"/models/config/",
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
markers =
version: mark as testing the version number
notebook: mark as testing notebooks
example: mark as testing examples
examples: mark as testing examples
datasets: mark as testing datasets
integration: mark as an integration test
unit: mark as a unit test
Expand Down

0 comments on commit 07826b8

Please sign in to comment.