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

Associate release pipeline and stage with test run #64

Closed
C0nquistadore opened this issue Nov 25, 2024 · 6 comments · Fixed by #73
Closed

Associate release pipeline and stage with test run #64

C0nquistadore opened this issue Nov 25, 2024 · 6 comments · Fixed by #73
Labels
enhancement New feature or request

Comments

@C0nquistadore
Copy link

We are using a classic release pipeline on Azure DevOps Server. When using the PublishTestResults@2 task from Microsoft, the test run includes a reference to the release pipeline and stage it was executed on. This helps navigating to the logs of the execution. Especially when opening the test run from the test case/test point (which is now possible since #20).

This is how it looks using PublishTestResults@2:
image

So my suggestion would be to associate the release pipeline and stage to the run, if applicable, of course.

@bryanbcook bryanbcook added the enhancement New feature or request label Dec 25, 2024
@bryanbcook
Copy link
Owner

@C0nquistadore

Almost ready to release this, but the API is not letting me define a display value for the "Release Stage". Do you think you could provide the JSON response for https://dev.azure.com/<your-organization>/<your-project>/_apis/test/runs/<test-run>?api-version=5.0

@C0nquistadore
Copy link
Author

@C0nquistadore

Almost ready to release this, but the API is not letting me define a display value for the "Release Stage". Do you think you could provide the JSON response for https://dev.azure.com/<your-organization>/<your-project>/_apis/test/runs/<test-run>?api-version=5.0

Hey, I assume you already got it working? Do you still need the JSON?

@bryanbcook
Copy link
Owner

I obviously pushed a new release with this feature, but in my environment both the extension and my release pipeline don't have the display name for the stage (the stage display name is vstfs:///ReleaseManagement/Environment/n). I could not replicate the screenshot you provided.

Feedback is always welcome and I'm curious if it's working for you.

@C0nquistadore
Copy link
Author

I had the chance to test it this morning, and it looks good.

This is how it looks like when using the Microsoft PublishTestResults task:

image

This is how it looks like when using your task:

image

By the way, it would be really helpful to navigate to the test run from the logs. The PublishTestResults task offers this by printing the link in the logs like this:

image

Should I open a separate issue for this?

@bryanbcook
Copy link
Owner

bryanbcook commented Jan 14, 2025

Great feedback.

This is how it looks like when using your task:

Few interesting observations:

  • duration is 24 seconds less. I'm assuming this might be a bug in the test-parser that test durations are not being recorded correctly (known issue MSTest results do not include durations test-results-reporter/parser#43) or I might be missing something when creating the test run.
  • platform and build flavour is not represented. The PublishTestResults@2 task has buildConfiguration and buildPlatform properties, which I assume you're providing when publishing. From a TestPlan perspective, you can aggregate results from different test runs, and TestConfiguration might be more appropriate, so I'm not convinced my task should expose these options. If it can be inferred from the pipeline configuration, I'd consider adding automatic resolution for those values.
  • stage name is being reported correctly, which is great 👍. Maybe there is something different in your Release Stage that sets up the environment display name because my environment all have a vstfs:// value.

By the way, it would be really helpful to navigate to the test run from the logs

I agree. For release notes clarity, I'd prefer to track it as a separate issue.

@C0nquistadore
Copy link
Author

All valid observations. However for me personally, that's all I currently need to work with the test run.

  • Duration is something I usually take from each particular test result
  • Platform and build flavor is indeed something the PublishTestResults task provides and I just gave it some values for the sake of it. But they do not really provide any value to us currently.

I opened issue #74 for the run link in the logs.

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

Successfully merging a pull request may close this issue.

2 participants