-
Notifications
You must be signed in to change notification settings - Fork 885
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
[test] Prevent hard-coded path #644
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The hardcoded path used in this test conflicts with a pre-existing path by another user/process. This commit adds a bit of randomness to the directory name, similar to that used in `OXInstantMessagingManagerTest` Fixes SMACK-955
guusdk
force-pushed
the
SMACK-955_Hardcoded-tmp-path
branch
from
November 4, 2024 18:49
d5fe94f
to
c2c695d
Compare
Flowdalic
requested changes
Nov 5, 2024
@@ -51,7 +52,7 @@ public class SecretKeyBackupHelperTest extends SmackTestSuite { | |||
private static final File basePath; | |||
|
|||
static { | |||
basePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "ox_secret_keys"); | |||
basePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "ox_secret_keys_" + StringUtils.randomString(10)); |
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.
Let's do the idiomatic thing:
Suggested change
basePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "ox_secret_keys_" + StringUtils.randomString(10)); | |
basePath = Files.createTempDirectory("ox_secret_keys").toFile(); |
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 we please move this PR along so that we can get ignite's bamboo jobs green again, thanks.
Florian, please adjust this as you see fit.
…On Wed, Nov 13, 2024 at 9:58 PM daryl herzmann ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretKeyBackupHelperTest.java
<#644 (comment)>:
> @@ -51,7 +52,7 @@ public class SecretKeyBackupHelperTest extends SmackTestSuite {
private static final File basePath;
static {
- basePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "ox_secret_keys");
+ basePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "ox_secret_keys_" + StringUtils.randomString(10));
Could we please move this PR along so that we can get ignite's bamboo jobs
green again, thanks.
—
Reply to this email directly, view it on GitHub
<#644 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABAORSVDEEMR56M2DWXXJS32AO4P7AVCNFSM6AAAAABREZZPXSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDIMZUGM4TQNZXGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Fixed with 2e4178d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The hardcoded path used in this test conflicts with a pre-existing path by another user/process. This commit adds a bit of randomness to the directory name, similar to that used in
OXInstantMessagingManagerTest
Fixes SMACK-955