Skip to content

Commit

Permalink
moved test folder, added coverage config, added coverage report uploa…
Browse files Browse the repository at this point in the history
…d step in workflow
  • Loading branch information
1p0d committed Jan 15, 2024
1 parent 390dde5 commit 17d6cb0
Show file tree
Hide file tree
Showing 58 changed files with 22 additions and 7 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[run]
omit =
*__init__*
*/tests/*

[html]
omit =
*__init__*
*/tests/*
12 changes: 9 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ jobs:
pip install -r requirements.txt
- name: Test with pytest
run: |
pip install pytest coverage
coverage run -m pytest project_winegrape_src_files/tests/
coverage report -m
coverage run -m pytest tests/
coverage html --title="DTU 02476 Group 100 Project Coverage Report"
- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
2 changes: 1 addition & 1 deletion project_winegrape_src_files/conf/test_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ reproducibility:
seed: 123

data:
dir: "project_winegrape_src_files/tests/test_data/raw/grapevine-leaves-image-dataset/Grapevine_Leaves_Image_Dataset"
dir: "tests/test_data/raw/grapevine-leaves-image-dataset/Grapevine_Leaves_Image_Dataset"
transform_level: "light"
batch_size: 32
val_split: 0.2
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os

def test_config() -> None:
with initialize(version_base=None, config_path="../conf"):
with initialize(version_base=None, config_path="../project_winegrape_src_files/conf"):
test_cfg = compose(config_name="test_config")
# assert top level keys
assert "reproducibility" in test_cfg.keys()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from ..data.data import DataModule
from project_winegrape_src_files.data.data import DataModule
from hydra import initialize, compose

def test_data():
with initialize(version_base=None, config_path="../conf"):
with initialize(version_base=None, config_path="../project_winegrape_src_files/conf"):
test_cfg = compose(config_name="test_config")
data_module = DataModule(
data_dir=test_cfg.data.dir,
Expand Down

0 comments on commit 17d6cb0

Please sign in to comment.