-
Notifications
You must be signed in to change notification settings - Fork 79
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
Added more power to Assert #48
base: master
Are you sure you want to change the base?
Conversation
I looked through the CI logs, since it failed, and the only thing that failed was checking a message that I changed the format of. Check yourself if you don't believe me, but I think the new format is easier to read, which is why I changed it. |
Can you post a capture of the message output here please? |
@thislooksfun. I don't follow your statement about tests failing due to format change. I clearly see in the travis logs that the Timeout test is panicking. I haven't had the time to investigate why but it doesn't seem a |
@marcosnils: The timeout test failed, but it intentionally failed. If you look, the goblin script failed, but the actual test there passed. The only test that failed was expecting the error message to read "true expected true to be falsey, false is not true" but I changed it to be "Expected true to be falsey, false is not true" Just do a ctrl+f for "FAIL:" on the CI log page. |
@thislooksfun I see. Can you please fix assertions_test.go with the new message format and rename tlf-custom_test.go to something more descriptive like assertions_extended_test.go or something like that? Which are use cases for g.It("IsTrue", func() {
g.ExpectFail()
g.Assert(false).IsTrue()
}) This really confuses me. Maybe I'm missing something but I've never find the use case where I needed a test to fail and assert that that's correct.. @xetorthio what do you think about this? |
Yeah... I would love to see an example of how ExpectFail is being used. On 21:50, Fri, May 15, 2015 Marcos Nils notifications@github.com wrote:
|
I was mainly using it to be able to test that the assertions were working properly. Failing when they get a wrong input is half the test, and it looks much more elegant to have it pass when it expects a failure rather than look like it failed, but actually passing, like the timeout test you mentioned earlier. So if someone else wanted to make a custom assert library on top of goblin (like this one started as), it is easier and nicer looking when they try to test it. EDIT: An actual example, as I was on my phone before. Let's use the timeout test. As you can see, here is the current output. |
Better example. While converting some existing tests over to using ExpectFail, I came across this. It turns out 3 of the tests there (lines 330, 331, and 333) are failing, because they are supposed to fail, but aren't. That is exactly the situation ExpectFail is useful for. You just check to see if ANY of the tests fail, not all the ones you need to fail. ExpectFail is used only on one It at a time. Incidentally, I was able to fix all but "Should fail if done has been called multiple times", which works sometimes, but not others. |
Ok, in that new build the only failing test is the aforementioned "Should fail if done has been called multiple times" which as far as I can tell, is random in whether or not it succeeds. Final update: As you can see here, I ran 1000 iterations of the test sequence. Out of that a total of 395 of the tests failed in some way. 100% (395) of the failed tests failed only in the "Should fail if done has been called multiple times" section. And of those, 153 panicked with the following message: "panic: runtime error: invalid memory address or nil pointer dereference" |
I hate to be that guy, but any update on this? |
@thislooksfun promise I'll take a look tomorrow. |
@marcosnils up) Come on, lets review this request!) |
@artem-malko I no longer use go, nor do I have time to check through this PR to see what would need to be changed. If someone wants to update this PR they can submit a PR to the master branch of thislooksfun/goblin, or open a new PR here. |
@artem-malko if you're a Goblin user and wish to push this, happy to review since I'm looking at this repo these days... unfortunately I don't have time to rebase now :( |
@marcosnils I'll do it on the closest weekend) |
List of changes:
not
functionalityIt
block, and fail cleanly