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

I want a retry test for failed tests #58

Open
cxxxr opened this issue Jan 31, 2023 · 0 comments
Open

I want a retry test for failed tests #58

cxxxr opened this issue Jan 31, 2023 · 0 comments

Comments

@cxxxr
Copy link
Contributor

cxxxr commented Jan 31, 2023

First, collect the names of failed tests from the return value of rove:run.

(defun collect-failed-tests (failed-tests)
  (let ((test-names '()))
    (labels ((recursive (failed-tests)
               (dolist (test failed-tests)
                 (when (and (typep test 'rove:test))
                   (when (symbolp (rove:test-name test))
                     (push (rove:test-name test) test-names))
                   (recursive (rove:failed-tests test))))))
      (recursive failed-tests))
    test-names))

;; example
(collect-failed-tests (nth-value 1 (rove:run :foo/tests))) ; => '(test-1 test-2)

This result is a list of test names.

I want to run this test again.
However, there is no function in rove to achieve this.

Candidate solutions that come to mind are.

  1. Add run-tests function
    However, there is concern that this may compromise encapsulation.
  2. Allow multiple functions to be passed to run-test
    There is a concern that the return value is not uniquely determined.
  3. Extend rove:run to accept list of test-name
    There is a concern that the assumption that only the system name is used may be broken.

It might be a trade-off, but isn't there a better solution?

@cxxxr cxxxr changed the title I want a retry function for failed tests I want a retry test for failed tests Jan 31, 2023
@cxxxr cxxxr mentioned this issue Jan 31, 2023
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

No branches or pull requests

1 participant