diff --git a/system/TestBox.cfc b/system/TestBox.cfc index 72b821c..478ce3d 100644 --- a/system/TestBox.cfc +++ b/system/TestBox.cfc @@ -405,17 +405,22 @@ component accessors="true" { ); // Verify URL conventions for bundle, suites and specs exclusions. - if ( structKeyExists( url, "testBundles" ) && !isNull( url.testBundles ) ) { - testBundles.append( listToArray( urlDecode( url.testBundles ) ), true ); - } - if ( structKeyExists( url, "testSuites" ) && !isNull( url.testSuites ) ) { - arguments.testSuites.append( listToArray( urlDecode( url.testSuites ) ), true ); - } - if ( structKeyExists( url, "testSpecs" ) && !isNull( url.testSpecs ) ) { - arguments.testSpecs.append( listToArray( urlDecode( url.testSpecs ) ), true ); - } - if ( structKeyExists( url, "testMethod" ) && !isNull( url.testMethod ) ) { - arguments.testSpecs.append( listToArray( urlDecode( url.testMethod ) ), true ); + // The `url` scope only exists in a real HTTP request - it isn't registered at all when + // TestBox runs via the BoxLang CLI, so even a `structKeyExists( url, ... )` guard throws + // (resolving the bare `url` identifier is what fails, not the key lookup within it). + if ( !variables.IS_CLI ) { + if ( structKeyExists( url, "testBundles" ) && !isNull( url.testBundles ) ) { + testBundles.append( listToArray( urlDecode( url.testBundles ) ), true ); + } + if ( structKeyExists( url, "testSuites" ) && !isNull( url.testSuites ) ) { + arguments.testSuites.append( listToArray( urlDecode( url.testSuites ) ), true ); + } + if ( structKeyExists( url, "testSpecs" ) && !isNull( url.testSpecs ) ) { + arguments.testSpecs.append( listToArray( urlDecode( url.testSpecs ) ), true ); + } + if ( structKeyExists( url, "testMethod" ) && !isNull( url.testMethod ) ) { + arguments.testSpecs.append( listToArray( urlDecode( url.testMethod ) ), true ); + } } // Using a directory runner? @@ -524,17 +529,20 @@ component accessors="true" { isSimpleValue( arguments.testSpecs ) ? listToArray( arguments.testSpecs ) : arguments.testSpecs ); - if ( structKeyExists( url, "testBundles" ) && !isNull( url.testBundles ) ) { - arguments.testBundles.append( listToArray( urlDecode( url.testBundles ) ), true ); - } - if ( structKeyExists( url, "testSuites" ) && !isNull( url.testSuites ) ) { - arguments.testSuites.append( listToArray( urlDecode( url.testSuites ) ), true ); - } - if ( structKeyExists( url, "testSpecs" ) && !isNull( url.testSpecs ) ) { - arguments.testSpecs.append( listToArray( urlDecode( url.testSpecs ) ), true ); - } - if ( structKeyExists( url, "testMethod" ) && !isNull( url.testMethod ) ) { - arguments.testSpecs.append( listToArray( urlDecode( url.testMethod ) ), true ); + // The `url` scope only exists in a real HTTP request - see the identical guard in runRaw(). + if ( !variables.IS_CLI ) { + if ( structKeyExists( url, "testBundles" ) && !isNull( url.testBundles ) ) { + arguments.testBundles.append( listToArray( urlDecode( url.testBundles ) ), true ); + } + if ( structKeyExists( url, "testSuites" ) && !isNull( url.testSuites ) ) { + arguments.testSuites.append( listToArray( urlDecode( url.testSuites ) ), true ); + } + if ( structKeyExists( url, "testSpecs" ) && !isNull( url.testSpecs ) ) { + arguments.testSpecs.append( listToArray( urlDecode( url.testSpecs ) ), true ); + } + if ( structKeyExists( url, "testMethod" ) && !isNull( url.testMethod ) ) { + arguments.testSpecs.append( listToArray( urlDecode( url.testMethod ) ), true ); + } } var filterState = new testbox.system.TestResult(