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

Functional tests for MNIST #87

Merged
merged 9 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"threshold": 2.0,
"ignore": [
"**/itwinai/backend/loggers.py"
"**/itwinai/loggers.py"
]
}
6 changes: 5 additions & 1 deletion .github/workflows/workflows-dt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ jobs:
shell: bash -l {0}
run: make torch-cpu

- name: Make tensorflow env
shell: bash -l {0}
run: make tf-2.13

- name: Install dev version
shell: bash -l {0}
run: micromamba run -p ./.venv-pytorch pip install .[dev]

- name: Run pytest for workflows
shell: bash -l {0}
run: micromamba run -p ./.venv-pytorch pytest -v ./tests/ -m "not distributed"
run: micromamba run -p ./.venv-pytorch pytest -v ./tests/ -m "not slurm"

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TODO
data
/data
nohup*
lightning_logs
mlruns
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,25 @@ adding the `dev` extra:
pip install -e .[dev]
```

To **run tests** on itwinai package:
#### Test with `pytest`

To run tests on itwinai package:

```bash
# Activate env
micromamba activate ./.venv-pytorch # or ./.venv-tf

pytest -v tests/
pytest -v -m "not slurm" tests/
```

However, some tests are intended to be executed only on an HPC system,
where SLURM is available. They are marked with "slurm" tag. To run also
those tests, use the dedicated job script:

```bash
sbatch tests/slurm_tests_startscript

# Upon completion, check the output:
cat job.err
cat job.out
```
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@ itwinai = "itwinai.cli:app"
[tool.pytest.ini_options]
markers = [
"integration: integration tests (deselect with '-m \"not integration\"')",
"distributed: test distributed ML on multiple GPUs/nodes (deselect with '-m \"not distributed\"')",
"slurm: needs SLURM and HPC resources (multiple GPUs/nodes). (deselect with '-m \"not slurm\"')",
"functional: functional tests. (deselect with '-m \"not functional\"')",
]
24 changes: 0 additions & 24 deletions src/itwinai/backend/torch/_utils.py

This file was deleted.

13 changes: 0 additions & 13 deletions src/itwinai/backend/utils.py

This file was deleted.

Loading
Loading