From 0da8e86dd9b38a47d1bdad2c6879e454c31d87e4 Mon Sep 17 00:00:00 2001 From: swryan Date: Fri, 17 May 2024 10:24:50 -0400 Subject: [PATCH 1/4] upadte DeprecationsReport to handle SubTests --- testflo/deprecations.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/testflo/deprecations.py b/testflo/deprecations.py index 663e3eb..50f6518 100644 --- a/testflo/deprecations.py +++ b/testflo/deprecations.py @@ -16,10 +16,11 @@ def get_iter(self, input_iter): deprecations = {} - for test in input_iter: - for msg, locs in test.deprecations.items(): - deprecations[msg] = deprecations.get(msg, set()) | locs - yield test + for tests in input_iter: + for test in tests: + for msg, locs in test.deprecations.items(): + deprecations[msg] = deprecations.get(msg, set()) | locs + yield test report = self.generate_report(deprecations) From 7e98f4c855fff8a348cf500626271f8bed471754 Mon Sep 17 00:00:00 2001 From: swryan Date: Fri, 17 May 2024 11:21:08 -0400 Subject: [PATCH 2/4] set start_time for SubTests, update test workflow --- .github/workflows/test_workflow.yml | 8 +++++--- testflo/test.py | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 54f9b50..4e99d17 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -31,12 +31,12 @@ jobs: # test on Ubuntu - NAME: Ubuntu Baseline OS: ubuntu-latest - PY: '3.11' + PY: '3.12' # test on MacOS - NAME: MacOS Baseline OS: macos-latest - PY: '3.11' + PY: '3.12' runs-on: ${{ matrix.OS }} @@ -77,7 +77,7 @@ jobs: run: | cd $HOME - testflo testflo.tests || RC=$? + testflo testflo.tests -vs --show_skipped --durations=5 --durations-min=0 --deprecations_report dep.txt || RC=$? if [[ $RC -ne 1 ]]; then echo "Expected some tests to fail." @@ -104,6 +104,8 @@ jobs: exit 11 fi + grep "Deprecations Report" dep.txt + - name: Run tests in serial run: | cd $HOME diff --git a/testflo/test.py b/testflo/test.py index 425ed8a..b1e0641 100644 --- a/testflo/test.py +++ b/testflo/test.py @@ -341,11 +341,13 @@ def run(self, queue=None): else: stream_val = '' if ut_subtests: + end_time = time.perf_counter() for sub, err in ut_subtests: subtest = SubTest(sub._subDescription(), self.spec, self.options) subtest.status = status subtest.err_msg = stream_val + err - subtest.end_time = time.perf_counter() + subtest.start_time = self.start_time + subtest.end_time = end_time subtest.memory_usage = get_memory_usage() subs.append(subtest) else: From 58d78484697e8fe4fb3fd8f436e6fb59c7dddf7f Mon Sep 17 00:00:00 2001 From: swryan Date: Fri, 17 May 2024 12:01:23 -0400 Subject: [PATCH 3/4] update serial test script to match --- .github/workflows/test_workflow.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 4e99d17..36a1ea1 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -77,7 +77,7 @@ jobs: run: | cd $HOME - testflo testflo.tests -vs --show_skipped --durations=5 --durations-min=0 --deprecations_report dep.txt || RC=$? + testflo testflo.tests -vs --show_skipped --durations=5 --durations-min=0 --deprecations_report dep.txt || RC=$? if [[ $RC -ne 1 ]]; then echo "Expected some tests to fail." @@ -105,12 +105,13 @@ jobs: fi grep "Deprecations Report" dep.txt + rm dep.txt - name: Run tests in serial run: | cd $HOME - testflo -n 1 testflo.tests || RC=$? + testflo testflo.tests -vs --show_skipped --durations=5 --durations-min=0 --deprecations_report dep.txt || RC=$? if [[ $RC -ne 1 ]]; then echo "Expected some tests to fail." @@ -137,6 +138,9 @@ jobs: exit 11 fi + grep "Deprecations Report" dep.txt + rm dep.txt + - name: Notify slack of failure uses: act10ns/slack@v2.0.0 with: From a539776d370720ad1cd3dcccdb50e0cd3df712d7 Mon Sep 17 00:00:00 2001 From: swryan Date: Fri, 17 May 2024 12:04:21 -0400 Subject: [PATCH 4/4] -n 1 --- .github/workflows/test_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 36a1ea1..379ca92 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -111,7 +111,7 @@ jobs: run: | cd $HOME - testflo testflo.tests -vs --show_skipped --durations=5 --durations-min=0 --deprecations_report dep.txt || RC=$? + testflo testflo.tests -n 1 -vs --show_skipped --durations=5 --durations-min=0 --deprecations_report dep.txt || RC=$? if [[ $RC -ne 1 ]]; then echo "Expected some tests to fail."