Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.require does not work with context.distro #2905

Open
LecrisUT opened this issue May 5, 2024 · 2 comments
Open

test.require does not work with context.distro #2905

LecrisUT opened this issue May 5, 2024 · 2 comments

Comments

@LecrisUT
Copy link
Contributor

LecrisUT commented May 5, 2024

In a test's fmf file I was trying:

require:
  - python3-pytest
  - python3-pytest-check
  - python3-flexmock
test: python3 -m pytest

adjust:
  when: distro == ubuntu
  require-:
    - python3-pytest-check
    - python3-flexmock

But this does not seem to work: LecrisUT/tmt-cmake#6

It doesn't seem to be the syntax since the same when: distro == ubuntu is in the tests with the prepare. But discover is done even before provision so there is no valid context for distro to be able to be used at that point.

@lukaszachy
Copy link
Collaborator

lukaszachy commented May 7, 2024

Context has to be defined by user (tmt -c CONTEXT ...) or in plan (context attribute). No autodetection happens

@LecrisUT
Copy link
Contributor Author

LecrisUT commented May 7, 2024

That would work for testing-farm, but what about local runners with provision.how = local, or even with provision.how = container. Manual runs would not set context, so shouldn't that affect prepare step?

I thought the issue here is only with steps before provision

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants