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

Jovial should call all reporting hooks that clojure.test does #23

Open
ajoberstar opened this issue Feb 18, 2024 · 0 comments
Open

Jovial should call all reporting hooks that clojure.test does #23

ajoberstar opened this issue Feb 18, 2024 · 0 comments

Comments

@ajoberstar
Copy link
Member

ajoberstar commented Feb 18, 2024

Jovial currently creates a pretty simple reporter that focuses on printing exceptions to the output stream. Because of this we didn't bother calling (do-report ...) in all of the places clojure.test does, which prevents a custom reporter from handling those event types.

Discussed in clojurephant/clojurephant#214

Originally posted by ngrewe February 17, 2024
Hi folks,

I'm porting an older project that previously relied on the clojuresque gradle plugin to clojurephant, and I'm running into a bit of a problem with the JUnit integration. My test suite defines a custom report hook for :end-test-var. When I execute the test suite in IntelliJ using Cursive, that method instead gets called as expected, but when executing ./gradlew test (using the Jovial integration), it isn't called. Can anybody point me towards why that might be happening and how to fix it? I've already tried using (defmethod dev.clojurephant.jovial.engine.clojure-test/jovial-report :end-test-var …) instead of (defmethod clojure.test/report :end-test-var …), but to no avail.

Thanks,

Niels

Implementation

Looks like (at a minimum) we'll need to replicate how clojure.test calls begin/end around testing the var. I think we'd just need to add it in here.

Open to suggestions on if/how we make this extensible for end users. The (defmethod dev.clojurephant.jovial.engine.clojure-test/jovial-report :end-test-var …) that you tried is the most straightforward, but I hadn't originally intended to have a public API surface to jovial, because ideally running your test via jovial would not impact what you write in your tests. But if there's not a better way to do it transparently, that could still be an option.

@ajoberstar ajoberstar transferred this issue from clojurephant/clojurephant Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant