From 380d85f4bdf1ae2e73b6e11d2a0cff38a654934c Mon Sep 17 00:00:00 2001 From: Sandro Campos Date: Tue, 6 Feb 2024 10:51:11 -0500 Subject: [PATCH 1/2] Add missing tests --- src/benchmarking_asv/example_module.py | 4 +++- tests/benchmarking_asv/test_example_module.py | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/benchmarking_asv/example_module.py b/src/benchmarking_asv/example_module.py index 65102fe..951e926 100644 --- a/src/benchmarking_asv/example_module.py +++ b/src/benchmarking_asv/example_module.py @@ -28,7 +28,9 @@ def meaning() -> int: def run_time_computation(): """Mock function for random time computation.""" - time.sleep(random.uniform(0, 4)) + sleep_time = random.uniform(0, 4) + time.sleep(sleep_time) + return sleep_time def run_mem_computation(): diff --git a/tests/benchmarking_asv/test_example_module.py b/tests/benchmarking_asv/test_example_module.py index 96acc2f..8c0ab54 100644 --- a/tests/benchmarking_asv/test_example_module.py +++ b/tests/benchmarking_asv/test_example_module.py @@ -13,3 +13,13 @@ def test_meaning() -> None: """Verify the output of the `meaning` function""" output = example_module.meaning() assert output == 42 + + +def test_run_time_computation() -> None: + output = example_module.run_time_computation() + assert 0 <= output <= 4 + + +def test_mem_computation() -> None: + output = example_module.run_mem_computation() + assert 0 <= len(output) <= 512 From 7716aede74d54acf520bec4e5a9d1146d040ec0d Mon Sep 17 00:00:00 2001 From: Sandro Campos Date: Tue, 6 Feb 2024 11:49:12 -0500 Subject: [PATCH 2/2] Fix name of branch for action-send-mail --- .github/workflows/smoke-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index db58154..cdfea6f 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -43,7 +43,7 @@ jobs: python -m pytest - name: Send status to author's email if: ${{ failure() }} && github.event_name != 'workflow_dispatch' }} # Only email if the workflow failed and was not manually started. Customize this as necessary. - uses: dawidd6/action-send-mail@main + uses: dawidd6/action-send-mail@master with: # Required mail server address if not connection_url: server_address: smtp.gmail.com