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

Fix tests #30

Closed
megri opened this issue Jul 21, 2019 · 3 comments · Fixed by #31
Closed

Fix tests #30

megri opened this issue Jul 21, 2019 · 3 comments · Fixed by #31
Labels
bug Something isn't working
Milestone

Comments

@megri
Copy link
Contributor

megri commented Jul 21, 2019

I can't run all tests without getting errors. Seems like some path confusion. For instance, I get

- Normalise paths *** FAILED ***
  received /private/tmp/build != expected /tmp/build (IdeaSpec.scala:27)

but also a bunch of fails like this one:

- Generate and compile meta modules *** FAILED ***
  Throwable
    seed.cli.util.Exit$.error(Exit.scala:8)
    seed.process.ProcessHelper$.$anonfun$runCommmand$5(ProcessHelper.scala:101)
    seed.process.ProcessHandler.onExit(ProcessHelper.scala:30)
    com.zaxxer.nuprocess.internal.BasePosixProcess.onExit(BasePosixProcess.java:310)
    com.zaxxer.nuprocess.osx.ProcessKqueue.processEvent(ProcessKqueue.java:314)
    com.zaxxer.nuprocess.osx.ProcessKqueue.process(ProcessKqueue.java:224)
    com.zaxxer.nuprocess.internal.BaseEventProcessor.run(BaseEventProcessor.java:78)
    java.lang.Thread.run(Thread.java:748)

I'm guessing this happens due to me running MacOS, but I'm not sure.

@tindzk
Copy link
Owner

tindzk commented Jul 22, 2019

It appears that on your machine /tmp is a symbolic link pointing to /private/tmp. I will change the tests to use a path within the current working directory instead. This will be more portable.

@megri
Copy link
Contributor Author

megri commented Jul 22, 2019

That's funny, I've never realised MacOS symlinks these directories (it does the same with /etc and /var). That explains why the path-test fails. Perhaps it'd be an alternative to use stuff like java.io.File#createTempFile() instead of designating "/tmp" by name

@tindzk tindzk added the bug Something isn't working label Jul 22, 2019
@tindzk tindzk added this to the 0.1.5 milestone Jul 22, 2019
@tindzk
Copy link
Owner

tindzk commented Jul 22, 2019

Interesting. I was not aware of this either. What does createTempDirectory return on macOS? I am getting this on Linux:

scala> java.nio.file.Files.createTempDirectory("seed")
res11: java.nio.file.Path = /tmp/seed892158896148301201

Also, as per your suggestion on Gitter, we should not build within the repository such that after running the tests, git status will not report any new files.

tindzk added a commit that referenced this issue Jul 22, 2019
Use `createTempDirectory` instead of `/tmp` for better portability.

Closes #30.
tindzk added a commit that referenced this issue Jul 24, 2019
Use `createTempDirectory` instead of `/tmp` for better portability.

Closes #30.
tindzk added a commit that referenced this issue Jul 25, 2019
- Use `createTempDirectory` instead of `/tmp` for better portability
- PathUtil: Use `normalisePath` as `getCanonicalPath` resolves
  symbolic links

The first change makes the test suite compatible with macOS.

Closes #30.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants