I'm integrating testbox into our CI using Github a...
# box-products
l
I'm integrating testbox into our CI using Github actions. I'm running into this error:
Copy code
Run box testbox run "<http://127.0.0.1:80/tests/runner.cfm>"
Executing tests <http://127.0.0.1:80/tests/runner.cfm?&directory=tests.specs&recurse=true&reporter=json&verbose=true> please wait...



ERROR (5.7.0+00653)

Error executing tests:500 Internal Server ErrorGET <http://127.0.0.1:80/tests/runner.cfm?&directory=tests.specs&recurse=true&reporter=json&verbose=trueLucee> 5.3.8.189 Error (BundleRunnerMajorException) 

Message Error executing bundle - tests.specs.Services.UserServiceTest  message: Parent directory for [/app/testbox/system/stubs/D2AEDE288527BB61F793378611067533.cfm] doesn't exist
I'm brand new to testbox so may be missing some dependency or config. We can run the tests through the browser with:
<http://localhost/tests/runner.cfm>
More of that stack trace:
Copy code
Message Error executing bundle - tests.specs.Services.UserServiceTest  message: Parent directory for [/app/testbox/system/stubs/D2AEDE288527BB61F793378611067533.cfm] doesn't exist 

Detail lucee.runtime.exp.ApplicationException: Parent directory for [/app/testbox/system/stubs/D2AEDE288527BB61F793378611067533.cfm] doesn't exist
at lucee.runtime.tag.FileTag.checkFile(FileTag.java:1198)
at lucee.runtime.tag.FileTag.actionWrite(FileTag.java:714)
at lucee.runtime.tag.FileTag.doEndTag(FileTag.java:476)
at testbox.system.mockutils.mockgenerator_cfc$cf.udfCall(/testbox/system/mockutils/MockGenerator.cfc:326)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:784)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1744)
at testbox.system.mockutils.mockgenerator_cfc$cf.udfCall(/testbox/system/mockutils/MockGenerator.cfc:285)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:685)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:572)
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1930)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1763)
at testbox.system.mockbox_cfc$cf.udfCall3(/testbox/system/MockBox.cfc:701)
at testbox.system.mockbox_cfc$cf.udfCall(/testbox/system/MockBox.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:684)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:572)
at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1911)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1744)
at specs.services.userservicetest_cfc$cf.udfCall1(/tests/specs/Services/UserServiceTest.cfc:55)
at specs.services.userservicetest_cfc$cf.udfCall(/tests/specs/Services/UserServiceTest.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
at lucee.runtime.type.EnvUDF.call(EnvUDF.java:97)
at lucee.runtime.type.scope.ArgumentImpl.call(ArgumentImpl.java:508)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1744)
at testbox.system.basespec_cfc$cf.udfCall1(/testbox/system/BaseSpec.cfc:232)
at testbox.system.basespec_cfc$cf.udfCall(/testbox/system/BaseSpec.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:784)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1744)
at specs.services.userservicetest_cfc$cf.udfCall1(/tests/specs/Services/UserServiceTest.cfc:68)
at specs.services.userservicetest_cfc$cf.udfCall(/tests/specs/Services/UserServiceTest.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
at lucee.runtime.type.EnvUDF.call(EnvUDF.java:97)
at lucee.runtime.type.scope.ArgumentImpl.call(ArgumentImpl.java:508)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1744)
at testbox.system.basespec_cfc$cf.udfCall1(/testbox/system/BaseSpec.cfc:244)
at testbox.system.basespec_cfc$cf.udfCall(/testbox/system/BaseSpec.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:784)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1744)
at specs.services.userservicetest_cfc$cf.udfCall1(/tests/specs/Services/UserServiceTest.cfc:384)
at specs.services.userservicetest_cfc$cf.udfCall(/tests/specs/Services/UserServiceTest.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:685)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:572)
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1930)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1763)
at testbox.system.runners.bddrunner_cfc$cf.udfCall(/testbox/system/runners/BDDRunner.cfc:47)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:684)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:572)
at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1911)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1744)
at testbox.system.testbox_cfc$cf.udfCall2(/testbox/system/TestBox.cfc:535)
at testbox.system.testbox_cfc$cf.udfCall(/testbox/system/TestBox.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:797)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1763)
at testbox.system.testbox_cfc$cf.udfCall1(/testbox/system/TestBox.cfc:275)
at testbox.system.testbox_cfc$cf.udfCall(/testbox/system/TestBox.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:797)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1763)
at testbox.system.testbox_cfc$cf.udfCall1(/testbox/system/TestBox.cfc:164)
at testbox.system.testbox_cfc$cf.udfCall(/testbox/system/TestBox.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:685)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:572)
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1930)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1763)
at testbox.system.runners.htmlrunner_cfm$cf.call(/testbox/system/runners/HTMLRunner.cfm:49)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1031)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:923)
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:904)
at tests.runner_cfm$cf.call(/tests/runner.cfm:25)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1031)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:923)
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:217)
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2457)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2447)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2418)
at lucee.runtime.engine.Request.exe(Request.java:44)
at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1179)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1125)
at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97)
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter.doFilter(RegexPathInfoFilter.java:47)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:405)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at runwar.Server$1$1.handleRequest(Server.java:507)
at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintH
b
What version of TestBox?
So if it's not there, you'd need to find out why it's getting deleted
Add some debugging to your build to check for the existence of
/app/testbox/system/stubs/
.
šŸ‘ 1
@Lisa
l
One caveat while I figure out the version...we bootup the webserver in another container (in the same github action) And use the Ortus container to run the tests
Thank you
Another approach...is there a way to run the tests from the command-line? Then I can run in our docker container rather than the Ortus container. I tried the NodeJS runner which looked cool but it relies on a bunch of outdated packages that are critical risk.
I can send a wget or curl request to the URL but is there already a report tool that will parse the html?
b
I'm not quite sure what you're asking-- in your example above, you ARE running the tests from the command line!
I don't really understand what you've got going on in terms of your docker containers
Really regardless of how or where your app is running, you should be able to point the
box testbox run
command at it and run the tests
I'd focus in on why you have missing directories on whatever hard drive the app is running on.
l
FYI testbox version:
Copy code
"testbox":"4.5.0+5"
šŸ‘ 1
b
Ok, that's the latest version which is good. So now we're still back to you figuring out if that path is correct and why it doesn't exist.
When I install that version of TestBox, I have an empty stubs directory
Copy code
āÆ install  testbox@4.5.0+5
 √ | Installing package [forgebox:testbox@4.5.0+5]

āÆ ll testbox/system
Jan 31,2023  13:01:35              <DIR>   compat/
Jan 31,2023  13:01:35              <DIR>   coverage/
Jan 31,2023  13:01:35              <DIR>   mockutils/
Jan 31,2023  13:01:36              <DIR>   modules/
Jan 31,2023  13:01:35              <DIR>   reports/
Jan 31,2023  13:01:35              <DIR>   runners/
Jan 31,2023  13:01:35              <DIR>   stubs/
Jan 31,2023  13:01:35              <DIR>   util/
Dec 13,2021  23:12:42             0.3 KB   Application.cfc
Dec 13,2021  23:12:42            33.8 KB   Assertion.cfc
Dec 13,2021  23:12:42            51.6 KB   BaseSpec.cfc
Dec 13,2021  23:12:42             1.6 KB   CollectionExpectation.cfc
Dec 13,2021  23:12:42            16.7 KB   Expectation.cfc
Dec 13,2021  23:12:42            30.5 KB   MockBox.cfc
Dec 13,2021  23:12:44            24.6 KB   TestBox.cfc
Dec 13,2021  23:12:42            12.6 KB   TestResult.cfc
I'm guessing you've done something like commit TestBox to source control and its getting missed since it's ignored
l
Yeah I suspect this is a mis-config when initially setup. I don't know the history but will find out from my teammates.
Yes I see they are ignoring stubs. That must be the cause thanks
b
I also noticed the the stubs folder in the artifact is empty. I'm not sure where the
.gitignore
file is going that's in the repo, but it may also be part of the issue
The purpose of that git ignore is to ignore everything in there but itself, which ensures the folder itself will still be committed to source control (since Git can't commit an empty folder) https://github.com/Ortus-Solutions/TestBox/blob/development/system/stubs/.gitignore
l
That's indeed the cause
b
So if you run
testbox install
, then you're fine.
but if you run that, and then commit it to your source repo, and then clone that repo somewhere else, you won't have the
stubs
folder
We always install testbox as part of our build so I've never hit this
l
I got the test runner to work via old school curl. But using the Ortus command, just one more config issue -- the root path. Do you know how the root path is set in:
Copy code
Page /tests/runner.cfm [/home/runner/work/my-emc/my-emc/tests/runner.cfm] not found
(my-emc should not be twice) This may be outside of testbox as we've seen a similar path mis-config while running the app from a new team member.
b
I got the test runner to work via old school curl.
@Lisa This makes no sense. Curl is no different than the cfhttp call baked into the
testbox run
command. If it errors on one, it will error for the other and vice versa, which is why I told you not to bother going down that route in the first place
Curl gives you nothing and there is no need for it IMO. It's not even any different than just hitting the URL in a browser. It's all just an HTTP request at the end of the day and if the server has an error, then it's going to error no matter how you hit it.
Copy code
Page /tests/runner.cfm [/home/runner/work/my-emc/my-emc/tests/runner.cfm] not found
Yeah, I've never seen that one, but it's safe to say you have some sort of non-standard config going on. That page should "just work" on most servers. Without seeing your web server config, CF Mappings, code structure, etc it's impossible to say what you've got going on there.
l
curl was to eliminate the Ortus dependency. Confirmed that I can run the tests with it.
We'll dig into the path issue thanks
b
Back to the stubs issue-- the
.gitignore
appears to be getting stripped from our stubs folder at this point in our build https://github.com/Ortus-Solutions/TestBox/blob/development/build/build.xml#L98 Due to the default behavior of Ant's
FileSet
tag which as of Ant 1.8.2, automatically excludes all
.gitIgnore
files in any subdirectories. https://ant.apache.org/manual/dirtasks.html (See the "Default Excludes" section at the bottom)
cc/ @lmajano
l
Ah good to know where that came from
I figured out the path issue. box.json was not in the root project directory