Skip to content

Commit

Permalink
Update run.cfc to use webroot when resolving testbox location in ensu…
Browse files Browse the repository at this point in the history
…reTestBox

Currently, if your testbox folder is not in the current folder where your server.json lives, ie, a subfolder like /test-harness or /app the ensureTestBox() function fails, and then installs testbox into the testbox-cli folder.

In CI, this testbox-cli folder never has a testbox in it, because its built from an image, so this means every time we run tests, it installs testbox over and over and over again.

This fix users the server info to pass the webroot of the current server to the resolvePath() command, to ensure we look for testbox in the webroot. 

Improvement: Maybe we look in the current folder, and in the webroot?
  • Loading branch information
gpickin authored May 1, 2024
1 parent 7d000c2 commit b8bc143
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion commands/testbox/run.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,12 @@ component {
var testBoxPath = variables.moduleConfig.path & "/testbox";
var modulePath = variables.moduleConfig.path;

var serverDetails = variables.serverService.resolveServerDetails( {} );
var serverInfo = serverDetails.serverInfo;

// Check if installed locally
if ( arguments.testboxUseLocal ) {
testBoxPath = resolvePath( "testbox" );
testBoxPath = resolvePath( "testbox", "#serverInfo.webroot#" );
}

if ( !directoryExists( testBoxPath ) ) {
Expand Down

0 comments on commit b8bc143

Please sign in to comment.