From d46c935357f0c559289245b9e2b25c8cfaf9d831 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Fri, 9 Feb 2024 09:08:07 -0500 Subject: [PATCH] tests: Correct tap_generator skip() when count is greater than 1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Issue observed ============== Output when skipping multiple was incorrectly printing the test case number, eg. ``` ok 3 - Start session `session_ldr8cxix` 41 ok 4 # Skip: Test application 'gen-ust-events-constructor/gen-ust-events-constructor-so' not found ok 6 # Skip: Test application 'gen-ust-events-constructor/gen-ust-events-constructor-so' not found ok 8 # Skip: Test application 'gen-ust-events-constructor/gen-ust-events-constructor-so' not found ``` Cause ===== The `test_number` was adding the current index to the already modified `self._last_test_case_id`. Solution ======== Use `self._last_test_case_id` with no changes. Known drawbacks =============== None. Change-Id: I8ff16b83619cf6e6db2636eeccd58725cc03d0f8 Signed-off-by: Kienan Stewart Signed-off-by: Jérémie Galarneau --- tests/utils/lttngtest/tap_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils/lttngtest/tap_generator.py b/tests/utils/lttngtest/tap_generator.py index 75960aece..c9bd8edad 100644 --- a/tests/utils/lttngtest/tap_generator.py +++ b/tests/utils/lttngtest/tap_generator.py @@ -130,7 +130,7 @@ class TapGenerator: self._last_test_case_id = self._last_test_case_id + 1 self._print( "ok {test_number} # Skip: {reason}".format( - reason=reason, test_number=(i + self._last_test_case_id) + reason=reason, test_number=(self._last_test_case_id) ) ) -- 2.34.1