Skip to content

SingleFile: Update a test with ni-pdbs#3381

Closed
swaroop-sridhar wants to merge 2 commits into
dotnet:masterfrom
swaroop-sridhar:nipdb
Closed

SingleFile: Update a test with ni-pdbs#3381
swaroop-sridhar wants to merge 2 commits into
dotnet:masterfrom
swaroop-sridhar:nipdb

Conversation

@swaroop-sridhar

Copy link
Copy Markdown
Contributor

The test GivenThatWeWantToPublishASingleFileApp.It_excludes_ni_pdbs_from_single_file
checks for the fact that ni.pdb files are not bundled into the single-file by default.

This test was expecting only the <app>.ni.pdb file to exist in the publish directory.
However, in recent versions of the build, mscorlib.ni.pdb is also found.

This commit changes the test to accomodate additional files in the publish directory.

The test GivenThatWeWantToPublishASingleFileApp.It_excludes_ni_pdbs_from_single_file
checks for the fact that ni.pdb files are not bundled into the single-file by default.

This test was expecting only the `<app>.ni.pdb` file to exist in the publish directory.
However, in recent versions of the build, mscorlib.ni.pdb is also found.

This commit changes the test to accomodate additional files in the publish directory.
@swaroop-sridhar

Copy link
Copy Markdown
Contributor Author

CC: @fadimounir @dsplaisted

GetPublishDirectory(publishCommand)
.Should()
.OnlyHaveFiles(expectedFiles);
.HaveFiles(expectedFiles);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do you think it might be worth adding this check also:

foreach(file in output folder)
{
    if (file == SingleFile || file == PdbFile || file == NiPdbFile)
        continue;
    else
        Verify file.extension == ni.pdb
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM otherwise

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure it is worth tracking what .ni.pdb files are generated in this test -- it makes the test a bit fragile because of other files changing.

Also,in the long term, I don't expect the mscorlib.ni.pdb (or any other ni.pdb) to be generated everytime. So, I'd keep the change as-is for now. Once the mscorlib compilation issue is resolved, we should move back to the .OnlyHaveFiles test.

@dsplaisted

Copy link
Copy Markdown
Member

I've included this change in #3372 so that we don't have to wait for two PRs before we snap for preview 7. So I think we can close this PR.

@swaroop-sridhar

Copy link
Copy Markdown
Contributor Author

Thanks

@johnbeisner

johnbeisner commented Jul 1, 2019

Copy link
Copy Markdown
Contributor

closing in favor of: #3372

@johnbeisner johnbeisner closed this Jul 1, 2019
dsplaisted pushed a commit to dsplaisted/sdk that referenced this pull request Feb 19, 2020
….6 (dotnet#3381)

- Microsoft.NET.Sdk - 3.1.100-preview2.19530.6
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.

4 participants