fix: preserve Robot Framework suite hierarchy when registering tests#488
Merged
Conversation
2 tasks
Robot Framework invokes start_suite for every suite in the run, from root down to the leaves. The previous implementation walked the full sub-tree on each invocation with parent_suites reset to empty, so the last (leaf) call overwrote each test's hierarchy with just the leaf suite name. As a result, Qase received only the deepest folder. Extract tests only on the root start_suite call (suite.parent is None) so each test keeps its full path from the run root. Closes #486.
Restoring the full Robot Framework suite hierarchy changes the location where reported test cases land in Qase, which can break existing projects that were built against the old flattened layout. Bump the major version and document the migration path.
8b2826b to
d9b030a
Compare
…rchy The previous expected file was generated under the bug where only the leaf suite was reported. Now that the listener preserves the full hierarchy from the run root, the validator receives the directory-level "Tests" suite as data[0] and the file-level "Steps" suite as data[1], matching the layout used by the pytest and tavern expected files. Signatures move from "<id>::steps::<name>" to "<id>::tests::steps::<name>" because they include every suite in order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
start_suiteis invoked by Robot Framework for every suite (root → leaves). The previous implementation walked the full sub-tree on each invocation withparent_suitesreset to empty, so the last (leaf) call overwrote each test's hierarchy with just the leaf suite name.start_suitecall (suite.parent is None) so each test keeps its full path from the run root.Test plan
__extract_tests_with_suitescovering flat, nested, and multi-level scenarios.start_suitethat exercise the exact RF call order (root → child → leaf) and assert the full hierarchy survives.main(reproduces['Login']instead of['Tests', 'Account', 'Login']) and passes with the fix.pytest tests/→ 45 passed.