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

Add abort-on-error option #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Sasanidas
Copy link

I think sometimes there is the possibility that there is a huge testing system and that waiting to all test to finish are not that desirable. So it's easier to stop on an error and focus on that one, instead of waiting for the entire error suite to finish.

I just implemented the bare-bones option, but still think that when aborting the execution, a more detailed explanation maybe more suitable.

@fukamachi
Copy link
Owner

Thank you for the PR!

Though it seems it doesn't work expectedly, it'd be preferable to have such a "fail fast" option.
I think *quit-on-failure* would be the better name.

@cxxxr
Copy link
Contributor

cxxxr commented Sep 1, 2023

Is this different from the existing *debug-on-error*?

@fukamachi
Copy link
Owner

Is this different from the existing *debug-on-error*?

*debug-on-error* is an option to invoke a debugger when some errors (≠ failures) are raised.
I suppose @Sasanidas suggests an option to stop the rest of the tests when it finds the first failure, right?

@Sasanidas
Copy link
Author

Though it seems it doesn't work expectedly, it'd be preferable to have such a "fail fast" option.

Sorry, what do you mean? Maybe I have to put the option in other place? 💭

@fukamachi
Copy link
Owner

Though it seems it doesn't work expectedly, it'd be preferable to have such a "fail fast" option.

Sorry, what do you mean? Maybe I have to put the option in other place? 💭

No, no, there's an unmatched closed paren, for the first place, and it runs all tests anyway since cl:abort is for ignoring a condition, not for skipping the rest of the forms.

@Sasanidas
Copy link
Author

Interesting, I'll fix it, running a suite locally was indeed stopping the testing

@cxxxr
Copy link
Contributor

cxxxr commented Sep 1, 2023

Hmm, the proposal is great, but it feels like a rush job (I know I am meddling)

Copy link
Contributor

@cxxxr cxxxr left a comment

Choose a reason for hiding this comment

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

I too hope this feature will be merged.
I commented because I came up with a few improvements.

Comment on lines +29 to +31
(let ((quit-on-failure-symbol (intern (string :*rove-quit-on-failure*) :cl-user)))
(and (boundp quit-on-failure-symbol)
(symbol-value quit-on-failure-symbol))))
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this be better done outside the rove?

Copy link
Owner

Choose a reason for hiding this comment

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

This is a way to configure before loading Rove.
It is already done for *debug-on-error*, so I suppose @Sasanidas refers to it.

You can set (setf *rove-debug-on-error* t) in ~/.roswell/init.lisp without loading Rove whenever you run Lisp.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed.
I was thinking about the wildness of using symbols from the cl-user package.

@@ -37,6 +38,11 @@
:desc "Raise an error while testing."))
(return nil))))
(funcall function)))))
(when (and *quit-on-failure*
(not (passedp (stats-context *stats*))))
(format t "Failed test, with the abort option enabled. ~%")
Copy link
Contributor

Choose a reason for hiding this comment

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

It appears that rove uses repoter to abstract the output.

(when (and *quit-on-failure*
(not (passedp (stats-context *stats*))))
(format t "Failed test, with the abort option enabled. ~%")
(abort))
Copy link
Contributor

Choose a reason for hiding this comment

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

How about sending out some kind of signal and having rove:run / rove:run-test catch it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants