Open frerikandriessen opened 3 months ago
Hi @frerikandriessen, thank you for your question.
I would have expected to be able to use a condition to refer to the specific test-step, and to only run the publish-step when this test-step has been run.
You can specify a condition for a step based on the variable created from another step: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&tabs=yaml%2Cstages#use-the-pipeline-variable-created-from-a-step-in-a-condition-in-a-subsequent-step
Or even better, to be able to check in the condition if the report exists.
I am not sure if it's helpful in your particular case, but you may check out conditional expressions: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#conditional-insertion
I have the following usecase:
I have a job that runs tests (could be unit-tests, or a vulnerability scanner, you name it) of which I want to publish the resulting report. When this job runs, and we get to the publish step, there are 3 possible options:
What is your advice/pattern in this (imo) pretty normal usecase? Or am I mistaken and is this not a normal usecase / am I using the tool wrong?
I would have expected to be able to use a condition to refer to the specific test-step, and to only run the publish-step when this test-step has been run. Or even better, to be able to check in the condition if the report exists. As far as I understand it, both of these options are not possible.
I'd be happy to hear what your suggested approach is here.