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

[NOID] Fixes directory that should be non existing #574

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Conversation

ncordon
Copy link
Collaborator

@ncordon ncordon commented Jan 24, 2024

What

Changes the name of the directory apoc to "__non-existing-dir__" so we get more chances of that directory truly not existing.

Why

Because in some internal build we have an existing apoc folder which was making the tests not work because they expect that folder to not exist.

@ncordon ncordon changed the title Fixes directory that should be non existing [NOID] Fixes directory that should be non existing Jan 24, 2024
Copy link
Contributor

@loveleif loveleif left a comment

Choose a reason for hiding this comment

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

Nice catch!!

"file://" + directory.getAbsolutePath() + "//..//..//..//..//apoc/" + FILENAME;
private static final String case15 =
"file:///%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f/apoc/" + FILENAME;
private static final String nonExistingDirectory = "__non-existing-dir__";
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use Files.createTempDirectory and then we don't have to worry about leaving stuff around on the host running the build.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But it's not going to create the file. If we do create the directory (even if it's temporary) then the tests would fail. I could make the name random if you prefer

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, ok! I thought it would create some files there at some point. Because if it does we could do Files.createTempDirectory().resolve("non-existing") and have a non existing directory and be sure that those files will not remain on the host. But if we don't it doesn't matter. Feel free to merge!

@ncordon ncordon merged commit c68b416 into dev Jan 26, 2024
20 checks passed
@ncordon ncordon deleted the fix-random-folder branch January 26, 2024 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants