luceedebug
luceedebug copied to clipboard
How to Run Tests?
I mentioned this in #45 but wanted to create a separate ticket for it.
How does one set up and run tests?
Here's what happens when I try. (Note that docker is running.)
luceedebug % docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
luceedebug % docker --version
Docker version 20.10.17, build 100c701
luceedebug % ./gradlew test
Setting maxParallelForks to 12
> Task :luceedebug:test
EvaluatesAnExpression > a() STANDARD_ERROR
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
StepsToFinallyAndThenCatchSkippingPastUnwoundLines > a() STANDARD_ERROR
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SteppingWorksAsExpectedOnSinglelineStatementWithManySubexpressions > a() STANDARD_ERROR
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
HitsABreakpointAndRetrievesVariableInfo > a() STANDARD_ERROR
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SteppingThroughDefaultArgs > a() STANDARD_ERROR
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
HitsABreakpointAndRetrievesVariableInfo > a() FAILED
org.opentest4j.AssertionFailedError at HitsABreakpointAndRetrievesVariableInfo.java:59
SteppingThroughDefaultArgs > a() FAILED
org.opentest4j.AssertionFailedError at SteppingThroughDefaultArgs.java:58
EvaluatesAnExpression > a() FAILED
org.opentest4j.AssertionFailedError at EvaluatesAnExpression.java:57
SteppingWorksAsExpectedOnSinglelineStatementWithManySubexpressions > a() FAILED
org.opentest4j.AssertionFailedError at SteppingWorksAsExpectedOnSinglelineStatementWithManySubexpressions.java:57
StepsToFinallyAndThenCatchSkippingPastUnwoundLines > a() FAILED
org.opentest4j.AssertionFailedError at StepsToFinallyAndThenCatchSkippingPastUnwoundLines.java:57
5 tests completed, 5 failed
> Task :luceedebug:test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':luceedebug:test'.
> There were failing tests. See the report at: file:///Users/jjackson/projects/luceedebug/luceedebug/build/reports/tests/test/index.html
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 22s
6 actionable tasks: 4 executed, 2 up-to-date
The report shows this as the root cause: org.opentest4j.AssertionFailedError: server is up ==> expected: <true> but was: <false>
Yeah, gradlew test ought to do it.
I haven't been able to reproduce these failures, so you might to have pick a single test and try to decipher why a particular assertion is failing.
A broad overview of the tests is:
- build a docker image configured with lucee (the desire is to do this once globally, but I didn't figure out how to synchronize docker across concurrent test runs for this purpose)
- spin up a container, bind-mounting some cfm files relevant to the test
- http request to /heartbeat.cfm until lucee returns 200
- connect debugger and set a breakpoint
- http request with intent to hit breakpoint, then exercise the debugger