-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add support for JRE provisioning: Jre tar.gz unpack - extract IFilePermissionsProvider #2051
Conversation
…rmissionsProvider
@@ -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")); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.
src/SonarScanner.MSBuild.PreProcessor/JreCaching/FilePermissionsWrapper.cs
Show resolved
Hide resolved
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using NSubstitute; | ||
using NSubstitute.ExceptionExtensions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used
There was a problem hiding this comment.
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.
Quality Gate passedIssues Measures |
Fixes #2048