Support fetching results from ReportPortal#1
Open
therazix wants to merge 2 commits into
Open
Conversation
70c96e8 to
b6ee245
Compare
LecrisUT
approved these changes
Jul 8, 2026
| results_path = _resolve_results_path(plan, input_path, run_workdir) | ||
| results = _load_results(results_path, plan.name) | ||
| if not plan.discover.tests: | ||
| continue |
There was a problem hiding this comment.
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."
| if page >= page_info.get("totalPages", 1): | ||
| break | ||
| page += 1 | ||
| return {result.uuid: ReportPortalResult.model_validate(result) for result in results} |
There was a problem hiding this comment.
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'
b6ee245 to
e27760d
Compare
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.
Adds support for loading test results from ReportPortal. When
--use-reportportalis passed tofilter-tests, results are fetched from allreportportalreport phases in the recipe instead of localresults.yamlfiles. Plans without a reportportal report phase use the localresults.yamlfile as usual. Thelaunch-uuidand related fields are stripped from the output recipe so that a subsequent rerun creates a new launch.Resolves teemtee/tmt#4828