Skip to content

Commit

Permalink
Merge pull request #155 from Ortus-Solutions/development
Browse files Browse the repository at this point in the history
v6.0.0
  • Loading branch information
lmajano authored Sep 27, 2024
2 parents 17248bd + b3052b1 commit bc7774b
Show file tree
Hide file tree
Showing 91 changed files with 3,173 additions and 1,624 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Daily Test BE Engines

on:
schedule:
- cron: '0 0 * * *' # Runs at 00:00 UTC every day

jobs:
tests:
uses: ./.github/workflows/tests.yml
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}

- name: Download build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: testbox
path: .tmp
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,29 @@ jobs:
strategy:
fail-fast: false
matrix:
commandbox_version: [ "6.0.1" ]
cfengine: [ "lucee@5", "lucee@6", "adobe@2018", "adobe@2021", "adobe@2023" ]
commandbox_version: [ "6.1.0-rc" ]
cfengine: [ "lucee@5", "lucee@6", "adobe@2021", "adobe@2023" ]
jdkVersion: [ "11" ]
experimental: [false]
include:
- cfengine: "boxlang@1"
commandbox_version: "6.1.0-rc"
jdkVersion: "21"
experimental: false
- cfengine: "lucee@6"
commandbox_version: "6.0.1"
commandbox_version: "6.1.0-rc"
jdkVersion: "17"
experimental: true
- cfengine: "adobe@2023"
commandbox_version: "6.0.1"
commandbox_version: "6.1.0-rc"
jdkVersion: "17"
experimental: true
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ matrix.jdkVersion }}
Expand All @@ -46,6 +50,7 @@ jobs:

- name: Install Dependencies
run: |
box install commandbox-boxlang
box install --production
- name: Start ${{ matrix.cfengine }}/${{ matrix.jdkVersion }} Server
Expand All @@ -65,14 +70,14 @@ jobs:

- name: Upload Test Results Artifacts
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: testbox-test-results-${{ matrix.cfengine }}-${{ matrix.jdkVersion }}
path: |
tests/results/**/*
- name: Failure Debugging Info
if: ${{ failure() }}
- name: Debugging Info
if: always()
run: |
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/settings.xml
.settings/
.engine/
grapher/**

# Test Results
tests/results/**
Expand All @@ -15,3 +16,8 @@ WEB-INF
build/build.number
.artifacts
.tmp

# Harness Testers
bx/testbox
bx/grapher
cfml/testbox
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"configurations": [
{
"program": "${command:CommandBox.startDebugServer}",
"name": "Debug CommandBox",
"type": "boxlang",
"request": "attach",
// make sure this is the same value you configured your server with
"serverPort": 8888
}
]
}
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ If you discover a security vulnerability, please send an email to the developmen

## Language Compatiblity

Please make sure your code runs on the following CFML Engines:
Please make sure your code runs on the following engines:

- BoxLang 1+
- Lucee 5+
- Adobe ColdFusion 2018+
- Adobe ColdFusion 2021+

## Coding Styles & Formatting

Expand Down
4 changes: 4 additions & 0 deletions bin/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env boxlang

// Go baby go!
new testbox.system.runners.BoxLangRunner().main();
2 changes: 2 additions & 0 deletions bin/run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Call the Runner
boxlang testbox/system/runners/BoxLangRunner.bx
4 changes: 1 addition & 3 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"TestBox",
"version":"5.4.0",
"version":"6.0.0",
"location":"https://downloads.ortussolutions.com/ortussolutions/testbox/@build.version@/[email protected]@.zip",
"author":"Ortus Solutions <[email protected]>",
"slug":"testbox",
Expand Down Expand Up @@ -56,11 +56,9 @@
"format:check":"cfformat check system/**/*.cfc,test-harness/**/*.cfc,tests/specs/**/*.cfc ./.cfformat.json",
"format:watch":"cfformat watch system/**/*.cfc,test-harness/**/*.cfc,tests/specs/**/*.cfc ./.cfformat.json",
"start:lucee":"server start [email protected]",
"start:2018":"server start [email protected]",
"start:2021":"server start [email protected]",
"start:2023":"server start [email protected]",
"log:lucee":"server log testbox-lucee@5 --follow",
"log:2018":"server log testbox-adobe@2018 --follow",
"log:2021":"server log testbox-adobe@2021 --follow",
"log:2023":"server log testbox-adobe@2023 --follow"
}
Expand Down
29 changes: 29 additions & 0 deletions bx/browser/Application.bx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright Since 2005 Ortus Solutions, Corp
* www.ortussolutions.com
* *************************************************************************************
*/
class {
this.name = "Test Browser";

// The mapping to easily access the tests
this.mappings[ "/tests" ] = getDirectoryFromPath( getCurrentTemplatePath() );
// The mapping to easily access the root application usually the parent folder
this.mappings[ "/root" ] = expandPath( "/../" );

// Any application settings go here

/**
* Executes BEFORE any runner or test requested.
*/
boolean function onRequestStart( String targetPage ){
return true;
}

/**
* Executes AFTER any runner or test requested.
*/
void function onRequestEnd( String targetPage ){
}

}
191 changes: 191 additions & 0 deletions bx/browser/index.bxm
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<bx:script>
// GLOBAL VARIABLES
ASSETS_DIR = expandPath( "/testbox/system/reports/assets" );
TESTBOX_VERSION = new testBox.system.TestBox().getVersion();
// TEST LOCATIONS -> UPDATE AS YOU SEE FIT
rootMapping = "/tests/";

// Local Variables
rootPath = expandPath( rootMapping );
targetPath = rootPath;

// Incoming Navigation
param name="url.path" default="";
if( len( url.path ) ){
targetPath = getCanonicalPath( rootpath & "/" & url.path );
// Avoid traversals, reset to root
if( !findNoCase( rootpath, targetPath ) ){
targetPath = rootpath;
}
}

// Get the actual execution path
executePath = rootMapping & ( len( url.path ) ? "/#url.path#" : "/" );
// Execute an incoming path
if( !isNull( url.action ) ){
if( directoryExists( targetPath ) ){
writeOutput( "#new testbox.system.TestBox( directory=executePath ).run()#" );
} else {
writeOutput( "<h2>Invalid Directory: #encodeForHTML( targetPath )#</h2>" );
}
abort;
}

// Get the tests to navigate
qResults = directoryList( targetPath, false, "query", "", "name" );

// Calculate the back navigation path
if( len( url.path ) ){
backPath = url.path.listToArray( "/\" );
backPath.pop();
backPath = backPath.toList( "/" );
}
</bx:script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="TestBox v#TESTBOX_VERSION#">
<title>TestBox Browser</title>
<bx:output>
<style>#fileRead( '#ASSETS_DIR#/css/main.css' )#</style>
<script>#fileRead( '#ASSETS_DIR#/js/jquery-3.3.1.min.js' )#</script>
<script>#fileRead( '#ASSETS_DIR#/js/popper.min.js' )#</script>
<script>#fileRead( '#ASSETS_DIR#/js/bootstrap.min.js' )#</script>
<script>#fileRead( '#ASSETS_DIR#/js/stupidtable.min.js' )#</script>
</bx:output>
</head>
<bx:output>
<body>

<div id="tb-runner" class="container">

<!--- Header --->
<div class="row">
<div class="col-md-4 text-center mx-auto">
<img class="mt-3" src="http://www.ortussolutions.com/__media/testbox-185.png" alt="TestBox" id="tb-logo"/>
<br>
v#TESTBOX_VERSION#
<br>
<a
href="index.cfm?action=runTestBox&path=#URLEncodedFormat( url.path )#"
target="_blank"
>
<button
class="btn btn-primary btn-sm my-1"
type="button">
Run All
</button>
</a>
</div>
</div>

<!--- Runners --->
<div class="row">
<div class="col-md-12 mb-4">
<h2>Availble Test Runners: </h2>
<p>
Below is a listing of the runners matching the "runner*.(cfm|bxm)" pattern.
</p>

<bx:set runners = directoryList( targetPath, false, "query", "runner*.cfm|runner*.bxm" )>
<bx:if runners.recordCount eq 0>
<p class="alert alert-warning">No runners found in this directory</p>
<bx:else>
<bx:loop query="runners">
<a
href="#runners.name#"
target="_blank"
<bx:if listLast( runners.name, "." ) eq "bxm">
class="btn btn-success btn-sm my-1 mx-1"
<bx:else>
class="btn btn-info btn-sm my-1 mx-1"
</bx:if>
>
#runners.name#
</a>
</bx:loop>
</bx:if>
</div>
</div>

<!--- Listing --->
<div class="row">
<div class="col-md-12">
<form name="runnerForm" id="runnerForm">
<input type="hidden" name="opt_run" id="opt_run" value="true">
<h2>TestBox Test Browser: </h2>
<p>
Below is a listing of the files and folders starting from your root <code>#rootMapping#</code>. You can click on individual tests in order to execute them
or click on the <strong>Run All</strong> button on your left and it will execute a directory runner from the visible folder.
</p>

<fieldset>
<legend>#targetPath.replace( rootPath, "" )#</legend>

<!--- Show Back If we are traversing --->
<bx:if len( url.path )>
<a href="index.bxm?path=#URLEncodedFormat( backPath )#">
<button type="button" class="btn btn-secondary btn-sm my-1">&##xAB; Back</button>
</a>
<br>
<hr>
</bx:if>

<bx:loop query="qResults">
<!--- Skip . folder file names and runners and Application.bx, cfc--->
<bx:if
refind( "^\.", qResults.name )
OR
( listLast( qresults.name, ".") eq "cfm" OR listLast( qresults.name, ".") eq "bxm" )
OR
( qResults.name eq "Application.cfc" OR qResults.name eq "Application.bx" )
>
<bx:continue>
</bx:if>

<bx:if qResults.type eq "Dir">
<a
class="btn btn-secondary btn-sm my-1"
href="index.bxm?path=#urlEncodedFormat( url.path & "/" & qResults.name )#"
>
&##x271A; #qResults.name#
</a>
<br />
<bx:elseif listLast( qresults.name, ".") eq "cfm" || listLast( qresults.name, ".") eq "bxm">
<a
class="btn btn-primary btn-sm my-1"
href="#executePath & "/" & qResults.name#"
target="_blank"
>
#qResults.name#
</a>
<br />
<bx:elseif
listLast( qresults.name, ".") eq "cfc" || listLast( qresults.name, ".") eq "bx"
>
<a
<bx:if listLast( qresults.name, ".") eq "bx">
data-bx="true"
class="btn btn-success btn-sm my-1"
<bx:else>
data-bx="false"
class="btn btn-info btn-sm my-1"
</bx:if>
href="#executePath & "/" & qResults.name#?method=runRemote"
target="_blank"
>
#qResults.name#
</a>
<br />
</bx:if>
</bx:loop>
</fieldset>
</form>
</div>
</div>
</div>

</body>
</html>
</bx:output>
Loading

0 comments on commit bc7774b

Please sign in to comment.