-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
t0030-mount.sh: 2 known breakages vanished #945
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,14 +20,13 @@ test_launch_ipfs_daemon | |
|
||
# run this mount failure before mounting properly. | ||
|
||
test_expect_failure "'ipfs mount' fails when no mount dir (issue #341)" ' | ||
test_must_fail ipfs mount -f=not_ipfs -n=not_ipns >actual | ||
test_expect_success "'ipfs mount' fails when there is no mount dir" ' | ||
test_must_fail eval "ipfs mount -f=not_ipfs -n=not_ipns >output 2>output.err" | ||
' | ||
|
||
test_expect_failure "'ipfs mount' looks good when it fails (issue #341)" ' | ||
! grep "IPFS mounted at: $(pwd)/ipfs" actual >/dev/null && | ||
! grep "IPNS mounted at: $(pwd)/ipns" actual >/dev/null || | ||
test_fsh cat actual | ||
test_expect_success "'ipfs mount' output looks good" ' | ||
test_must_be_empty output && | ||
test_should_contain "not_ipns\|not_ipfs" output.err | ||
' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this test case removed? it should remain. it may even be fixed once we vendor the new fuse. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The set of all possible outputs that don't contain "IPFS mounted at:" and "IPNS mounted at:" is too broad. What if someone changes our output message to "IPFS mounted at" (without the ":") and then someone introduces a bug that causes The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the idea to have two tests is because the first test just checks that the exist code is what we expect and the second one tests that the output is what we expect. Here the first one "'ipfs mount' fails when no mount dir" would just check that the exit code is not zero. And the second one should be renamed "'ipfs mount' output looks good when it fails" to make clear that it's about the output. This is a bit different than in git where the exit code and the output are checked in the same test, but I think it makes it easier to debug. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It is critical that we test our output formats as exactly as we can, so that if we accidentally change the output format we notice. People will build scripts on top of our outputs and they will only be able to do so as long as we do not change the outputs unless absolutely necessary. This should be a very explicit decision, and test cases help us make sure we do this carefully. |
||
|
||
# now mount properly, and keep going | ||
|
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.
maybe
"test_should_contain: requires 2 parameters"
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.
I decided to mimic original errors: examples are here and here.
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.
ah, okay. that's fine then. good enough for junio, good enough for me.
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.
Though your variant is definitely better, uniformity is even more better.