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

verify-nupkgs.ps1 fails when artifacts are signed #10414

Closed
ellahathaway opened this issue Nov 6, 2024 · 1 comment · Fixed by #10418
Closed

verify-nupkgs.ps1 fails when artifacts are signed #10414

ellahathaway opened this issue Nov 6, 2024 · 1 comment · Fixed by #10418

Comments

@ellahathaway
Copy link
Contributor

verify-nupkgs.ps1 is invalid when the artifacts are signed. Signing adds a .signature.p7s file to a nupkg, which increases the number of actual files in the nupkgs and causes the validation to fail by an offset of +1.

This validation runs after signing as part of this target.

Example output from build with signing enabled:

Unzipping NuGet packages.
  Verify NuGet packages files.
  Verifying package 'Microsoft.TestPlatform.Internal.Uwp.17.13.0-preview-24523-01'.
  Verifying package 'Microsoft.CodeCoverage.17.13.0-preview-24523-01'.
  Verifying package 'Microsoft.NET.Test.Sdk.17.13.0-preview-24523-01'.
  Verifying package 'Microsoft.TestPlatform.AdapterUtilities.17.13.0-preview-24523-01'.
  Verifying package 'Microsoft.TestPlatform.Build.17.13.0-preview-24523-01'.
  Verifying package 'Microsoft.TestPlatform.CLI.17.13.0-preview-24523-01'.
  Verifying package 'Microsoft.TestPlatform.Extensions.TrxLogger.17.13.0-preview-24523-01'.
  Verifying package 'Microsoft.TestPlatform.ObjectModel.17.13.0-preview-24523-01'.
  Verifying package 'Microsoft.TestPlatform.TranslationLayer.17.13.0-preview-24523-01'.
  Verify-Nuget-Packages : There are 9 errors:
  Number of files are not equal for 'Microsoft.TestPlatform.Internal.Uwp.17.13.0-preview-24523-01', expected: 38 actual: 
  39
  Number of files are not equal for 'Microsoft.CodeCoverage.17.13.0-preview-24523-01', expected: 59 actual: 60
  Number of files are not equal for 'Microsoft.NET.Test.Sdk.17.13.0-preview-24523-01', expected: 15 actual: 16
  Number of files are not equal for 'Microsoft.TestPlatform.AdapterUtilities.17.13.0-preview-24523-01', expected: 75 
  actual: 76
  Number of files are not equal for 'Microsoft.TestPlatform.Build.17.13.0-preview-24523-01', expected: 20 actual: 21
  Number of files are not equal for 'Microsoft.TestPlatform.CLI.17.13.0-preview-24523-01', expected: 471 actual: 472
  Number of files are not equal for 'Microsoft.TestPlatform.Extensions.TrxLogger.17.13.0-preview-24523-01', expected: 34 
  actual: 35
  Number of files are not equal for 'Microsoft.TestPlatform.ObjectModel.17.13.0-preview-24523-01', expected: 92 actual: 
  93
  Number of files are not equal for 'Microsoft.TestPlatform.TranslationLayer.17.13.0-preview-24523-01', expected: 122 
  actual: 123

I think that the solution here is to either 1) skip the test when signing or 2) modify the test to increase the expected number of files by one when signing.

@nohwnd
Copy link
Member

nohwnd commented Nov 7, 2024

Might be the easiest to just ignore files with .p7s extension. Do you want to send a PR for that change?

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 a pull request may close this issue.

2 participants