Skip to content

Commit 9cf13e4

Browse files
authored
Workflows improvements (#155)
* Faster PR tests, scheduled full tests * cleanup * bugfixing * more slow tests
1 parent 6ed0be4 commit 9cf13e4

File tree

7 files changed

+46
-6
lines changed

7 files changed

+46
-6
lines changed

.github/workflows/test_full.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Tests Full Python
2+
3+
on:
4+
schedule:
5+
- cron: '4 2 * * 3'
6+
7+
jobs:
8+
Library:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
python-version: ['3.7', '3.8', '3.9', '3.10']
13+
os: [macos-latest, ubuntu-latest, windows-latest]
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
submodules: true
18+
- uses: gautamkrishnar/keepalive-workflow@v1
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
cache: 'pip' # caching pip dependencies
24+
- name: Install MacOS dependencies
25+
run: |
26+
brew install libomp
27+
if: ${{ matrix.os == 'macos-latest' }}
28+
- name: Install dependencies
29+
run: |
30+
pip install -r prereq.txt
31+
32+
pip install --upgrade pip
33+
pip install .[testing]
34+
- name: Test with pytest
35+
run: pytest -vvvs --durations=50
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
name: Tests Python
1+
name: Tests PR Python
22

33
on:
44
push:
55
branches: [main, release]
66
pull_request:
77
types: [opened, synchronize, reopened]
8-
schedule:
9-
- cron: '4 2 * * 3'
108

119

1210
jobs:
1311
Linter:
1412
runs-on: ${{ matrix.os }}
1513
strategy:
1614
matrix:
17-
python-version: [3.8]
15+
python-version: ['3.10']
1816
os: [ubuntu-latest]
1917
steps:
2018
- uses: actions/checkout@v2
@@ -38,7 +36,7 @@ jobs:
3836
runs-on: ${{ matrix.os }}
3937
strategy:
4038
matrix:
41-
python-version: ['3.7', '3.8', '3.9', '3.10']
39+
python-version: ['3.10']
4240
os: [macos-latest, ubuntu-latest, windows-latest]
4341
steps:
4442
- uses: actions/checkout@v2
@@ -61,4 +59,4 @@ jobs:
6159
pip install --upgrade pip
6260
pip install .[testing]
6361
- name: Test with pytest
64-
run: pytest -vvvsx -m "not slow" --durations=50
62+
run: pytest -vvvs -m "not slow" --durations=50

tests/metrics/test_detection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def test_detect_synth_timeseries(test_plugin: Plugin, evaluator_t: Type) -> None
154154
assert evaluator.direction() == "minimize"
155155

156156

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

tests/metrics/test_performance.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ def test_evaluate_performance_time_series_survival(
466466
assert def_score == good_score["syn_id.c_index"] - good_score["syn_id.brier_score"]
467467

468468

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

tests/plugins/generic/test_ctgan.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ def gen_datetime(min_year: int = 2000, max_year: int = datetime.now().year) -> d
169169
return start + (end - start) * random.random()
170170

171171

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

tests/plugins/images/test_image_adsgan.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def test_plugin_generate() -> None:
5757
assert len(X_gen) == 50
5858

5959

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

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

7273

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

tests/plugins/images/test_image_cgan.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def test_plugin_hyperparams(test_plugin: Plugin) -> None:
3535

3636

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

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

7374

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

0 commit comments

Comments
 (0)