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

[tests] skipped tests should clean up after themselves #10423

Merged
merged 1 commit into from
Jun 2, 2017

Conversation

jnewbery
Copy link
Contributor

If a test is skipped, it doesn't clean up its temp directory. This PR fixes that so skipped tests' temp directories are cleaned up after the test is skipped. The temp directory can be left intact by using the --nocleanup argument as usual.

Implementation: Define a SkipTest exception type. Catch it in the test_framework and go through the normal test teardown functionality. Similar to the SkipTest exception class in Python's standard unittest library

@sdaftuar

@fanquake fanquake added the Tests label May 18, 2017
@laanwj
Copy link
Member

laanwj commented May 19, 2017

Concept ACK

@jnewbery
Copy link
Contributor Author

This runs fine on my local pc but something is causing the tests to hang on Travis. I've pushed a temporary commit to increase travis logging.

@jnewbery jnewbery changed the title [tests] skipped tests should clean up after themselves [wip] [tests] skipped tests should clean up after themselves May 19, 2017
@jnewbery jnewbery force-pushed the cleanup_skipped branch 2 times, most recently from 8ad1b55 to 5b5c8e7 Compare May 19, 2017 15:06
@sdaftuar
Copy link
Member

Concept ACK, though I'm also puzzled by the travis failures.

@jnewbery jnewbery force-pushed the cleanup_skipped branch 4 times, most recently from dc20c96 to 930deb9 Compare May 22, 2017 20:53
@jnewbery
Copy link
Contributor Author

930deb9 passes travis (at least on my fork). I think the earlier failure was perhaps spurious.

This should now be ready for review.

@jnewbery jnewbery changed the title [wip] [tests] skipped tests should clean up after themselves [tests] skipped tests should clean up after themselves May 22, 2017
@sdaftuar
Copy link
Member

ACK

@maflcko
Copy link
Member

maflcko commented May 25, 2017

utACK 930deb9

Copy link
Contributor

@jimmysong jimmysong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK. 930deb9

except JSONRPCException as e:
self.log.exception("JSONRPC error")
except SkipTest as e:
self.log.warning("Test Skipped: %s" % e.message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is info elsewhere, should it really be warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - this log is replacing the logs in the individual test cases (rpcbind_test.py and zmq_test.py), which are currently warnings.

The reason is that we always want the user to know if a test has been skipped.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I see. I thought the log.info below was also logging something similar. This is fine.

@maflcko maflcko merged commit 930deb9 into bitcoin:master Jun 2, 2017
maflcko pushed a commit that referenced this pull request Jun 2, 2017
930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 20, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 20, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 22, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 22, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 22, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 22, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 22, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 22, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 22, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 22, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 22, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 22, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 26, 2019
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
barrystyle pushed a commit to PACGlobalOfficial/PAC that referenced this pull request Jan 22, 2020
…selves

930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants