-
Notifications
You must be signed in to change notification settings - Fork 295
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
Harden Sharness #288
Harden Sharness #288
Conversation
Better error messages in test-lib init functions and ipfshttp Cleanup functions are now called after every test file License: MIT Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but I still think that test-lib.sh can probably be hardened and beautified a bit
@@ -31,4 +29,7 @@ test_expect_success "starting a second cluster-service process fails" ' | |||
test_expect_code 1 ipfs-cluster-service --config "test-config" | |||
' | |||
|
|||
test_clean_ipfs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm it seems that cleanup ...
does not clean when the tests have failed (even though documentation says it does? https://github.com/chriscool/sharness/blob/master/API.md#final_cleanup).
I understand this fixes that? The reason clean up does not run on that case is probably to allow the user to debug things. I'm fine with this though, since debugging implies running stuff locally and we can then potentially comment this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It was tough to see this because as you say the docs are a bit misleading. But it explained behavior we saw and I'm reasonably confident after looking at sharness source (see link above)
My thoughts exactly. It makes sense if you want a single failure to stop everything so you can debug, but running this on CI we don't even have a chance to investigate the left over state.
merge if you want @ZenGround0 |
@hsanjuan Will do. I'll leave the harden sharness issue open as it sounds like you have more in mind. If you are looking to offload that work make sure to write down your thoughts on the issue because right now I'm drawing a blank on what else needs to be done. |
Recent sharness failures prompted more investigation. In particular sharness
cleanup
does not run cleanup functions on failure (see here: https://github.com/chriscool/sharness/blob/master/sharness.sh#L763). To ensure isolation among test failures we need reliable teardown of ipfs and cluster between each testfile so now the cleanup functions are run directly before test_done.Error messages are also slightly improved.
The current
test-lib.sh
already ensures that there is no data folder withrm -rf ipfs-cluster-data
after the config folder is created.Altogether this should close #181.