Skip to content

Commit

Permalink
Skip some tests automatically in Github actions (#558)
Browse files Browse the repository at this point in the history
* add skipif

* finally add skipif for datasets and timesfm

* add lambda to large params

* minor fix

* remove skipif for inference tests

* fix raised error message

* fix condition in skipif

---------

Co-authored-by: Egor Baturin <[email protected]>
  • Loading branch information
egoriyaa and Egor Baturin authored Jan 15, 2025
1 parent af81857 commit 620e096
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 137 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Test

env:
skip_large_tests: true

on:
push:
branches:
Expand Down
66 changes: 50 additions & 16 deletions tests/test_datasets/test_internal_datasets.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json
import os
import shutil

import numpy as np
Expand Down Expand Up @@ -87,7 +89,9 @@ def test_not_present_part():
pd.to_datetime("2011-01-01 00:15:00"),
pd.to_datetime("2015-01-01 00:00:00"),
("train", "test"),
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
(
"m4_hourly",
Expand All @@ -102,7 +106,9 @@ def test_not_present_part():
0,
9932,
("train", "test"),
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
(
"m4_weekly",
Expand All @@ -117,7 +123,9 @@ def test_not_present_part():
0,
2811,
("train", "test"),
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
(
"m4_quarterly",
Expand All @@ -139,23 +147,29 @@ def test_not_present_part():
pd.to_datetime("2008-01-01 00:00:00"),
pd.to_datetime("2009-03-30 23:50:00"),
("train", "test"),
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
pytest.param(
"traffic_2008_hourly",
(10896 + 24, 963),
pd.to_datetime("2008-01-01 00:00:00"),
pd.to_datetime("2009-03-30 23:00:00"),
("train", "test"),
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
pytest.param(
"traffic_2015_hourly",
(17520 + 24, 862),
pd.to_datetime("2015-01-01 00:00:00"),
pd.to_datetime("2016-12-31 23:00:00"),
("train", "test"),
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
(
"m3_monthly",
Expand Down Expand Up @@ -212,7 +226,9 @@ def test_not_present_part():
pd.to_datetime("2020-01-01 00:10:00"),
pd.to_datetime("2021-01-01 00:00:00"),
("train", "test"),
marks=pytest.mark.skip(reason="There is a problem with certificates during loading the dataset."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
(
"ETTm1",
Expand Down Expand Up @@ -248,7 +264,9 @@ def test_not_present_part():
pd.to_datetime("2006-12-16 17:24:00"),
pd.to_datetime("2010-11-26 21:02:00"),
tuple(),
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
(
"australian_wine_sales_monthly",
Expand Down Expand Up @@ -364,31 +382,43 @@ def test_list_datasets():
[
pytest.param(
"electricity_15T",
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
"m4_hourly",
pytest.param(
"m4_daily",
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
"m4_weekly",
pytest.param(
"m4_monthly",
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
"m4_quarterly",
"m4_yearly",
pytest.param(
"traffic_2008_10T",
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
pytest.param(
"traffic_2008_hourly",
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
pytest.param(
"traffic_2015_hourly",
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
"m3_monthly",
"m3_quarterly",
Expand All @@ -399,15 +429,19 @@ def test_list_datasets():
"tourism_yearly",
pytest.param(
"weather_10T",
marks=pytest.mark.skip(reason="There is a problem with certificates during loading the dataset."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
"ETTm1",
"ETTm2",
"ETTh1",
"ETTh2",
pytest.param(
"IHEPC_T",
marks=pytest.mark.skip(reason="Dataset is too large for testing in GitHub."),
marks=pytest.mark.skipif(
json.loads(os.getenv("skip_large_tests", "false")), reason="Dataset is too large for testing in GitHub."
),
),
"australian_wine_sales_monthly",
],
Expand Down
Loading

0 comments on commit 620e096

Please sign in to comment.