Skip to content

Do not leave files after running unit tests #447

Closed

Description

@mfeurer

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

Activity

  1. rth commented on Sep 17, 2018

    @rth
    Contributor

    That would be fairly straightforward with pytest #327

  2. added
    Good First IssueIssues suitable for people new to contributing to openml-python!
    on Jan 15, 2019
  3. Neeratyoy commented on Jun 24, 2019

    @Neeratyoy
    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.

  4. self-assigned this
    on Jun 27, 2019
  5. mfeurer commented on Jul 9, 2019

    @mfeurer
    CollaboratorAuthor

    @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?

  6. Neeratyoy commented on Jul 9, 2019

    @Neeratyoy
    Contributor

    Sure, I'll take a look at this.

  7. Neeratyoy commented on Jul 9, 2019

    @Neeratyoy
    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 ?

  8. mfeurer commented on Jul 10, 2019

    @mfeurer
    CollaboratorAuthor

    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.

  9. mfeurer commented on Jul 19, 2019

    @mfeurer
    CollaboratorAuthor

    Added in #721.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Good First IssueIssues suitable for people new to contributing to openml-python!

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions