tests: Correct tap_generator skip() when count is greater than 1
authorKienan Stewart <kstewart@efficios.com>
Fri, 9 Feb 2024 14:08:07 +0000 (09:08 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 7 Mar 2024 17:12:12 +0000 (12:12 -0500)
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 <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/utils/lttngtest/tap_generator.py

index 75960aece6c25dcfedc51a224dc58db12ea149d6..c9bd8edaddd14b31992e1dbd9338ba3bc3e18f63 100644 (file)
@@ -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)
                 )
             )
 
This page took 0.025803 seconds and 4 git commands to generate.