From 3bbe9d2966283bf3b7368b905ad0f87ec52a807c Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Tue, 11 Jun 2024 19:59:37 +0200 Subject: [PATCH] use script-runner .CFconfig.json --- .github/workflows/coldbox.yml | 4 ++++ .github/workflows/masaCMS.yml | 1 + custom/coldbox/.CFconfig.json | 15 +++++++++++++++ custom/masacms/.CFconfig.json | 15 +++++++++++++++ custom/presidecms/tests/runtests.cfm | 15 ++++++++------- 5 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 custom/coldbox/.CFconfig.json create mode 100644 custom/masacms/.CFconfig.json diff --git a/.github/workflows/coldbox.yml b/.github/workflows/coldbox.yml index 51ac21a..7621ed4 100644 --- a/.github/workflows/coldbox.yml +++ b/.github/workflows/coldbox.yml @@ -18,6 +18,10 @@ jobs: with: repository: ColdBox/coldbox-platform path: src + - name: Copy custom test runner tweaks + run: | + cp _custom/custom/coldbox/.CFconfig.json . + rm -rf _custom - name: Set up JDK 11 uses: actions/setup-java@v4 with: diff --git a/.github/workflows/masaCMS.yml b/.github/workflows/masaCMS.yml index 45875b7..147ead4 100644 --- a/.github/workflows/masaCMS.yml +++ b/.github/workflows/masaCMS.yml @@ -23,6 +23,7 @@ jobs: path: _custom - name: Copy custom test runner tweaks run: | + cp _custom/custom/masacms/.CFconfig.json . cp -R _custom/custom/masacms/core/tests/* core/tests mkdir plugins cp _custom/custom/masacms/plugins/* plugins diff --git a/custom/coldbox/.CFconfig.json b/custom/coldbox/.CFconfig.json new file mode 100644 index 0000000..d48b511 --- /dev/null +++ b/custom/coldbox/.CFconfig.json @@ -0,0 +1,15 @@ +{ + "datasources": { + "coolblog" : { + "host":"localhost", + "type": "MySQL", + "dsn": "jdbc:mysql://{host}:{port}/{database}", + "class": "com.mysql.cj.jdbc.Driver", + "database": "coolblog", + "port": "3306", + "username": "coldbox", + "password": "coldbox" + } + } +} + diff --git a/custom/masacms/.CFconfig.json b/custom/masacms/.CFconfig.json new file mode 100644 index 0000000..c397fb8 --- /dev/null +++ b/custom/masacms/.CFconfig.json @@ -0,0 +1,15 @@ +{ + "datasources": { + "masacms" : { + "host":"localhost", + "type": "MySQL", + "dsn": "jdbc:mysql://{host}:{port}/{database}", + "class": "com.mysql.cj.jdbc.Driver", + "database": "masacms", + "port": "3306", + "username": "masacms", + "password": "masacms" + } + } +} + diff --git a/custom/presidecms/tests/runtests.cfm b/custom/presidecms/tests/runtests.cfm index aa86037..8561a91 100644 --- a/custom/presidecms/tests/runtests.cfm +++ b/custom/presidecms/tests/runtests.cfm @@ -3,15 +3,16 @@ scope = url.scope ?: "full"; directory = url.directory ?: ""; - configImport( - type: "server", - data: deserializeJSON(fileRead(expandpath(".cfconfig.json"))), - password="admin" - ); - + if (fileExists(expandpath(".cfconfig.json"))){ + configImport( + type: "server", + data: deserializeJSON(fileRead(expandpath(".cfconfig.json"))), + password="admin" + ); + } testbox = new testbox.system.TestBox( options={}, reporter=reporter, directory={ recurse = true - , mapping = Len( directory ) ? "unit.api.#directory#" : "unit" + , mapping = Len( directory ) ? directory : "unit" , filter = function( required path ){ if ( scope=="quick" ) { var excludes = [