Skip to content

Fix recipe generation and loading#4807

Open
therazix wants to merge 4 commits intomainfrom
fvagner-recipe-fixes
Open

Fix recipe generation and loading#4807
therazix wants to merge 4 commits intomainfrom
fvagner-recipe-fixes

Conversation

@therazix
Copy link
Copy Markdown
Contributor

@therazix therazix commented Apr 20, 2026

This PR addresses the following issues in the recipe feature:

  • added missing to_spec/to_minimal_spec methods to the ReportPortal plugin.
  • recipe loading now works even when the current working directory does not contain an fmf tree, by creating a fake tree during loading.

Blocking: https://gitlab.cee.redhat.com/fvagner/tmt-recipe-tool/-/merge_requests/1

Pull Request Checklist

  • implement the feature

@therazix therazix added ci | full test Pull request is ready for the full test execution area | recipe Related to the tmt recipe handling labels Apr 20, 2026
@therazix therazix requested a review from 4N0body5 as a code owner April 20, 2026 09:24
@github-project-automation github-project-automation bot moved this to backlog in planning Apr 20, 2026
@therazix therazix force-pushed the fvagner-recipe-fixes branch from 7f66223 to ac92ce2 Compare April 20, 2026 09:25
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request transitions the recipe system to use absolute paths for results and refactors the RecipeManager to handle fmf tree creation internally. It also adds custom serialization for ReportPortal report data to ensure correct formatting of log limits and patterns. A suggestion was made to remove a redundant tree check in tmt/base/core.py to support recipe loading in standalone environments where a tree might not yet exist.

Comment thread tmt/base/core.py Outdated
@therazix therazix added the status | blocking other work An important pull request, blocking other pull requests or issues label Apr 20, 2026
@therazix therazix moved this from backlog to review in planning Apr 20, 2026
@psss psss added this to the 1.72 milestone Apr 20, 2026
@tcornell-bus tcornell-bus self-assigned this Apr 20, 2026
Comment thread tmt/recipe.py
Comment thread spec/recipe.fmf Outdated
@tcornell-bus
Copy link
Copy Markdown
Contributor

tcornell-bus commented Apr 20, 2026

I tried to verify the fix by doing a basic tmt run via container.

Then I moved into a blank directory with no fmf tree and tried to run with the recipe file:
(tmt version: 1.71.0)

tcornell ~/tmp $ tmt run -vvv --recipe /var/tmp/tmt/run-063/recipe.yaml

No metadata found in the '.' directory. Use 'tmt init' to get started.

The exception was caused by 1 earlier exceptions

Cause number 1:

    Unable to find tree root for '/home/tcornell/tmp'.

(PR)

(dev) tcornell ~/tmp $  tmt run -vvv --recipe /var/tmp/tmt/run-063/recipe.yaml

[...]

    execute
        queued execute tasks
            #1: default-0 on default-0
        
        execute task #1: default-0 on default-0
        how: tmt
        order: 50
        ignore-duration: false
        exit-first: false
            test: Concise summary describing what the test does
                duration deadline: 300 seconds, at 16:23:03 2026-04-20 UTC
                cmd: ./test.sh
                stdout: ./tmt-test-wrapper-inner.sh-smoke-1-default-0-default-0: line 1: ./test.sh: No such file or directory
                00:00:00 errr /smoke (on default-0) [1/1]
                    Note: beakerlib: TestResults FileError

    
        summary: 1 test executed

Looks like it made the fake tree, but the tree does not have the supporting test files.
When I execute the same command in the original fmf root directory, it runs fine.

Am I reproducing this correctly?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure if this PR is supposed to fix this or not, but I did a tmt run with report --how reportportal --project <my_project> and it made the recipe.yaml file with the key/values in the to_spec()\to_minimal_spec() functions. Then I tried loading that same recipe file (in the fmf root directory), and I got an exception:

/plans/all
summary: Run all tests

plan failed.

The exception was caused by 1 earlier exceptions

Cause number 1:

    cannot represent an object: {1: '<some-hash>'}

Where {1: '<some-hash>'} is the reportportal test-uuids value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area | recipe Related to the tmt recipe handling ci | full test Pull request is ready for the full test execution status | blocking other work An important pull request, blocking other pull requests or issues

Projects

Status: review

Development

Successfully merging this pull request may close these issues.

5 participants