-
Notifications
You must be signed in to change notification settings - Fork 83
Fix args parsing on Windows #609
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
Changes from 7 commits
90abd0b
311c8ad
19d8fde
4b8987b
49b26ad
988cfad
c87de63
5a86516
8fcddbf
2798688
cdfcfa2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,12 +49,15 @@ import org.eclipse.jetty.server.handler.ResourceHandler | |
| import spock.lang.Specification | ||
| import spock.lang.TempDir | ||
|
|
||
| import java.nio.file.FileVisitResult | ||
| import java.nio.file.Files | ||
| import java.nio.file.Path | ||
| import java.nio.file.SimpleFileVisitor | ||
| import java.nio.file.StandardCopyOption | ||
| import java.nio.file.attribute.BasicFileAttributes | ||
|
|
||
| abstract class AbstractGraalVMMavenFunctionalTest extends Specification { | ||
| @TempDir | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why you have removed
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my local when I work with Tempdir all tests are passing, because windows avoids tempDir path whitespace with a certain encoding (C:\Users\Lahoucine~\AppData\Temp) so no parsing errors will result if I have withespaces in my path. |
||
|
|
||
| Path testDirectory | ||
|
|
||
| Path testOrigin; | ||
|
|
@@ -71,6 +74,13 @@ abstract class AbstractGraalVMMavenFunctionalTest extends Specification { | |
| boolean IS_MAC = System.getProperty("os.name", "unknown").contains("Mac"); | ||
|
|
||
| def setup() { | ||
| var home_dir = Path.of(System.getProperty("user.home")) | ||
| testDirectory = home_dir.resolve("tests") | ||
|
|
||
| if (Files.notExists(testDirectory)) { | ||
| Files.createDirectory(testDirectory) | ||
| } | ||
|
|
||
| executor = new IsolatedMavenExecutor( | ||
| new File(System.getProperty("java.executable")), | ||
| testDirectory.resolve("m2-home").toFile(), | ||
|
|
@@ -79,6 +89,21 @@ abstract class AbstractGraalVMMavenFunctionalTest extends Specification { | |
| } | ||
|
|
||
| def cleanup() { | ||
|
|
||
| //cleanup test directory and all it's sub directories | ||
| Files.walkFileTree(testDirectory, new SimpleFileVisitor<Path>() { | ||
| @Override | ||
| FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { | ||
| Files.delete(file); | ||
| return FileVisitResult.CONTINUE; | ||
| } | ||
| @Override | ||
| FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { | ||
| Files.delete(dir); | ||
| return FileVisitResult.CONTINUE; | ||
| } | ||
| }); | ||
|
|
||
| if (server != null) { | ||
| server.stop() | ||
| server.destroy() | ||
|
|
@@ -158,7 +183,7 @@ abstract class AbstractGraalVMMavenFunctionalTest extends Specification { | |
| var resultingSystemProperties = [ | ||
| "common.repo.uri": System.getProperty("common.repo.uri"), | ||
| "seed.repo.uri": System.getProperty("seed.repo.uri"), | ||
| "maven.repo.local": testDirectory.resolve("local-repo").toFile().absolutePath | ||
| "maven.repo.local": testDirectory.resolve("local repo").toFile().absolutePath | ||
alvarosanchez marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ] | ||
| resultingSystemProperties.putAll(systemProperties) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.