Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not leave files after running unit tests #447

Closed
mfeurer opened this issue Apr 20, 2018 · 7 comments
Closed

Do not leave files after running unit tests #447

mfeurer opened this issue Apr 20, 2018 · 7 comments
Assignees
Labels
Good First Issue Issues suitable for people new to contributing to openml-python!

Comments

@mfeurer
Copy link
Collaborator

mfeurer commented Apr 20, 2018

Currently, the unit tests leave a few files. This clutters the development directory and makes it harder to keep an overview in git.

@rth
Copy link
Contributor

rth commented Sep 17, 2018

That would be fairly straightforward with pytest #327

@rth rth mentioned this issue Sep 17, 2018
@mfeurer mfeurer added the Good First Issue Issues suitable for people new to contributing to openml-python! label Jan 15, 2019
@Neeratyoy
Copy link
Contributor

Hi,
On taking a preliminary look at openml/testing.py, the setUp() and tearDown() does a neat job of creating a temp directory and cleaning it up. It works.
However, all the excess files which show up untracked for git, are in the directory test/files/.
In that case, can I use os.walk() before and after the testing, to look for new files that were not there in this directory and get them cleaned? If not, can someone just nudge me to see where and how test/files is getting updated?

I do need to take a deeper look but pytest still seems to have a related open issue, so this might need some book-keeping and forced deletions.

@mfeurer
Copy link
Collaborator Author

mfeurer commented Jul 9, 2019

@Neeratyoy I'm afraid that the current implementation does not work, i.e. it changes the working directory before running the tests, executing the 2nd git status outside of the git repository. Could you please create a new PR fixing this?

@Neeratyoy
Copy link
Contributor

Sure, I'll take a look at this.

@Neeratyoy
Copy link
Contributor

@mfeurer could you please guide me as to how I can test this locally?
When I execute bash ci_scripts/test.sh, or even check echo $TEST_DIR at the beginning of run_tests(), it gives a mkdir: missing operand error. The result of echo $TEST_DIR is blank.
How can I recreate locally how CI runs this?

executing the 2nd git status outside of the git repository.

Can I in that case store the current directory curr_dir=`pwd` and before the second git status execute cd $curr_dir ?

@mfeurer
Copy link
Collaborator Author

mfeurer commented Jul 10, 2019

How can I recreate locally how CI runs this?

That's tricky. The easiest solution would be to do export TEST_DIR=/tmp/test/ prior to running bash ci_scripts/test.sh.

Can I in that case store the current directory curr_dir=pwd and before the second git status execute cd $curr_dir ?

That sounds like a good solution.

@mfeurer
Copy link
Collaborator Author

mfeurer commented Jul 19, 2019

Added in #721.

@mfeurer mfeurer closed this as completed Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Issues suitable for people new to contributing to openml-python!
Projects
None yet
Development

No branches or pull requests

3 participants