From 6fb3d26964416eb22c88176e94d69e80e47e7612 Mon Sep 17 00:00:00 2001 From: Gavin Date: Mon, 13 Jan 2025 14:51:00 -0800 Subject: [PATCH 1/2] Move test.cfg into the root directory --- .gitignore | 2 ++ README.md | 12 ++++-------- src/java/us/kbase/scripts/test/TestConfigHelper.java | 2 +- test_scripts/test.cfg.example => test.cfg.example | 0 test_scripts/py_module_tests/test_auth_client.py | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) rename test_scripts/test.cfg.example => test.cfg.example (100%) diff --git a/.gitignore b/.gitignore index cb44e9d..a9d42cc 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ src/java/us/kbase/mobu/git.properties /temp_test_files /test_scripts/ee_mock_service /lib/kbase_module_builder2.jar +/test.cfg +# old location of test.cfg /test_scripts/test.cfg /.coverage /coverage.xml diff --git a/README.md b/README.md index 3f06577..c975586 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,10 @@ Documentation in this readme is for developing the SDK codebase itself. If you w ## Running the tests -#### Python tests - -Copy `test_scripts/test.cfg.example` to `test.cfg` and fill it in appropriately, then - -``` -pipenv sync --dev # only needed on the first run or when the Pipfile.lock changes -pipenv run make test-python -``` +* Copy `test.cfg.example` to `test.cfg` and fill it in appropriately. +* `pipenv sync --dev` + * This only needs to be run prior to the first test run or when the Pipfile contents change. +* `pipenv run make test` ## Notes and references diff --git a/src/java/us/kbase/scripts/test/TestConfigHelper.java b/src/java/us/kbase/scripts/test/TestConfigHelper.java index 779ca45..af4e3e1 100644 --- a/src/java/us/kbase/scripts/test/TestConfigHelper.java +++ b/src/java/us/kbase/scripts/test/TestConfigHelper.java @@ -17,7 +17,7 @@ public class TestConfigHelper { private static AuthToken token2 = null; public static void init() throws Exception { - final Ini testini = new Ini(new File("test_scripts/test.cfg")); + final Ini testini = new Ini(new File("test.cfg")); for (Object key: testini.get(TEST_CFG).keySet()) { String prop = key.toString(); String value = testini.get(TEST_CFG, key); diff --git a/test_scripts/test.cfg.example b/test.cfg.example similarity index 100% rename from test_scripts/test.cfg.example rename to test.cfg.example diff --git a/test_scripts/py_module_tests/test_auth_client.py b/test_scripts/py_module_tests/test_auth_client.py index 4f279dd..b2542d0 100644 --- a/test_scripts/py_module_tests/test_auth_client.py +++ b/test_scripts/py_module_tests/test_auth_client.py @@ -29,7 +29,7 @@ class TestAuth(unittest.TestCase): @classmethod def setUpClass(cls): configfile = os.path.abspath(os.path.dirname( - os.path.abspath(__file__)) + '/../test.cfg') + os.path.abspath(__file__)) + '/../../test.cfg') print('Loading test config from ' + configfile) cfg = _ConfigParser() cfg.read(configfile) From 9f3977da64df45153afb493ad4a58fc65f297cf6 Mon Sep 17 00:00:00 2001 From: Gavin Date: Mon, 13 Jan 2025 15:02:15 -0800 Subject: [PATCH 2/2] Update GHA to account for test.cfg.example move oops --- .github/workflows/test.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c2bc955..9bf0b17 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,10 +60,9 @@ jobs: # set up test config cd $HOMEDIR - # TODO TEST move to root dir - cp test_scripts/test.cfg.example test_scripts/test.cfg - sed -i "s#^test.token=.*#test.token=$KBASE_CI_TOKEN#" test_scripts/test.cfg - sed -i "s#^test.token2=.*#test.token2=$KBASE_CI_TOKEN2#" test_scripts/test.cfg + cp test.cfg.example test.cfg + sed -i "s#^test.token=.*#test.token=$KBASE_CI_TOKEN#" test.cfg + sed -i "s#^test.token2=.*#test.token2=$KBASE_CI_TOKEN2#" test.cfg - name: Run tests shell: bash