You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't checked that it works, but my understanding is that this is one way to check the plugin type of a particular step:
# Check that there is a prepare CMake stepifnotany(
phaseforstepinself.step.plan.steps()
ifisinstance(step, Prepare)
forphaseinstep.phases(tmt_cmake.prepare.PrepareCMake)
):
msg="No CMake prepare step found"raisetmt.utils.SpecificationError(msg)
Two simplifications that can be done here:
tmt.plan.steps accepting classes similar to the step.phases
Have a tmt.plan.phases that wraps the generator above. Maybe these should be as mixin since the tmt.base.Plan is quite lengthy. Although that would make it less navigable?
Second question for this, where should such a check be. I believe the most appropriate place so far is in wake? It should be in a place that:
Guarantees all steps and phases are defined
Is run for lint/show steps as well.
Edit: Tried it out and wake does not affect those cases, so it might need to be spread out different entry points
I have then tried to add it to show, but it seems in the current version show does not error when bogus data is given, so I should not use raise for that case. Right now I am using using try...except and redirecting the output to warning. Thinking of doing the same for wake but redirecting to fail. Technically this should be handled by the schema validation, but it is not portable to external plugins yet.
I think the thing that confuses me here is how one should add messages and raise, so as to not affect the remainder of the execution. E.g. if I raise within show or wake, the execution of the remainder of the tmt show/run fails, i.e. other tmt plans are stopped and do not execute.
Update this does not work :(. The phases are not available at the wake/show stage and not all steps are computed at that point. The closest I could get is to check step.data type
The text was updated successfully, but these errors were encountered:
I haven't checked that it works, but my understanding is that this is one way to check the plugin type of a particular step:
Two simplifications that can be done here:
tmt.plan.steps
acceptingclasses
similar to thestep.phases
tmt.plan.phases
that wraps the generator above. Maybe these should be as mixin since thetmt.base.Plan
is quite lengthy. Although that would make it less navigable?Second question for this, where should such a check be. I believe the most appropriate place so far is in
wake
? It should be in a place that:Edit: Tried it out and
wake
does not affect those cases, so it might need to be spread out different entry pointsI have then tried to add it to
show
, but it seems in the current versionshow
does not error when bogus data is given, so I should not useraise
for that case. Right now I am using usingtry...except
and redirecting the output to warning. Thinking of doing the same forwake
but redirecting tofail
. Technically this should be handled by the schema validation, but it is not portable to external plugins yet.I think the thing that confuses me here is how one should add messages and raise, so as to not affect the remainder of the execution. E.g. if I
raise
withinshow
orwake
, the execution of the remainder of thetmt show/run
fails, i.e. other tmt plans are stopped and do not execute.Update this does not work :(. The phases are not available at the
wake
/show
stage and not all steps are computed at that point. The closest I could get is to checkstep.data
typeThe text was updated successfully, but these errors were encountered: