Help: Tests run OK but generated HTML don't show results

10 views
Skip to first unread message

Jakub Holý

unread,
May 10, 2019, 7:33:45 AM5/10/19
to concordion-dev
Hello!

I am updating clj-concordion from using the deprecated JUnit3 style (i.e. FixtureRunner.run(fixture)) to the new, per-example run style of JUnit 4 (i.e. multiple FixtureRunner.run(exapmleName, fixture)). The tests run, the output in the terminal as as expected, but the generated HTML files do not show the results (i.e. green/red backround). Before it worked OK. Where should I start looking?

It is quite possible I forgot something, the junit4-style integration is much more complex, I have to relate to more Concordion classes, and remember to do some low-level stuff such as calling runResultsCache.startFixtureRun(fixtureType, concordion.getSpecificationDescription). (If anybody is interested, I can provide feedback on the API and suggestions. I strongly preferred the junit3 style where I essentially only needed to copy the 5 lines from ConcordionTestCase).

This is the terminal output, the latter .html is attached below:

file:///var/folders/kg/r_8ytg7x521cvlmz_47t2rgc0000gn/T/concordion/math/algebra/Addition.html
Successes: 2, Failures: 0

file:///var/folders/kg/r_8ytg7x521cvlmz_47t2rgc0000gn/T/concordion/math/Algebra.html
Successes: 4, Failures: 0

Here is the most important part of my code. It is Clojure but you can read it - just move opening parenthese right and swap the first two elements, "text".toUpperCase() <=> (.toUpperCase "text") :-)

(try
(do
(.setupForRun fixture (.getFixtureObject fixture))
(when suite? (.beforeSuite fixture))
(.startFixtureRun runResultsCache ftype (.getSpecificationDescription concordion))
(.beforeSpecification fixture)
(run-fixture-examples fixture)) ;; SEE BELOW - run and cache results
(doto (cached-spec-result fixture)
(print-result ftype))
(finally
(.afterSpecification fixture)
(.finish concordion)
(when suite? (.afterSuite fixture)))
----
Core of run-fixture-examples:
(for [example examples]
(try
(.beforeExample fixture example)
(doto (.run runner example fixture)
(.assertIsSatisfied ftype))
(finally
(.afterExample fixture example))))

Can you spot whether I missed anything important, that would cause Concordion to run the tests but not make results visible in the generated HTML files? Is there some "writeResultsToGeneratedHtmlFiles" call I missed?

Thank you! /Jakub
Algebra.html

Nigel Charman

unread,
May 11, 2019, 6:23:27 AM5/11/19
to concord...@googlegroups.com
Hi

The output is updated using the AssertResultRenderer, which is configured in ConcordionBuilder.

Check whether your generated HTML has the "failure" or "success" styles on the assertEquals element, in case you may be missing the CSS - the default CSS is configured in ConcordionBuilder.addDefaultStyling.

If you're not touching ConcordionBuilder, it's possible that it can't find the file:
/org/concordion/internal/resource/embedded.css

Hope that helps!
--
You received this message because you are subscribed to the Google Groups "concordion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion-de...@googlegroups.com.
To post to this group, send email to concord...@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion-dev.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion-dev/CA%2BffqM3G0eEEPy6nP%2Bpj6X3zSTV2-9qR_upMBOGLhdGAvTwwkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages