Skip to content

Tar: Add missing TarFile.CreateFromDirectoryAsync roundtrip tests - #84303

Merged
carlossanlop merged 1 commit into
dotnet:mainfrom
carlossanlop:TarAsyncRoundtripTests
Apr 14, 2023
Merged

Tar: Add missing TarFile.CreateFromDirectoryAsync roundtrip tests#84303
carlossanlop merged 1 commit into
dotnet:mainfrom
carlossanlop:TarAsyncRoundtripTests

Conversation

@carlossanlop

Copy link
Copy Markdown
Contributor

Some of the paths we take for async code are separate from the sync code. Adding a couple of missing tests we added for roundtripping a tar file.

Initially added in PR #84279 but decided to submit them in a separate one since the change is unrelated.

@carlossanlop carlossanlop self-assigned this Apr 4, 2023
@ghost

ghost commented Apr 4, 2023

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-system-formats-tar
See info in area-owners.md if you want to be subscribed.

Issue Details

Some of the paths we take for async code are separate from the sync code. Adding a couple of missing tests we added for roundtripping a tar file.

Initially added in PR #84279 but decided to submit them in a separate one since the change is unrelated.

Author: carlossanlop
Assignees: carlossanlop
Labels:

area-System.Formats.Tar

Milestone: -
string destinationDirectoryName = Path.Join(root.Path, "destinationDirectory");
Directory.CreateDirectory(destinationDirectoryName);

string sourceSubDirectory = Path.Join(sourceDirectoryName, subDirectory);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess Path.Join handles null values fine but I would have probably put that operation into the if block below.

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.

Good catch, let me confirm.

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.

Join handles it properly: null is treated like empty string. The resulting path is just the first argument's path.

I would prefer to avoid restarting the CI for that, hope you don't mind.

@carlossanlop
carlossanlop merged commit d97b17b into dotnet:main Apr 14, 2023
@carlossanlop
carlossanlop deleted the TarAsyncRoundtripTests branch April 14, 2023 19:41
@carlossanlop

Copy link
Copy Markdown
Contributor Author

/backport to release/7.0-staging

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/7.0-staging: https://github.com/dotnet/runtime/actions/runs/4703331570

@ghost ghost locked as resolved and limited conversation to collaborators May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

2 participants