Skip to content

Commit

Permalink
Added a unit test test_love_stress.py for the kubernetes location.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbovill committed Nov 3, 2023
1 parent 9d22395 commit a951d9d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test_love_stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,32 @@ async def test_love_stress(self) -> None:
# Assert location is correct.
self.assertEqual(script_config["location"], "love01.ls.lsst.org")

async def test_love_stress_on_k8s(self) -> None:
"""Execute the LoveStress integration test script on the kubernetes
LOVE instance, which runs the
ts_externalscripts/make_love_stress_tests.py script.
Use the configuration stored in the love_stress_configs.py module.
"""
# Instantiate the LoveStress integration tests.
script_class = LoveStressTest(test_env="bts", k8s="--k8s")
# Get number of scripts and the configuration.
num_scripts = len(script_class.scripts)
script_config = yaml.safe_load(script_class.configs[0])
print(
f"LOVE Stress Test; running {num_scripts} scripts"
f" on the BTS environment, with this configuration: \n"
f"{script_config}"
)
# Execute the scripts.
await script_class.run()
# Assert script was added to ScriptQueue.
self.assertEqual(len(self.controller.queue_list), num_scripts)
# Assert scripts passed.
self.assertEqual(script_class.script_states, [8])
# Assert location is correct.
self.assertEqual(script_config["location"], "https://base-lsp.lsst.codes/love")

async def asyncTearDown(self) -> None:
await self.controller.close()
await self.controller.done_task

0 comments on commit a951d9d

Please sign in to comment.