From 2fe0816bc714dd752592ac45c9a30e8bd23ef6f0 Mon Sep 17 00:00:00 2001 From: Shankari Date: Mon, 12 Aug 2024 12:31:42 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Copy/paste=20the=20actual=20tests?= =?UTF-8?q?=20from=20the=20failed=20CI=20run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- emission/tests/storageTests/TestTokenQueries.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/emission/tests/storageTests/TestTokenQueries.py b/emission/tests/storageTests/TestTokenQueries.py index 364806a5c..0200ca694 100644 --- a/emission/tests/storageTests/TestTokenQueries.py +++ b/emission/tests/storageTests/TestTokenQueries.py @@ -169,19 +169,23 @@ def test_run_script_show(self): esdt.insert({'token':'z'}) sp = subprocess.run(["python3", "bin/auth/insert_tokens.py", "--show"], capture_output=True) # The first message is displayed when we run tests locally - # The second is displayed when we run in the docker CI, since the `DB_HOST` is set to `db` + # The second is displayed when we run in the CI/CD, but with the local install + # The third is displayed when we run in the docker CI since the `DB_HOST` is set to `db` self.assertIn(sp.stdout, [b'Retrieved config {\'DB_HOST\': \'localhost\', \'DB_RESULT_LIMIT\': 250000}\nURL not formatted, defaulting to "Stage_database"\nConnecting to database URL localhost\nx\ny\nz\n', - b'Config file not found, returning a copy of the environment variables instead...\nRetrieved config {\'DB_HOST\': \'db\', \'DB_RESULT_LIMIT\': 250000}\nURL not formatted, defaulting to "Stage_database"\nConnecting to database URL db\nx\ny\nz\n' + b'Config file not found, returning a copy of the environment variables instead...\nRetrieved config {\'PYTHONPATH\': \'.\', \'PATH\': \'/home/runner/miniconda-23.5.2/envs/emissiontest/bin:/home/runner/miniconda-23.5.2/condabin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/runner/.dotnet/tools\', \'LC_CTYPE\': \'C.UTF-8\'}\nURL not formatted, defaulting to "Stage_database"\nConnecting to database URL localhost\nx\ny\nz\n', + b'Config file not found, returning a copy of the environment variables instead...\nRetrieved config {\'PYTHONPATH\': \'.\', \'DB_HOST\': \'db\', \'PATH\': \'/root/miniconda-23.5.2/envs/emissiontest/bin:/root/miniconda-23.5.2/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\', \'LC_CTYPE\': \'C.UTF-8\'}\nURL not formatted, defaulting to "Stage_database"\nConnecting to database URL db\nx\ny\nz\n' ]) def test_run_script_empty(self): sp = subprocess.run(["python3", "bin/auth/insert_tokens.py"], capture_output=True) # The first message is displayed when we run tests locally - # The second is displayed when we run in the docker CI, since the `DB_HOST` is set to `db` + # The second is displayed when we run in the CI/CD, but with the local install + # The third is displayed when we run in the docker CI since the `DB_HOST` is set to `db` self.assertIn(sp.stdout, [b'Retrieved config {\'DB_HOST\': \'localhost\', \'DB_RESULT_LIMIT\': 250000}\nURL not formatted, defaulting to "Stage_database"\nConnecting to database URL localhost\nPlease provide the script with an argument. Use the "--help" option for more details\n', - b'Config file not found, returning a copy of the environment variables instead...\nRetrieved config {\'DB_HOST\': \'db\', \'DB_RESULT_LIMIT\': 250000}\nURL not formatted, defaulting to "Stage_database"\nConnecting to database URL db\nPlease provide the script with an argument. Use the "--help" option for more details\n' + b'Config file not found, returning a copy of the environment variables instead...\nRetrieved config {\'PYTHONPATH\': \'.\', \'PATH\': \'/home/runner/miniconda-23.5.2/envs/emissiontest/bin:/home/runner/miniconda-23.5.2/condabin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/runner/.dotnet/tools\', \'LC_CTYPE\': \'C.UTF-8\'}\nURL not formatted, defaulting to "Stage_database"\nConnecting to database URL localhost\nPlease provide the script with an argument. Use the "--help" option for more details\n', + b'Config file not found, returning a copy of the environment variables instead...\nRetrieved config {\'PYTHONPATH\': \'.\', \'DB_HOST\': \'db\', \'PATH\': \'/root/miniconda-23.5.2/envs/emissiontest/bin:/root/miniconda-23.5.2/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\', \'LC_CTYPE\': \'C.UTF-8\'}\nURL not formatted, defaulting to "Stage_database"\nConnecting to database URL db\nPlease provide the script with an argument. Use the "--help" option for more details\n' ]) #test that no two options can be used together