Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more patches #4

Merged
merged 3 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"TestBox CLI",
"version":"1.1.2",
"version":"1.1.3",
"location":"https://downloads.ortussolutions.com/ortussolutions/commandbox-modules/testbox-cli/@build.version@/[email protected]@.zip",
"slug":"testbox-cli",
"author":"Ortus Solutions, Corp",
Expand Down
24 changes: 23 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,53 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- More fixes on runner not working

* * *

## [1.1.2] - 2023-08-16

### Fixed

- Missing another older injection

* * *

## [1.1.1] - 2023-08-16

### Fixed

- Invalid module name since we refactored, so all testing runners are failing.

* * *

## [1.1.0] - 2023-07-28

### Added

- TestBox 5 modules support
- New updated test harness

* * *

## [1.0.3] - 2023-05-17

- Invalid version fixed

* * *

## [1.0.2] - 2023-05-17

- Invalid version fixed

* * *

## [1.0.1] - 2023-05-17

- Invalid version fixed

* * *

## [1.0.0] - 2023-05-17

### Added
Expand All @@ -46,7 +66,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- New `testbox apidocs` command to open the TestBox API Docs in your browser.
- Initial Creation of this project

[Unreleased]: https://github.com/Ortus-Solutions/testbox-cli/compare/v1.1.1...HEAD
[Unreleased]: https://github.com/Ortus-Solutions/testbox-cli/compare/v1.1.2...HEAD

[1.1.2]: https://github.com/Ortus-Solutions/testbox-cli/compare/v1.1.1...v1.1.2

[1.1.1]: https://github.com/Ortus-Solutions/testbox-cli/compare/v1.1.0...v1.1.1

Expand Down
70 changes: 37 additions & 33 deletions models/CLIRenderer.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ component {
*/
function render( print, testData, verbose ){
var thisColor = getAggregatedColor(
testData.totalError,
testData.totalFail,
arguments.testData.totalError,
arguments.testData.totalFail,
0
);

var didPrint = false;
for ( thisBundle in testData.bundleStats ) {
if ( ( thisBundle.totalFail + thisBundle.totalError ) == 0 && !verbose ) {
for ( var thisBundle in arguments.testData.bundleStats ) {
if ( ( thisBundle.totalFail + thisBundle.totalError ) == 0 && !arguments.verbose ) {
continue;
}

Expand All @@ -51,7 +51,7 @@ component {
thisStatus = "skipped";
}

variables.print
arguments.print
.line()
.line(
"#getIndicator( thisStatus )##thisBundle.path# (#thisBundle.totalDuration# ms)",
Expand All @@ -65,7 +65,7 @@ component {

// Check if the bundle threw a global exception
if ( !isSimpleValue( thisBundle.globalException ) ) {
variables.print
arguments.print
.line(
"GLOBAL BUNDLE EXCEPTION",
COLOR.ERROR
Expand Down Expand Up @@ -95,15 +95,15 @@ component {
);

// code print for first stack frame if supported by the CFML engine
if ( arguments.index == 1 && item.keyExists( "codePrintPlain" ) ) {
if ( index == 1 && item.keyExists( "codePrintPlain" ) ) {
print.line().line( item.codePrintPlain );
}
}
} );

// ACF has an array for the stack trace
if ( isSimpleValue( thisBundle.globalException.stacktrace ) && !errorStack.len() ) {
variables.print
arguments.print
.line(
"---------------------------------------------------------------------------------",
COLOR.ERROR
Expand All @@ -124,7 +124,7 @@ component {
.line( "END STACKTRACE", COLOR.ERROR );
}

print.line(
arguments.print.line(
"---------------------------------------------------------------------------------",
COLOR.ERROR
);
Expand All @@ -136,56 +136,60 @@ component {
suiteStats = suiteStats,
bundleStats = thisBundle,
level = 1,
print = print,
verbose = verbose
print = arguments.print,
verbose = arguments.verbose
);
}
}

// Print Summary
// cfformat-ignore-start
variables.print
arguments.print
.line()
.line( "╔═════════════════════════════════════════════════════════════════════╗", thisColor )
.line( "║ Passed ║ Failed ║ Errored ║ Skipped ║ Bundles ║ Suites ║ Specs ║", thisColor )
.line( "╠═════════════════════════════════════════════════════════════════════╣", thisColor )
.line(
"║ #headerCell( testData.totalPass )# ║ #headerCell( testData.totalFail )# ║ #headerCell( testData.totalError )# ║ #headerCell( testData.totalSkipped )# ║ #headerCell( testData.totalBundles )# ║ #headerCell( testData.totalSuites )# ║ #headerCell( testData.totalSpecs )# ║",
"║ #headerCell( arguments.testData.totalPass )# ║ #headerCell( arguments.testData.totalFail )# ║ #headerCell( arguments.testData.totalError )# ║ #headerCell( arguments.testData.totalSkipped )# ║ #headerCell( arguments.testData.totalBundles )# ║ #headerCell( arguments.testData.totalSuites )# ║ #headerCell( arguments.testData.totalSpecs )# ║",
thisColor
)
.line( "╚═════════════════════════════════════════════════════════════════════╝", thisColor )
.line()
.line( "TestBox " & ( !isNull( testData.version ) ? "v#testData.version#" : "" ) )
.line( "CFML Engine " & ( !isNull( testData.cfmlEngine ) ? "#testData.cfmlEngine# v#testData.cfmlEngineVersion#" : "" ) )
.line( "Duration #numberFormat( testData.totalDuration )#ms" )
.line( "Labels " & ( arrayLen( testData.labels ) ? arrayToList( testData.labels ) : "---" ) );
.line( "TestBox " & ( !isNull( arguments.testData.version ) ? "v#arguments.testData.version#" : "" ) )
.line( "CFML Engine " & ( !isNull( arguments.testData.cfmlEngine ) ? "#arguments.testData.cfmlEngine# v#arguments.testData.cfmlEngineVersion#" : "" ) )
.line( "Duration #numberFormat( arguments.testData.totalDuration )#ms" )
.line( "Labels " & ( arrayLen( arguments.testData.labels ) ? arrayToList( arguments.testData.labels ) : "---" ) );
// cfformat-ignore-end

if ( isDefined( "testData.coverage.enabled" ) && testData.coverage.enabled ) {
variables.print
if ( isDefined( "arguments.testData.coverage.enabled" ) && arguments.testData.coverage.enabled ) {
arguments.print
.line(
"Coverage #testData.coverage.data.stats.totalCoveredLines# / #testData.coverage.data.stats.totalExecutableLines# LOC (#numberFormat(
testData.coverage.data.stats.percTotalCoverage * 100,
"Coverage #arguments.testData.coverage.data.stats.totalCoveredLines# / #arguments.testData.coverage.data.stats.totalExecutableLines# LOC (#numberFormat(
arguments.testData.coverage.data.stats.percTotalCoverage * 100,
"9.9"
)#%) Covered"
)
.line();
if ( len( testData.coverage.data.sonarQubeResults ) ) {
print.blueLine( "Coverage: SonarQube file written to [#testData.coverage.data.sonarQubeResults#]" );
if ( len( arguments.testData.coverage.data.sonarQubeResults ) ) {
arguments.print.blueLine(
"Coverage: SonarQube file written to [#arguments.testData.coverage.data.sonarQubeResults#]"
);
}
if ( len( testData.coverage.data.browserResults ) ) {
print.blueLine( "Coverage: Browser written to [#testData.coverage.data.browserResults#]" );
if ( len( arguments.testData.coverage.data.browserResults ) ) {
arguments.print.blueLine(
"Coverage: Browser written to [#arguments.testData.coverage.data.browserResults#]"
);
}
}

// Skip this redundant line if no specs printed above in the previous suite
if ( didPrint ) {
print.line();
arguments.print.line();
}

// If verbose print the final footer report
if ( verbose ) {
variables.print
if ( arguments.verbose ) {
arguments.print
.text(
"#getIndicator( "passed" )#Passed",
COLOR.PASS
Expand Down Expand Up @@ -242,7 +246,7 @@ component {
required verbose
){
// Return if not in verbose mode nd no errors
if ( ( arguments.suiteStats.totalFail + arguments.suiteStats.totalError ) == 0 && !verbose ) {
if ( ( arguments.suiteStats.totalFail + arguments.suiteStats.totalError ) == 0 && !arguments.verbose ) {
return false;
}

Expand All @@ -264,7 +268,7 @@ component {
listFindNoCase(
"failed,exception,error",
local.thisSpec.status
) == 0 && !verbose
) == 0 && !arguments.verbose
) {
continue;
}
Expand Down Expand Up @@ -318,7 +322,7 @@ component {

// code print for first stack frame if supported by the CFML engine
if ( arguments.index == 1 && item.keyExists( "codePrintPlain" ) ) {
variables.print
arguments.print
.line()
.line(
"#repeatString( " ", level + 2 )##item.codePrintPlain.replace(
Expand All @@ -340,8 +344,8 @@ component {
local.nestedSuite,
arguments.bundleStats,
arguments.level + 1,
print,
verbose
arguments.print,
arguments.verbose
)
printedAtLeastOneLine = printedAtLeastOneLine || didPrint;
}
Expand Down