Skip to content

Commit

Permalink
Merge pull request #7 from coldbox-modules/ci/addBoxlangToMatrix
Browse files Browse the repository at this point in the history
Ci/add boxlang to matrix
  • Loading branch information
jclausen authored Dec 11, 2024
2 parents 83f8d09 + 2cc8d58 commit 4970f77
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 13 deletions.
38 changes: 38 additions & 0 deletions .cfconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"adminPassword" : "coldbox",
"componentCacheEnabled":false,
"postParametersLimit" : 200,
"robustExceptionEnabled":true,
"saveClassFiles":false,
"systemErr":"System",
"systemOut":"System",
"thistimezone":"UTC",
"whitespaceManagement":"white-space-pref",
"debuggingEnabled":true,
"debuggingReportExecutionTimes":false,
"disableInternalCFJavaComponents":false,
"inspectTemplate":"always",
"requestTimeout":"0,0,0,90",
"datasources":{
"twilio-sdk":{
"bundleName": "${DB_BUNDLENAME}",
"bundleVersion": "${DB_BUNDLEVERSION}",
"blob":"true",
"class":"${DB_CLASS}",
"clob":"true",
"connectionLimit":"100",
"connectionTimeout":"1",
"custom":"useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC&useLegacyDatetimeCode=true&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true",
"database":"twilio-sdk",
"dbdriver":"MySQL",
"dsn":"jdbc:mysql://{host}:{port}/{database}",
"host":"${DB_HOST:127.0.0.1}",
"metaCacheTimeout":"60000",
"password":"${DB_PASSWORD}",
"port": "${DB_PORT:3306}",
"storage":"false",
"username": "${DB_USER:root}",
"validate":"false"
}
}
}
28 changes: 18 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@ jobs:
env:
DB_USER: root
DB_PASSWORD: root
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
cfengine: [ "lucee@5", "lucee@6", "adobe@2021", "adobe@2023" ]
coldboxVersion: [ "^6.0.0", "^7.0.0"]
experimental: [ false ]
include:
- coldboxVersion: "be"
cfengine: "boxlang@1"
experimental: true
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -73,6 +80,7 @@ jobs:
- name: Install Test Harness Dependencies
run: |
box package set dependencies.coldbox=${{ matrix.coldboxVersion }}
box install
- name: Start ${{ matrix.cfengine }} Server
Expand All @@ -82,12 +90,12 @@ jobs:
TWILIO_TEST_ACCOUNT_SID: ${{ secrets.TWILIO_TEST_ACCOUNT_SID }}
TWILIO_TEST_AUTHTOKEN: ${{ secrets.TWILIO_TEST_AUTHTOKEN }}
run: |
box server start cfengine=${{ matrix.cfengine }} port=49619 --noSaveSettings --debug
box server start serverConfigFile=server-${{ matrix.cfengine }}.json --noSaveSettings --debug
# Install Adobe 2021 cfpm modules
if [[ "${{ matrix.cfengine }}" == "adobe@2021" ]] ; then
box run-script install:2021
fi
curl http://127.0.0.1:49619
curl http://127.0.0.1:60299
- name: Run Tests
env:
Expand All @@ -100,17 +108,17 @@ jobs:
box testbox run --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: tests/results/**/*.xml
check_name: "${{ matrix.cfengine }} Test Results"
junit_files: tests/results/**/*.xml
check_name: "${{ matrix.cfengine }} ColdBox ${{ matrix.coldboxVersion }} Test Results"

- name: Upload Test Results to Artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4.4.3
with:
name: test-results-${{ matrix.cfengine }}
name: test-results-${{ matrix.cfengine }}-${{ matrix.coldboxVersion }}
path: |
tests/results/**/*
Expand All @@ -121,9 +129,9 @@ jobs:
- name: Upload Debug Logs To Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4.4.3
with:
name: Failure Debugging Info - ${{ matrix.cfengine }}
name: Failure Debugging Info - ${{ matrix.cfengine }} - ${{ matrix.coldboxVersion }}
path: |
.engine/**/logs/*
.engine/**/WEB-INF/cfusion/logs/*
Expand All @@ -137,6 +145,6 @@ jobs:
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
SLACK_ICON_EMOJI: ":bell:"
SLACK_MESSAGE: '${{ github.repository }} tests failed :cry:'
SLACK_TITLE: ${{ github.repository }} Tests For ${{ matrix.cfengine }} failed
SLACK_TITLE: ${{ github.repository }} Tests For ${{ matrix.cfengine }} with ColdBox ${{ matrix.coldboxVersion }} failed
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion models/TwilioClient.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ component singleton accessors="true" {
function getSMS( required string sid ) {
return newRequest()
.setMethod( "GET" )
.setUrl( "/Accounts/#variables.accountSID#/Messages/#arguments.sid#.json")
.setUrl( "/Accounts/#variables.accountSID#/Messages/#arguments.sid#.json" )
}

/**
Expand Down
29 changes: 29 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name":"twilio-sdk-adobe@2021",
"app":{
"serverHomeDirectory":".engine/adobe2021",
"cfengine":"adobe@2021"
},
"web":{
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"./",
"aliases":{
"/moduleroot/twilio-sdk":"./"
}
},
"jvm":{
"heapSize":"1024"
},
"openBrowser":"false",
"cfconfig":{
"file":".cfconfig.json"
},
"scripts":{
"onServerInstall":"cfpm install zip,debugger,mysql"
}
}
29 changes: 29 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name":"twilio-sdk-adobe@2023",
"app":{
"serverHomeDirectory":".engine/adobe2023",
"cfengine":"adobe@2023"
},
"web":{
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"./",
"aliases":{
"/moduleroot/twilio-sdk":"./"
}
},
"jvm":{
"heapSize":"1024"
},
"openBrowser":"false",
"cfconfig":{
"file":".cfconfig.json"
},
"scripts":{
"onServerInstall":"cfpm install zip,debugger,mysql"
}
}
36 changes: 36 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"app":{
"cfengine":"boxlang@be",
"serverHomeDirectory":".engine/boxlang"
},
"name":"twilio-sdk-boxlang@1",
"force":true,
"openBrowser":false,
"web":{
"directoryBrowsing":true,
"http":{
"port":"60299"
},
"rewrites":{
"enable":true
},
"webroot":".",
"aliases":{
"/moduleroot/twilio-sdk":"./"
}
},
"JVM":{
"heapSize":"1024",
"javaVersion":"openjdk21_jdk",
"args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999"
},
"cfconfig":{
"file":".cfconfig.json"
},
"env":{
"BOXLANG_DEBUG":true
},
"scripts":{
"onServerInitialInstall":"install bx-mail,bx-mysql,bx-derby,bx-compat-cfml@be,bx-unsafe-evaluate,bx-esapi --noSave"
}
}
10 changes: 10 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"web":{
"http":{
"port":"60299"
}
},
"app":{
"cfengine":"lucee@5"
}
}
10 changes: 10 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"web":{
"http":{
"port":"60299"
}
},
"app":{
"cfengine":"lucee@6"
}
}
8 changes: 6 additions & 2 deletions tests/specs/unit/SignatureTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ component extends="testbox.system.BaseSpec" {
"Digits": "1234"
};
var expectedSignature = "GvWf1cFY/Q7PnoempGyD5oXAezc=";
expect( validator.validate( expectedSignature, uri, formParams ) ).toBeTrue( "Signature should have validated correctly" );
expect( validator.validate( expectedSignature, uri, formParams ) ).toBeTrue(
"Signature should have validated correctly"
);
} );

it( "returns false for an invalid signature", function() {
Expand All @@ -29,7 +31,9 @@ component extends="testbox.system.BaseSpec" {
"Digits": "1234"
};
var invalidSignature = "invalid";
expect( validator.validate( invalidSignature, uri, formParams ) ).toBeFalse( "Signature should not have validated correctly" );
expect( validator.validate( invalidSignature, uri, formParams ) ).toBeFalse(
"Signature should not have validated correctly"
);
} );
} );
}
Expand Down

0 comments on commit 4970f77

Please sign in to comment.