Skip to content

Support fetching results from ReportPortal#1

Open
therazix wants to merge 2 commits into
mainfrom
fvagner-reportportal
Open

Support fetching results from ReportPortal#1
therazix wants to merge 2 commits into
mainfrom
fvagner-reportportal

Conversation

@therazix

@therazix therazix commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Adds support for loading test results from ReportPortal. When --use-reportportal is passed to filter-tests, results are fetched from all reportportal report phases in the recipe instead of local results.yaml files. Plans without a reportportal report phase use the local results.yaml file as usual. The launch-uuid and related fields are stripped from the output recipe so that a subsequent rerun creates a new launch.

Resolves teemtee/tmt#4828

@psss psss added this to planning Jun 23, 2026
@github-project-automation github-project-automation Bot moved this to backlog in planning Jun 23, 2026
@psss psss moved this from backlog to review in planning Jun 23, 2026
@therazix therazix force-pushed the fvagner-reportportal branch from 70c96e8 to b6ee245 Compare June 24, 2026 08:24
@happz happz added the enhancement New feature or request label Jun 24, 2026
Comment thread tmt-recipe-tool/tmt_recipe_tool/reportportal.py Outdated
Comment thread tmt-recipe-tool/tmt_recipe_tool/reportportal.py Outdated
results_path = _resolve_results_path(plan, input_path, run_workdir)
results = _load_results(results_path, plan.name)
if not plan.discover.tests:
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick message to the user here would be nice, just to say something like "Plan 'blah' does not contain tests and will not be included in the output recipe."

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in e27760d.

if page >= page_info.get("totalPages", 1):
break
page += 1
return {result.uuid: ReportPortalResult.model_validate(result) for result in results}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when I run tmt and it successfully makes a rp report, then I run:

$ tmt-recipe-tool --input /var/tmp/tmt/run-030/recipe.yaml --output run-030-recipe.yaml filter-tests 
--result error --use-reportportal
Traceback (most recent call last):
  File "/home/tcornell/.local/bin/tmt-recipe-tool", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3.14/site-packages/click/core.py", line 1514, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/click/core.py", line 1435, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.14/site-packages/click/core.py", line 1902, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/click/core.py", line 1298, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/click/core.py", line 853, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.14/site-packages/click/decorators.py", line 34, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/tcornell/.local/lib/python3.14/site-packages/tmt_recipe_tool/cli.py", line 97, in filter_tests
    ctx.obj["recipe"] = filter_recipe(
                        ~~~~~~~~~~~~~^
        ctx.parent.params["input"],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        use_reportportal=use_reportportal,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/tcornell/.local/lib/python3.14/site-packages/tmt_recipe_tool/recipe.py", line 103, in filter_recipe
    filter_tests_from_rp(plan.discover.tests, rp_phases, filter_results)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tcornell/.local/lib/python3.14/site-packages/tmt_recipe_tool/reportportal.py", line 143, in filter_tests_from_rp
    rp_results = _fetch_rp_results(
        session=session,
    ...<3 lines>...
        launch_id=_get_launch_id(session, headers, phase.api_version, phase),
    )
  File "/home/tcornell/.local/lib/python3.14/site-packages/tmt_recipe_tool/reportportal.py", line 116, in _fetch_rp_results
    return {result.uuid: ReportPortalResult.model_validate(result) for result in results}
            ^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'uuid'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e27760d.

@therazix therazix force-pushed the fvagner-reportportal branch from b6ee245 to e27760d Compare July 10, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: review

Development

Successfully merging this pull request may close these issues.

Add ReportPortal support to the recipe re-execution script

5 participants