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

Attempt to Fix and Re-enable HasIncludedFiles Test #47220

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

v-wuzhai
Copy link
Member

@v-wuzhai v-wuzhai commented Mar 3, 2025

No description provided.

@v-wuzhai v-wuzhai marked this pull request as ready for review March 4, 2025 05:36
@v-wuzhai v-wuzhai requested review from Copilot and marcpopMSFT March 4, 2025 05:36

Choose a reason for hiding this comment

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

PR Overview

This PR aims to fix and re-enable the HasIncludedFiles test by updating test execution parameters and correcting expected file paths in the zip output.

  • Re-enabled the previously skipped HasIncludedFiles test.
  • Updated the execution command to explicitly use the Debug configuration.
  • Revised assertions to match updated file paths in the generated output package.

Reviewed Changes

File Description
test/TestAssets/TestProjects/EndToEndTestApp/Program.cs Added a basic console program as a test asset.
test/dotnet-pack.Tests/PackTests.cs Re-enabled the test and updated execution parameters and zip entry assertions.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

test/dotnet-pack.Tests/PackTests.cs:91

  • Confirm that using the '-c Debug' configuration is intentional and consistent with other tests, so that it does not cause unexpected behavior in the pack process.
.Execute("-c", "Debug")

test/dotnet-pack.Tests/PackTests.cs:102

  • Double-check that the updated expected file paths ('newpath/pack1.txt' and 'anotherpath/pack2.txt') correctly reflect the intended output from the pack process.
.Should().Contain(e => e.FullName == "newpath/pack1.txt")
Copy link
Member

@Forgind Forgind left a comment

Choose a reason for hiding this comment

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

Thanks!

public void HasIncludedFiles()
{
var testInstance = _testAssetsManager.CopyTestAsset("EndToEndTestApp")
.WithSource();

new DotnetPackCommand(Log)
.WithWorkingDirectory(testInstance.Path)
.Execute()
.Execute("-c", "Debug")
Copy link
Member

Choose a reason for hiding this comment

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

Is the -c Debug part necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

By default, it appears to be the release path. Therefore, the debug configuration was used to ensure the correct file path.

@v-wuzhai v-wuzhai merged commit f2ccb58 into main Mar 11, 2025
39 checks passed
@v-wuzhai v-wuzhai deleted the dev/Jason/attempt-fix-reenable-hasincludedfiles-test branch March 11, 2025 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants