From 087c0fdf9886493f59a605b748c7c5cce42fb07e Mon Sep 17 00:00:00 2001 From: Oscar Tisnado <68830577+otisnado@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:14:42 -0600 Subject: [PATCH 1/7] add boxlang to matrix --- .cfconfig.json | 38 +++++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 12 ++++++++++-- server-boxlang@1.json | 36 +++++++++++++++++++++++++++++++++++ server-lucee@5.json | 10 ++++++++++ 4 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 .cfconfig.json create mode 100644 server-boxlang@1.json create mode 100644 server-lucee@5.json diff --git a/.cfconfig.json b/.cfconfig.json new file mode 100644 index 0000000..8d62e40 --- /dev/null +++ b/.cfconfig.json @@ -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" + } + } +} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 988a4a0..0d5b5fc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 @@ -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 }} --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: diff --git a/server-boxlang@1.json b/server-boxlang@1.json new file mode 100644 index 0000000..158adbb --- /dev/null +++ b/server-boxlang@1.json @@ -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" + } +} \ No newline at end of file diff --git a/server-lucee@5.json b/server-lucee@5.json new file mode 100644 index 0000000..8e34d70 --- /dev/null +++ b/server-lucee@5.json @@ -0,0 +1,10 @@ +{ + "web":{ + "http":{ + "port":"60299" + } + }, + "app":{ + "cfengine":"lucee@5" + } +} \ No newline at end of file From 4f95e321c902346ce1a04e9606103d6bb76e1d72 Mon Sep 17 00:00:00 2001 From: otisnado Date: Tue, 10 Dec 2024 22:15:25 +0000 Subject: [PATCH 2/7] Apply cfformat changes --- models/TwilioClient.cfc | 2 +- tests/specs/unit/SignatureTest.cfc | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/models/TwilioClient.cfc b/models/TwilioClient.cfc index 27c1671..2bb921d 100644 --- a/models/TwilioClient.cfc +++ b/models/TwilioClient.cfc @@ -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" ) } /** diff --git a/tests/specs/unit/SignatureTest.cfc b/tests/specs/unit/SignatureTest.cfc index 75265a3..61b0929 100644 --- a/tests/specs/unit/SignatureTest.cfc +++ b/tests/specs/unit/SignatureTest.cfc @@ -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() { @@ -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" + ); } ); } ); } From 8e31c158e2f5fc223bb50129a0c5628645193a21 Mon Sep 17 00:00:00 2001 From: Oscar Tisnado <68830577+otisnado@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:36:28 -0600 Subject: [PATCH 3/7] update deprecated action version --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d5b5fc..caaba5e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -116,7 +116,7 @@ jobs: - 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 }} path: | @@ -129,7 +129,7 @@ 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 }} path: | From 64eb306ccc9c7478616d76ce4977b06c28e0881e Mon Sep 17 00:00:00 2001 From: Oscar Tisnado <68830577+otisnado@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:50:56 -0600 Subject: [PATCH 4/7] add missing serverConfigFiles and missing extension --- .github/workflows/tests.yml | 2 +- server-adobe@2021.json | 29 +++++++++++++++++++++++++++++ server-adobe@2023.json | 29 +++++++++++++++++++++++++++++ server-lucee@6.json | 10 ++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 server-adobe@2021.json create mode 100644 server-adobe@2023.json create mode 100644 server-lucee@6.json diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index caaba5e..d2a795a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -90,7 +90,7 @@ jobs: TWILIO_TEST_ACCOUNT_SID: ${{ secrets.TWILIO_TEST_ACCOUNT_SID }} TWILIO_TEST_AUTHTOKEN: ${{ secrets.TWILIO_TEST_AUTHTOKEN }} run: | - box server start serverConfigFile=server-${{ matrix.cfengine }} --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 diff --git a/server-adobe@2021.json b/server-adobe@2021.json new file mode 100644 index 0000000..99ba42d --- /dev/null +++ b/server-adobe@2021.json @@ -0,0 +1,29 @@ +{ + "name":"twilio-sdk-adobe@2021", + "app":{ + "serverHomeDirectory":".engine/adobe2021", + "cfengine":"adobe@2021" + }, + "web":{ + "http":{ + "port":"60299" + }, + "rewrites":{ + "enable":"true" + }, + "webroot":"test-harness", + "aliases":{ + "/moduleroot/twilio-sdk":"./" + } + }, + "jvm":{ + "heapSize":"1024" + }, + "openBrowser":"false", + "cfconfig":{ + "file":".cfconfig.json" + }, + "scripts":{ + "onServerInstall":"cfpm install zip,debugger,mysql" + } +} diff --git a/server-adobe@2023.json b/server-adobe@2023.json new file mode 100644 index 0000000..3b086db --- /dev/null +++ b/server-adobe@2023.json @@ -0,0 +1,29 @@ +{ + "name":"twilio-sdk-adobe@2023", + "app":{ + "serverHomeDirectory":".engine/adobe2023", + "cfengine":"adobe@2023" + }, + "web":{ + "http":{ + "port":"60299" + }, + "rewrites":{ + "enable":"true" + }, + "webroot":"test-harness", + "aliases":{ + "/moduleroot/twilio-sdk":"./" + } + }, + "jvm":{ + "heapSize":"1024" + }, + "openBrowser":"false", + "cfconfig":{ + "file":".cfconfig.json" + }, + "scripts":{ + "onServerInstall":"cfpm install zip,debugger,mysql" + } +} diff --git a/server-lucee@6.json b/server-lucee@6.json new file mode 100644 index 0000000..68ee2e5 --- /dev/null +++ b/server-lucee@6.json @@ -0,0 +1,10 @@ +{ + "web":{ + "http":{ + "port":"60299" + } + }, + "app":{ + "cfengine":"lucee@6" + } +} \ No newline at end of file From 987ea118844e94bdf5d995fd6bdfa670c14bcfcc Mon Sep 17 00:00:00 2001 From: Oscar Tisnado <68830577+otisnado@users.noreply.github.com> Date: Wed, 11 Dec 2024 08:32:45 -0600 Subject: [PATCH 5/7] use repository base directory as webroot --- server-adobe@2021.json | 2 +- server-adobe@2023.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server-adobe@2021.json b/server-adobe@2021.json index 99ba42d..3b5321d 100644 --- a/server-adobe@2021.json +++ b/server-adobe@2021.json @@ -11,7 +11,7 @@ "rewrites":{ "enable":"true" }, - "webroot":"test-harness", + "webroot":"./", "aliases":{ "/moduleroot/twilio-sdk":"./" } diff --git a/server-adobe@2023.json b/server-adobe@2023.json index 3b086db..fb1a0c8 100644 --- a/server-adobe@2023.json +++ b/server-adobe@2023.json @@ -11,7 +11,7 @@ "rewrites":{ "enable":"true" }, - "webroot":"test-harness", + "webroot":"./", "aliases":{ "/moduleroot/twilio-sdk":"./" } From 63e99c386fd274ef34e80e0f5ab63ce71e2f4183 Mon Sep 17 00:00:00 2001 From: Oscar Tisnado <68830577+otisnado@users.noreply.github.com> Date: Wed, 11 Dec 2024 08:33:51 -0600 Subject: [PATCH 6/7] set correct names to artifact --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d2a795a..d5f57c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -112,13 +112,13 @@ jobs: if: always() with: files: tests/results/**/*.xml - check_name: "${{ matrix.cfengine }} Test Results" + check_name: "${{ matrix.cfengine }} ColdBox ${{ matrix.coldboxVersion }} Test Results" - name: Upload Test Results to Artifacts if: always() uses: actions/upload-artifact@v4.4.3 with: - name: test-results-${{ matrix.cfengine }} + name: test-results-${{ matrix.cfengine }}-${{ matrix.coldboxVersion }} path: | tests/results/**/* @@ -131,7 +131,7 @@ jobs: if: ${{ failure() }} 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/* @@ -145,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 }} \ No newline at end of file From 2cc8d5886a27112420b2429233324a7b25725e1c Mon Sep 17 00:00:00 2001 From: Oscar Tisnado <68830577+otisnado@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:17:41 -0600 Subject: [PATCH 7/7] upgrade EnricoMi/publish-unit-test-result-action action version --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d5f57c6..17146fe 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -108,10 +108,10 @@ 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 + junit_files: tests/results/**/*.xml check_name: "${{ matrix.cfengine }} ColdBox ${{ matrix.coldboxVersion }} Test Results" - name: Upload Test Results to Artifacts