sktime icon indicating copy to clipboard operation
sktime copied to clipboard

[BUG] Running `make test` adds untracked files/folders to sktime directory

Open RecreationalMath opened this issue 1 year ago • 9 comments

Describe the bug

When running the tests using the make test command on local. Untracked dataset folders/files are getting created/downloaded.

To Reproduce

Run make test in the terminal.

make test

git status will show the following additions to the sktime directory:

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        UnitTest/
        sktime/datasets/data/australian_electricity_demand_dataset/
        sktime/datasets/data/m4_hourly_dataset/
        sktime/datasets/data/solar_10_minutes_dataset/
        sktime/datasets/data/wind_4_seconds_dataset/

Expected behavior If no changes have been made to dataset class, tests downloading these files from the internet should not run.

RecreationalMath avatar Sep 29 '25 10:09 RecreationalMath

Thanks for reporting!

I suspect this relates to the loaders @jgyasu added recently. I think they should be decorated with pytest.mark.datadownload, in this case the tests should be skipped, unless tests for downloaders are explicitly requested.

fkiraly avatar Sep 29 '25 20:09 fkiraly

I suspect this relates to the loaders @jgyasu added recently.

I experienced the same even before writing the new loaders, I think we simply missed adding the decorator to this test.

jgyasu avatar Sep 30 '25 10:09 jgyasu

hm, which tests? We need to identify which tests downloads the files, and why they are triggered by the make test full run.

fkiraly avatar Sep 30 '25 13:09 fkiraly

hm, which tests?

Ah, my bad! I meant the tests, not this test, we need to identify them.

jgyasu avatar Sep 30 '25 13:09 jgyasu

Can i take this issue up

Nishthajain7 avatar Oct 17 '25 15:10 Nishthajain7

Can i take this issue up

Sure! You will need to identify the particular tests which download these files as make test run the entire test suite. I suspect these tests should be in sktime/datasets.

jgyasu avatar Oct 17 '25 15:10 jgyasu

Should I use git-based detection to check if any changes have been made to the dataset?

Nishthajain7 avatar Oct 17 '25 19:10 Nishthajain7

Hi everyone, while going through, I found these responsible tests: test_load_forecastingdata test_load_forecastingdata_hier However, they already have @pytest.mark.datadownload, yet running them still leaves the repository with the four untracked dataset directories: sktime/datasets/data/australian_electricity_demand_dataset/ sktime/datasets/data/m4_hourly_dataset/ sktime/datasets/data/solar_10_minutes_dataset/ sktime/datasets/data/wind_4_seconds_dataset/

I also noticed that the dataset CI workflow already separates datadownload tests (-m "datadownload" / -m "not datadownload"), whereas make test runs all tests without a marker filter. Any suggestions, how to proceed?

vortex-wq avatar Jul 25 '26 15:07 vortex-wq

Current main still has this problem. The download tests are already marked with pytest.mark.datadownload, but the Makefile test target runs python -m pytest without a marker expression. A pytest marker classifies tests; it does not skip them by default. The dataset CI already demonstrates the intended split with -m "not datadownload" and -m "datadownload".

I am preparing a focused fix: the default make test target will pass -m "not datadownload", while full_test will stay unchanged as the explicit all-tests path. I verified that the exclusion deselects all 15 tests in test_datadownload.py, while explicit datadownload selection still collects all 15. I will keep the PR limited to the Makefile unless maintainers prefer a dedicated target.

@Nishthajain7 and @vortex-wq, this builds on your earlier investigation. Please say if either of you already has work in progress so I do not duplicate it.

Namit1208 avatar Oct 19 '26 17:10 Namit1208