-
Notifications
You must be signed in to change notification settings - Fork 125
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
plugin: Cannot define parmeterless plugins #2827
Comments
That’s weird. We can see |
It is in the current iteration of LecrisUT/tmt-cmake#5 (but also on the |
Here's a log example running: prepare:
how: cmake
# build_dir: build
execute:
script: /bin/true ( $ tmt run -ra --log-topic=cli-invocations provision --how local
/var/tmp/tmt/run-067
warn: /plan:prepare - {'how': 'cmake'} is not valid under any of the given schemas
/plan
discover
how: shell
summary: 1 test selected
provision
queued provision.provision task #1: default-0
provision.provision task #1: default-0
how: local
primary address: localhost
multihost name: default-0
arch: x86_64
distro: Fedora Linux 40 (KDE Plasma Prerelease)
summary: 1 guest provisioned
prepare
queued push task #1: push to default-0
push task #1: push to default-0
queued prepare task #1: requires on default-0
prepare task #1: requires on default-0
how: install
summary: Install required packages
name: requires
where: default-0
package: /usr/bin/flock
queued pull task #1: pull from default-0
pull task #1: pull from default-0
summary: 1 preparation applied
execute
queued execute task #1: default-0 on default-0
execute task #1: default-0 on default-0
how: tmt
progress:
summary: 1 test executed
report
how: display
summary: 1 test passed
finish
summary: 0 tasks completed
total: 1 test passed |
Coincidentally I hit the same problem and it is caused by https://github.com/teemtee/tmt/blame/43ac6e339dc4ee8e41a1c8fdcf8f7b91e1e7d0a8/tmt/steps/prepare/__init__.py#L147 Currently trying to remember why such line was added. Workaround for now can be to define own in plugins dataclass
|
I think the only reasonable usage is in Lines 1461 to 1468 in 43ac6e3
But over there also I think it should be after the |
I believe the check for empty data is included in order to drop the default empty phase which is created here: Lines 382 to 384 in 43ac6e3
And that one is created so that there's something which can be overridden from the command line, for example:
When run with the following plan: provision:
how: container
execute:
script: tree It would be better to create a new phase object only if the respective command line option is provided. |
You mean that there is effectively a pre-existing: prepare:
how: install
packages: [ ] In the CLI, doesn't the |
It's more like a |
Here's an example:
The second prepare is not parsed even though I could define defaults for all values
Edit: It seems that adding any(nope)default_factory
variable makes it work 🤷The text was updated successfully, but these errors were encountered: