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

This change enables the test csx files to provide the scenarios that … #10754

Merged
merged 1 commit into from
Apr 22, 2016

Conversation

basoundr
Copy link
Contributor

…needs to be monitored within a test execution

This enables multiple scenarios cases. For eg: How RPS tracks a bunch of scenarios within a single run of VS

Tagging @KevinH-MS @rchande @TyOverby for review

…needs to be monitored within a test execution

This enables multiple scenarios cases as well
@TyOverby
Copy link
Contributor

Can you provide an example of a test that would provide its own scenarios?

@rchande
Copy link
Contributor

rchande commented Apr 21, 2016

I have little context on how this works. Can you explain when the scenarios are written out? I don't understand how a test could not provide its own scenarios.

@basoundr
Copy link
Contributor Author

Example of this scenario would look like this:

    public override bool ProvidesScenarios => true;
    public override string[] GetScenarios()
    {
        return new string[]
        {
            @"<scenario process=""csc"" name=""HelloWorld_Anotherway"">",
            @"<from process=""csc"" eventName=""Process/Start"" absoluteInstance=""1"" providerGuid=""{9e814aad-3204-11d2-9a82-006008a86939}""/>",
            @"<to process=""csc"" eventName=""Process/Stop"" absoluteInstance=""1"" providerGuid=""{9e814aad-3204-11d2-9a82-006008a86939}""/>",
            @"</scenario>"
        };
    }

If we replace the code of the Helloworld.csx with the above code, then the tests will run without any issues.

We need this because, there are going to be VS tests which are going to run more than one scenario. For eg: We might have the following scenarios.

  1. OpenVS
  2. Typing a char and wait for feature X to complete
  3. Measure perf for more Y features
  4. Close VS.

With the current model, we assume that when a test runs there is only one scenario. That's because all the tests that we run today are csc tests, which are one line command execution tests.

This change will enable us to run complex tests(almost every VS tests)

@basoundr
Copy link
Contributor Author

A more VS based scenario would look like this

public override string[] GetScenarios()
    {
        return new string[]
        {
            @"<scenario name=""Edit To SolutionCrawler Completion"" process=""devenv"">",
            // {bf965e67-c7fb-5c5b-d98f-cdf68f8154c2} - This is the RoslynEventSource Guid
            @"<from providerGuid=""{bf965e67-c7fb-5c5b-d98f-cdf68f8154c2}"" eventId=""2""  absoluteInstance=""1"" properties=""functionId=Workspace_Document_State_IncrementallyParseSyntaxTree"" process=""devenv""/>",
            @"<to providerGuid=""{bf965e67-c7fb-5c5b-d98f-cdf68f8154c2}"" eventId=""1""  absoluteInstance=""1"" properties=""functionId=WorkCoordinator_AsyncWorkItemQueue_LastItem"" process=""devenv""/>",
            @"</scenario>"
        };
    }

@basoundr
Copy link
Contributor Author

@KevinH-MS @rchande @TyOverby If this change seems ok, I would like to get it merged since I have other changes which depend on these changes :)

@KevinH-MS
Copy link
Contributor

This seems fine to me. I'm also fine if we change all tests to explicitly provide scenarios. 👍

@TyOverby
Copy link
Contributor

👍

@basoundr basoundr merged commit 9e4efe9 into dotnet:master Apr 22, 2016
@basoundr basoundr deleted the SupportTestsProvidingScenarios branch April 22, 2016 16:32
@basoundr
Copy link
Contributor Author

@KevinH-MS It is on my Todo list. That change will get rid of a lot of APIs. Will do sometime soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants