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

Capturing Test run data from Developer Local Machines #25

Open
1 of 2 tasks
dicko2 opened this issue Mar 26, 2023 · 1 comment
Open
1 of 2 tasks

Capturing Test run data from Developer Local Machines #25

dicko2 opened this issue Mar 26, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@dicko2
Copy link
Contributor

dicko2 commented Mar 26, 2023

Feature request

Type

  • - Enhancement - completely new feature
  • - Improvement - make what we have better

Is your feature request related to a problem?

We want to collect test run data from local machines (Laptops) to analyse and help improve the developer experience. We should be able to correlate this with data from CI to look for common behaviour that indicates poor local experience.

For example:

  • People not running test on their local, pushing to CI for testing
  • Specific test suites that only run on CI that people never run locally
  • Test that take a long time to run locally when compare to CI, or both CI and local are long
  • Tests that're repeatedly run on without code change to succeed, indicating flakiness (might be tricky)

Describe the solution you'd like

Most of our projects use nunit, so we can start here.

Nunit has an Engine Extension that we can use to create an installable package.

https://docs.nunit.org/articles/nunit-engine/extensions/creating-extensions/Writing-Engine-Extensions.html

It requires these .addins files to register it (they just need to be a content item in the package tools folder see example here)

https://docs.nunit.org/articles/nunit-engine/extensions/Installing-Extensions.html

Then there is this extension Type we can use to listen to test events.

https://docs.nunit.org/articles/nunit-engine/extensions/creating-extensions/Event-Listeners.html

public interface ITestEventListener
{
    /// <summary>
    /// Handle a progress report or other event.
    /// </summary>
    /// <param name="report">An XML progress report.</param>
    void OnTestEvent(string report);
}

The event takes a XML documents as string input so we'll need to parse the string and it'll be one of these event types

  • Start of run - <start-run...>
  • End of run - <test-run...>
  • Start of a test suite - <start-suite...>
  • End of a test suite - <test-suite...>
  • Start of a test case - <start-test...>
  • End of a test case - <test-case...>

We'll probably just need to capture the "End of a test case" and report back from there to the same ingester we are using for build metrics.

In short we should be able to create a contactless "install nuget package and go" experience for the developers, for fast onboarding.

@dicko2 dicko2 added the enhancement New feature or request label Mar 26, 2023
@dicko2
Copy link
Contributor Author

dicko2 commented Apr 27, 2023

nunit-testing.zip

Attaching POC project with working example

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

1 participant