Skip to content

Commit

Permalink
Workflows improvements (#155)
Browse files Browse the repository at this point in the history
* Faster PR tests, scheduled full tests

* cleanup

* bugfixing

* more slow tests
  • Loading branch information
bcebere authored Mar 24, 2023
1 parent 6ed0be4 commit 9cf13e4
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 6 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/test_full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tests Full Python

on:
schedule:
- cron: '4 2 * * 3'

jobs:
Library:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: gautamkrishnar/keepalive-workflow@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install MacOS dependencies
run: |
brew install libomp
if: ${{ matrix.os == 'macos-latest' }}
- name: Install dependencies
run: |
pip install -r prereq.txt
pip install --upgrade pip
pip install .[testing]
- name: Test with pytest
run: pytest -vvvs --durations=50
10 changes: 4 additions & 6 deletions .github/workflows/test.yml → .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: Tests Python
name: Tests PR Python

on:
push:
branches: [main, release]
pull_request:
types: [opened, synchronize, reopened]
schedule:
- cron: '4 2 * * 3'


jobs:
Linter:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8]
python-version: ['3.10']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
Expand All @@ -38,7 +36,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.10']
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
Expand All @@ -61,4 +59,4 @@ jobs:
pip install --upgrade pip
pip install .[testing]
- name: Test with pytest
run: pytest -vvvsx -m "not slow" --durations=50
run: pytest -vvvs -m "not slow" --durations=50
1 change: 1 addition & 0 deletions tests/metrics/test_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def test_detect_synth_timeseries(test_plugin: Plugin, evaluator_t: Type) -> None
assert evaluator.direction() == "minimize"


@pytest.mark.slow
def test_image_support_detection() -> None:
dataset = datasets.MNIST(".", download=True)

Expand Down
1 change: 1 addition & 0 deletions tests/metrics/test_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ def test_evaluate_performance_time_series_survival(
assert def_score == good_score["syn_id.c_index"] - good_score["syn_id.brier_score"]


@pytest.mark.slow
def test_image_support_perf() -> None:
dataset = datasets.MNIST(".", download=True)

Expand Down
1 change: 1 addition & 0 deletions tests/plugins/generic/test_ctgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def gen_datetime(min_year: int = 2000, max_year: int = datetime.now().year) -> d
return start + (end - start) * random.random()


@pytest.mark.slow
def test_plugin_encoding() -> None:
data = [[gen_datetime(), i % 2 == 0, i] for i in range(1000)]

Expand Down
2 changes: 2 additions & 0 deletions tests/plugins/images/test_image_adsgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def test_plugin_generate() -> None:
assert len(X_gen) == 50


@pytest.mark.slow
def test_plugin_generate_with_conditional() -> None:
test_plugin = plugin(n_iter=10, n_units_latent=13)

Expand All @@ -70,6 +71,7 @@ def test_plugin_generate_with_conditional() -> None:
assert len(X_gen) == 50


@pytest.mark.slow
def test_plugin_generate_with_stop_conditional() -> None:
test_plugin = plugin(n_iter=10, n_units_latent=13, n_iter_print=2)

Expand Down
2 changes: 2 additions & 0 deletions tests/plugins/images/test_image_cgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def test_plugin_hyperparams(test_plugin: Plugin) -> None:


@pytest.mark.parametrize("height", [32, 64, 128])
@pytest.mark.slow
def test_plugin_fit(height: int) -> None:
test_plugin = plugin(n_iter=5)

Expand Down Expand Up @@ -71,6 +72,7 @@ def test_plugin_generate_with_conditional() -> None:
assert len(X_gen) == 50


@pytest.mark.slow
def test_plugin_generate_with_stop_conditional() -> None:
test_plugin = plugin(n_iter=10, n_units_latent=13, n_iter_print=2)

Expand Down

0 comments on commit 9cf13e4

Please sign in to comment.