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

Support wildcard in filenames #2096

Merged
merged 11 commits into from Aug 8, 2019

Conversation

vagisha-nidhi
Copy link
Contributor

@vagisha-nidhi vagisha-nidhi commented Jul 18, 2019

Description

Support wildcard in filenames.
Wildcard character support using Microsoft.Extensions.FileSystemGlobbing

Usage

Wildcard supported: *(represent zero to many characters), **(to represent arbitrary directory depth)
Example: vstest.console.exe /path/to/project/tests/**.Tests/**/*.Tests.dll

We will also show the number of files matched with given pattern by default.
image

With detailed verbosity, the list of files will also be shown on the console
image

File matching verified on windows and linux.

Also, help text has been updated to incorporate the change
image

Related issue

#1663

@singhsarab
Copy link
Contributor

    public void AddSource(string source)

Should we move this to the arg processor ?


Refers to: src/vstest.console/CommandLine/CommandLineOptions.cs:281 in 024860d. [](commit_id = 024860d, deletion_comment = False)

@vagisha-nidhi
Copy link
Contributor Author

    public void AddSource(string source)

Should we move this to the arg processor ?

Refers to: src/vstest.console/CommandLine/CommandLineOptions.cs:281 in 024860d. [](commit_id = 024860d, deletion_comment = False)

We can't move the logic to processor because we'd have to duplicate the logic in both RunTestsArgProcessor and ListTestsArgProcessor.
ListTests takes test file as arguments. Example:

/listtests:"abc.dll"
-lt|--ListTests|/lt|/ListTests:<File Name>
      Lists all discovered tests from the given test container.

@singhsarab
Copy link
Contributor

    public void AddSource(string source)

Should we move this to the arg processor ?
Refers to: src/vstest.console/CommandLine/CommandLineOptions.cs:281 in 024860d. [](commit_id = 024860d, deletion_comment = False)

We can't move the logic to processor because we'd have to duplicate the logic in both RunTestsArgProcessor and ListTestsArgProcessor.
ListTests takes test file as arguments. Example:

/listtests:"abc.dll"
-lt|--ListTests|/lt|/ListTests:<File Name>
      Lists all discovered tests from the given test container.

I thought this was handled by the test source argument processor ?

@vagisha-nidhi
Copy link
Contributor Author

    public void AddSource(string source)

Should we move this to the arg processor ?
Refers to: src/vstest.console/CommandLine/CommandLineOptions.cs:281 in 024860d. [](commit_id = 024860d, deletion_comment = False)

We can't move the logic to processor because we'd have to duplicate the logic in both RunTestsArgProcessor and ListTestsArgProcessor.
ListTests takes test file as arguments. Example:

/listtests:"abc.dll"
-lt|--ListTests|/lt|/ListTests:<File Name>
      Lists all discovered tests from the given test container.

I thought this was handled by the test source argument processor ?

If there is no test source given and only /listtests:"abc.dll" this will be handled only by the listtests arg processor and test source arg processor will not be involved.

Copy link
Contributor

@singhsarab singhsarab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

// Print all test containers.
Output.WriteLine(string.Empty, OutputLevel.Information);
Output.WriteLine(string.Format(CultureInfo.CurrentCulture, CommandLineResources.TestSourcesDiscovered, CommandLineOptions.Instance.Sources.Count()), OutputLevel.Information);
if (verbosityLevel == Verbosity.Detailed)
Copy link
Contributor

@mayankbansal018 mayankbansal018 Aug 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use this with instance variables. #Resolved

@vagisha-nidhi vagisha-nidhi merged commit 2d36ed9 into microsoft:master Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants