Skip to content

Commit

Permalink
Merge pull request #164 from Ortus-Solutions/development
Browse files Browse the repository at this point in the history
version bump
  • Loading branch information
lmajano authored Jan 28, 2025
2 parents 6cf14e7 + 878b978 commit 2b6af36
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 34 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_call:
secrets:
SLACK_WEBHOOK_URL:
required: true
required: false

jobs:
tests:
Expand All @@ -15,22 +15,22 @@ jobs:
strategy:
fail-fast: false
matrix:
commandbox_version: [ "6.1.0-rc" ]
commandbox_version: [ "6.1.0" ]
cfengine: [ "lucee@5", "lucee@6", "adobe@2021", "adobe@2023" ]
jdkVersion: [ "11" ]
experimental: [false]
include:
- cfengine: "boxlang@1"
commandbox_version: "6.1.0-rc"
commandbox_version: "6.1.0"
jdkVersion: "21"
experimental: false
- cfengine: "lucee@6"
commandbox_version: "6.1.0-rc"
jdkVersion: "17"
commandbox_version: "6.1.0"
jdkVersion: "21"
experimental: true
- cfengine: "adobe@2023"
commandbox_version: "6.1.0-rc"
jdkVersion: "17"
commandbox_version: "6.1.0"
jdkVersion: "21"
experimental: true
steps:
- name: Checkout Repository
Expand Down
6 changes: 3 additions & 3 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"TestBox",
"version":"6.0.1",
"version":"6.1.0",
"location":"https://downloads.ortussolutions.com/ortussolutions/testbox/@build.version@/[email protected]@.zip",
"author":"Ortus Solutions <[email protected]>",
"slug":"testbox",
Expand Down Expand Up @@ -37,7 +37,7 @@
},
"dependencies":{
"cbstreams":"^2.0.0",
"mockdatacfc":"^3",
"cbMockData":"^4",
"globber":"^3.1.3"
},
"devDependencies":{
Expand All @@ -47,7 +47,7 @@
},
"installPaths":{
"cbstreams":"system/modules/cbstreams/",
"mockdatacfc":"system/modules/mockdatacfc/",
"cbMockData":"system/modules/cbMockData/",
"globber":"system/modules/globber/"
},
"scripts":{
Expand Down
4 changes: 2 additions & 2 deletions cfml/browser/index.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<cfif runners.recordCount eq 0>
<p class="alert alert-warning">No runners found in this directory</p>
<cfelse>
<cloop query="runners">
<cfloop query="runners">
<a
href="#runners.name#"
target="_blank"
Expand All @@ -106,7 +106,7 @@
>
#runners.name#
</a>
</cloop>
</cfloop>
</cfif>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions cfml/tests/Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ component {

// any mappings go here, we create one that points to the root called test.
this.mappings[ "/tests" ] = getDirectoryFromPath( getCurrentTemplatePath() );
// Turn on/off remote cfc content whitespace
this.suppressRemoteComponentContent = false;

// any orm definitions go here.

Expand Down
14 changes: 14 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### New Features

- [TESTBOX-412](https://ortussolutions.atlassian.net/browse/TESTBOX-412) Updated to use cbMockData now instead of MockDataCFC

### Improvements

- [TESTBOX-409](https://ortussolutions.atlassian.net/browse/TESTBOX-409) Support BoxLang without needing compat

### Bugs

- [TESTBOX-408](https://ortussolutions.atlassian.net/browse/TESTBOX-408) Allow toHaveKey to support struct like objects
- [TESTBOX-410](https://ortussolutions.atlassian.net/browse/TESTBOX-410) Error when using the url.excludes with the HTML runner
- [TESTBOX-411](https://ortussolutions.atlassian.net/browse/TESTBOX-411) fix missing \`cfloop\` on test browser

## [6.0.1] - 2024-12-05

## [6.0.0] - 2024-09-27
Expand Down
2 changes: 1 addition & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"serverHomeDirectory":".engine/boxlang"
},
"JVM":{
"javaVersion":"openjdk21_jdk",
"javaVersion":"openjdk21_jre",
"args": "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888"
},
"cfconfig":{
Expand Down
5 changes: 1 addition & 4 deletions system/Assertion.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1454,16 +1454,13 @@ component {
* @throws InvalidTargetType - If we can normalize it to a struct
*/
private function normalizeToStruct( any target ){
if ( isStruct( arguments.target ) ) {
return arguments.target;
}
if ( isQuery( arguments.target ) ) {
return getMetadata( arguments.target ).reduce( ( results, item ) => {
results[ item.name ] = {};
return results;
}, {} );
}
throw( "InvalidTargetType", "The target is not a struct or query" );
return arguments.target;
}

}
22 changes: 12 additions & 10 deletions system/BaseSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,8 @@ component {
// init consolidated spec labels
var consolidatedLabels = arguments.spec.labels;
var md = getMetadata( this );
param md.labels = "";
consolidatedLabels.append( listToArray( md.labels, true ) );
var mdLabels = md.labels ?: "";
consolidatedLabels.append( listToArray( mdLabels ), true );
// Build labels from nested suites, so suites inherit from parent suite labels
var parentSuite = arguments.suite;
while ( !isSimpleValue( parentSuite ) ) {
Expand Down Expand Up @@ -1077,6 +1077,7 @@ component {
// store spec status and debug data
specStats.status = "Failed";
specStats.failMessage = e.message;
specStats.error = e;
specStats.failDetail = e.detail;
specStats.failExtendedInfo = e.extendedInfo;
specStats.failStacktrace = e.stackTrace;
Expand Down Expand Up @@ -1434,6 +1435,7 @@ component {
// store spec status and debug data
specStats.status = "Failed";
specStats.failMessage = e.message;
specStats.error = e;
specStats.failExtendedInfo = e.extendedInfo;
specStats.failStacktrace = e.stackTrace;
specStats.failOrigin = e.tagContext;
Expand Down Expand Up @@ -1608,25 +1610,25 @@ component {
}

/**
* Use MockDataCFC to mock whatever data you want by executing the `mock()` function in MockDataCFC
* Use cbMockData to mock whatever data you want by executing the `mock()` function in cbMockData
*
* @return The mock data you desire sir!
*/
function mockData(){
return getMockDataCFC().mock( argumentCollection = arguments );
return getCBMockData().mock( argumentCollection = arguments );
}

/**
* Get the MockData CFC object
* Get the MockData Class object
*
* @return testbox.system.modules.mockdatacfc.models.MockData
* @return testbox.system.modules.cbMockData.models.MockData
*/
function getMockDataCFC(){
function getCBMockData(){
// Lazy Load it
if ( isNull( variables.$mockDataCFC ) ) {
variables.$mockDataCFC = new testbox.system.modules.mockdatacfc.models.MockData();
if ( isNull( variables.$cbMockData ) ) {
variables.$cbMockData = new testbox.system.modules.cbMockData.models.MockData();
}
return variables.$mockDataCFC;
return variables.$cbMockData;
}

/**
Expand Down
17 changes: 11 additions & 6 deletions system/TestBox.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ component accessors="true" {
* @path The invocationPath path to the module. Ex: tests.resources.myModule
*/
function registerModule( required path ){
var moduleName = listLast( arguments.path, "." );
var absolutePath = expandPath( "/" & arguments.path.replace( ".", "/", "all" ) );
var moduleName = listLast( arguments.path, "." );
var absolutePath = expandPath( "/" & arguments.path.replace( ".", "/", "all" ) );
// Register Mapping
variables.modules.mappings[ moduleName ] = absolutePath;
variables.modules.mappings[ "/" & moduleName ] = absolutePath;
// Register Module
variables.modules.registry[ moduleName ] = {
variables.modules.registry[ moduleName ] = {
"name" : moduleName,
"settings" : {},
"moduleConfig" : "",
Expand Down Expand Up @@ -225,7 +225,7 @@ component accessors="true" {
function registerAndActivateModule( required path ){
var moduleName = listLast( arguments.path, "." );
registerModule( arguments.path ).activateModule( moduleName );
variables.utility.addMapping( name: moduleName, path: variables.modules.registry[ moduleName ].path );
variables.utility.addMapping( name: "/" & moduleName, path: variables.modules.registry[ moduleName ].path );
return this;
}

Expand Down Expand Up @@ -451,7 +451,12 @@ component accessors="true" {
// iterate and run the test bundles
for ( var thisBundlePath in variables.bundles ) {
// Skip interfaces, they are not testable
if ( getComponentMetadata( thisBundlePath ).type eq "interface" ) {
if ( server.keyExists( "boxlang" ) ) {
var thisMD = getClassMetadata( thisBundlePath );
} else {
var thisMD = getComponentMetadata( thisBundlePath );
}
if ( thisMD.type eq "interface" ) {
continue;
}

Expand Down
6 changes: 5 additions & 1 deletion system/util/Util.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ component {
// Lazy load the helper
if ( isNull( variables.engineMappingHelper ) ) {
// Detect server
if ( listFindNoCase( "Lucee", server.coldfusion.productname ) ) {
var engine = server.coldfusion.productname ?: "";
if ( engine == "" && server.keyExists( "boxlang" ) ) {
engine = "lucee";
}
if ( listFindNoCase( "Lucee", engine ) ) {
variables.engineMappingHelper = new LuceeMappingHelper();
} else {
variables.engineMappingHelper = new CFMappingHelper();
Expand Down
2 changes: 2 additions & 0 deletions tests/Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ component{
this.mappings[ "/testbox" ] = rootPath;
// Map resources
this.mappings[ "/coldbox" ] = this.mappings[ "/tests" ] & "resources/coldbox";
// Turn on/off remote cfc content whitespace
this.suppressRemoteComponentContent = false;

// any orm definitions go here.

Expand Down

0 comments on commit 2b6af36

Please sign in to comment.