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

Tar: Add missing TarFile.CreateFromDirectoryAsync roundtrip tests #84303

Merged
merged 1 commit into from Apr 14, 2023

Conversation

carlossanlop
Copy link
Member

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.

@ghost
Copy link

ghost commented Apr 4, 2023

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
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
Member 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
Member 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
103 of 107 checks passed
@carlossanlop carlossanlop deleted the TarAsyncRoundtripTests branch April 14, 2023 19:41
@carlossanlop
Copy link
Member Author

/backport to release/7.0-staging

@github-actions
Copy link
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants