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

Add support for JRE provisioning: Jre tar.gz unpack - extract IFilePermissionsProvider #2051

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

gregory-paidis-sonarsource
Copy link
Contributor

Fixes #2048

@@ -56,13 +59,15 @@ public void TarGzUnpacking_Success()
using var archive = new MemoryStream(Convert.FromBase64String(sampleTarGzFile));
using var unzipped = new MemoryStream();
fileWrapper.Create($"""{baseDirectory}\Main\Sub2\Sample.txt""").Returns(unzipped);
filePermissionsWrapper.When(x => x.Copy(Arg.Any<TarEntry>(), Arg.Any<string>())).Throw(new Exception("Sample exception message"));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only relevant change as far as tests are concerned.

Copy link
Member

Choose a reason for hiding this comment

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

Could you please update the test name to reflect the flow?
Unpacking -> Success, Copy -> fail
Otherwise, the new behavior seems to be a different test. Maybe it should be :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will rename it, as I don't think it is worth it to make another test just for this one debug log message.

using Microsoft.VisualStudio.TestTools.UnitTesting;
using NSubstitute;
using NSubstitute.ExceptionExtensions;

Choose a reason for hiding this comment

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

not used

Copy link
Member

Choose a reason for hiding this comment

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

LGTM! please see the two comments I've added.

@gregory-paidis-sonarsource gregory-paidis-sonarsource enabled auto-merge (squash) July 12, 2024 13:36
Copy link

@gregory-paidis-sonarsource gregory-paidis-sonarsource merged commit 9009d26 into master Jul 12, 2024
14 checks passed
@gregory-paidis-sonarsource gregory-paidis-sonarsource deleted the greg/tar-gz-unpacker-cleanup branch July 12, 2024 14:03
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.

Add support for JRE provisioning: Jre tar.gz unpack - extract IFilePermissionsProvider
2 participants