Skip to content

[feature request] release a OpenTelemetry.Extensions.TestFX package #2821

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

Open
thompson-tomo opened this issue Jun 7, 2025 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@thompson-tomo
Copy link

thompson-tomo commented Jun 7, 2025

Component

None

Is your feature request related to a problem?

I want to have the traces & metrics generated by my application when running unit tests recorded just like in production with the results visible in the same tools.

What is the expected behavior?

New package is available which enables open telemetry to be add to the test project with minimal effort on test projects.

  • ITestFramework.CreateTestSessionAsync implemented to start the activity for the test suite with the necessary tags
  • ITestFramework.CloseTestSessionAsync implemented to stop the activity for the test suite
  • ITestFramework.ExecuteRequestAsync implemented to set the test result as passed, any other appropriate tags & end it when IData is PassedTestNodeStateProperty
  • ITestFramework.ExecuteRequestAsync implemented to set the test result as failed, any other appropriate tags & end it when IData is FailedTestNodeStateProperty
  • ITestFramework.ExecuteRequestAsync implemented to set the test result as skipped, any other appropriate tags & end it when IData is SkippedTestNodeStateProperty
  • ITestFramework.ExecuteRequestAsync implemented to create a new span with the appropriate tags when IData is InProgressTestNodeStateProperty

Which alternative solutions or features have you considered?

Manually instrument it within my projects.

Additional context

https://learn.microsoft.com/en-au/dotnet/core/testing/microsoft-testing-platform-intro

@thompson-tomo thompson-tomo added the enhancement New feature or request label Jun 7, 2025
@thompson-tomo thompson-tomo changed the title [feature request] release a Microsoft.Extensions.TestFX package [feature request] release a OpenTelemetry.Extensions.TestFX package Jun 7, 2025
@martincostello
Copy link
Member

We discussed this in the CI/CD SIG meeting this week - I was going to look into creating a prototype once phase 2 kicks off.

@thompson-tomo
Copy link
Author

thompson-tomo commented Jun 7, 2025

Thanks for that @martincostello I think from a users perspective if the interface was identical or as close as possible to OpenTelemetry.Extensions.Hosting that would be best. That way we can have seperate resource package to add the git information and any other desired info.

Note I have just linked 2 issues to extend the attributes so that desired info can be captured.

@thompson-tomo
Copy link
Author

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

No branches or pull requests

2 participants