-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Fix FileAccessTreeTests#testDuplicateExclusivePaths to work on windows #124430
Fix FileAccessTreeTests#testDuplicateExclusivePaths to work on windows #124430
Conversation
Pinging @elastic/es-core-infra (Team:Core/Infra) |
This change seems super subtle. I can't see a difference in the behaviour; how does this fix the tests? |
@@ -447,7 +447,9 @@ public void testDuplicateEntitlements() { | |||
public void testFilesEntitlementsWithExclusive() { | |||
var baseTestPath = Path.of("/base").toAbsolutePath(); | |||
var testPath1 = Path.of("/base/test").toAbsolutePath(); | |||
var testPath1String = testPath1.toString(); |
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 thought these toString
calls are not needed if the Strings.format
call is using %s
?
By forcing the same string Failure was: expected "Path [/a/b] ..." found "Path [C:\a\b] ... " on windows. |
Actually you are right, the second one is a red herring, it was not the same issue and it's fixed by Ryan's PR. I'll remove it. |
); | ||
var iae = expectThrows(IllegalArgumentException.class, () -> buildExclusivePathList(distinctEntitlements, TEST_PATH_LOOKUP)); | ||
var pathABString = pathAB.toAbsolutePath().toString(); |
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.
Oh the fix is this toAbsolutePath()
call?
…stDuplicateExclusivePaths
….com:ldematte/elasticsearch into entitlements/fix-testDuplicateExclusivePaths
💔 Backport failed
You can use sqren/backport to manually backport by running |
Backports need #123676 |
Fix PolicyManagerTests#testFilesEntitlementsWithExclusive
Fixes #124437