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

Build all test projects in temporary folder #31

Merged
merged 1 commit into from
Jul 25, 2019
Merged

Build all test projects in temporary folder #31

merged 1 commit into from
Jul 25, 2019

Conversation

tindzk
Copy link
Owner

@tindzk tindzk commented Jul 22, 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.

@tindzk
Copy link
Owner Author

tindzk commented Jul 22, 2019

@megri Could you please check whether the tests pass on macOS?

@megri
Copy link
Contributor

megri commented Jul 22, 2019

I'm still getting errors. Full log here

[info] Loading settings for project global-plugins from idea.sbt,plugins.sbt,metals.sbt ...
[info] Loading global plugins from /Users/martin/.sbt/1.0/plugins
[info] Loading settings for project seed-build from plugins.sbt ...
[info] Loading project definition from /Users/martin/dev/private/seed/project
[info] Loading settings for project seed from build.sbt ...
[info] Set current project to seed (in build file:/Users/martin/dev/private/seed/)
seed.build.LinkSpec
seed.generation.BloopIntegrationSpec
seed.artefact.SemanticVersioningSpec
seed.artefact.ArtefactResolutionSpec
- dependencyFromScalaDep() with Scala.js dependency
- dependencyFromScalaDep() with Scala JVM dependency (full Scala version)
- Extract platform dependencies of test module in libraryDeps()
- jvmDeps()
- Inherit compiler dependencies
- Parse semantic versions
- Detect pre-releases
- Compiler dependency with overridden version in platform module
- mergeDeps()
- Parse Scala's semantic versioning
- Order semantic versions
- Order Scala's semantic versions
- Order pre-release versions in Git notation
seed.config.BuildConfigSpec
- Order major versions
- Order minor versions
- Resolve absolute project path
- Resolve relative project path
- Import module
- Set target platforms on test modules
- Parse TOML with full Scala dependency
- Copy compilerDeps from project definitions to modules
seed.LogSpec
- Check ordering of log levels
- Set log level to lowest
- Set log level to highest
seed.generation.BloopSpec
- Order patch versions
seed.generation.PackageSpec
- Inherit javaDeps in child modules
seed.generation.util.PathUtilSpec
- Default build paths
- Build file path
seed.generation.IdeaSpec
- Normalise paths *** FAILED ***
  received /private/tmp/build != expected /tmp/build (IdeaSpec.scala:29)
    minitest.api.Asserts.assertEquals(Asserts.scala:68)
    minitest.api.Asserts.assertEquals$(Asserts.scala:62)
    seed.generation.IdeaSpec$.assertEquals(IdeaSpec.scala:18)
    seed.generation.IdeaSpec$.$anonfun$new$1(IdeaSpec.scala:29)
    minitest.SimpleTestSuite.$anonfun$test$1(SimpleTestSuite.scala:27)
    minitest.api.TestSpec$.$anonfun$sync$1(TestSpec.scala:51)
    minitest.api.TestSpec.apply(TestSpec.scala:27)
    minitest.api.Properties.$anonfun$iterator$2(Properties.scala:38)
    minitest.api.TestSpec.apply(TestSpec.scala:27)
    minitest.runner.Task.loop$1(Task.scala:56)
    minitest.runner.Task.$anonfun$execute$3(Task.scala:71)
    scala.Option.fold(Option.scala:158)
    minitest.runner.Task.execute(Task.scala:68)
    minitest.runner.Task.execute(Task.scala:81)
    sbt.TestRunner.runTest$1(TestFramework.scala:113)
    sbt.TestRunner.run(TestFramework.scala:124)
    sbt.TestFramework$$anon$2$$anonfun$$lessinit$greater$1.$anonfun$apply$1(TestFramework.scala:282)
    sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:246)
    sbt.TestFramework$$anon$2$$anonfun$$lessinit$greater$1.apply(TestFramework.scala:282)
    sbt.TestFramework$$anon$2$$anonfun$$lessinit$greater$1.apply(TestFramework.scala:282)
    ...
- Generate modules
- Generate project with custom compiler options
- Link module and interpret Bloop events
seed.artefact.CoursierSpec
- Generate project with different Scala versions
seed.cli.util.TargetSpec
- Parse module string
seed.cli.ScaffoldSpec
- Resolve dependency
- Get artefact path
- Create build file one non-JVM platform
[error] Process exited with non-zero exit code
- 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)
[error] Process exited with non-zero exit code
- Build project with compiler plug-in defined on cross-platform module *** 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)
[error] Process exited with non-zero exit code
- Build project with compiler plug-in defined on platform 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)
[error] Process exited with non-zero exit code
- Build project with overridden compiler plug-in version *** 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)
- Build modules with different Scala versions
- Build project with custom class target
- Build project with custom command target
- Build project with failing custom command target
- Package modules with same package
[error] Error: Total 46, Failed 1, Errors 4, Passed 41
[error] Failed tests:
[error] 	seed.generation.IdeaSpec
[error] Error during tests:
[error] 	seed.generation.BloopIntegrationSpec
[error] (Test / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 28 s, completed Jul 22, 2019 7:24:11 PM

@tindzk
Copy link
Owner Author

tindzk commented Jul 23, 2019

I fixed the failing IdeaSpec test and added some log messages to debug the remaining ones. Could you please run the suite again and paste the output here?

@megri
Copy link
Contributor

megri commented Jul 24, 2019

New log:

[info] Loading settings for project global-plugins from idea.sbt,plugins.sbt,metals.sbt ...
[info] Loading global plugins from /Users/martin/.sbt/1.0/plugins
[info] Loading settings for project seed-build from plugins.sbt ...
[info] Loading project definition from /Users/martin/dev/private/seed/project
[info] Loading settings for project seed from build.sbt ...
[info] Set current project to seed (in build file:/Users/martin/dev/private/seed/)
[info] Updating ...
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Compiling 4 Scala sources to /Users/martin/dev/private/seed/target/scala-2.12/classes ...
[info] Done compiling.
[info] Compiling 3 Scala sources to /Users/martin/dev/private/seed/target/scala-2.12/test-classes ...
[info] Done compiling.
seed.generation.BloopIntegrationSpec
seed.artefact.ArtefactResolutionSpec
seed.artefact.SemanticVersioningSpec
seed.build.LinkSpec
- dependencyFromScalaDep() with Scala.js dependency
- dependencyFromScalaDep() with Scala JVM dependency (full Scala version)
- Extract platform dependencies of test module in libraryDeps()
- jvmDeps()
- Inherit compiler dependencies
- Compiler dependency with overridden version in platform module
- mergeDeps()
- Parse semantic versions
- Detect pre-releases
- Parse Scala's semantic versioning
- Order semantic versions
- Order Scala's semantic versions
- Order pre-release versions in Git notation
seed.config.BuildConfigSpec
- Order major versions
- Order minor versions
- Order patch versions
seed.LogSpec
- Check ordering of log levels
- Set log level to lowest
- Set log level to highest
seed.generation.BloopSpec
- Resolve absolute project path
- Resolve relative project path
- Import module
- Set target platforms on test modules
- Parse TOML with full Scala dependency
- Copy compilerDeps from project definitions to modules
seed.generation.PackageSpec
- Inherit javaDeps in child modules
seed.generation.util.PathUtilSpec
- Default build paths
- Build file path
seed.generation.IdeaSpec
- Normalise paths
- Do not resolve symbolic links when normalising paths
- Generate modules
- Generate project with custom compiler options
[compile] Compiling example-jvm (1 Scala source)
Compiling example-js (1 Scala source)
Compiled example-jvm (1164ms)
Compiled example-js (1124ms)

- Generate project with different Scala versions
seed.artefact.CoursierSpec
- Resolve dependency
- Get artefact path
seed.cli.util.TargetSpec
- Parse module string
seed.cli.ScaffoldSpec
- Create build file one non-JVM platform
[error] Process exited with non-zero exit code
- 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)
[compile] Compiling macros-jvm (1 Scala source)
Compiling macros-js (1 Scala source)
Compiled macros-jvm (1125ms)
Compiling example-jvm (1 Scala source)
Compiled macros-js (1468ms)
Compiling example-js (1 Scala source)
Compiled example-jvm (460ms)
Compiled example-js (865ms)

[error] Process exited with non-zero exit code
- Build project with compiler plug-in defined on cross-platform module *** 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)
[compile] Compiling macros-js (1 Scala source)
Compiling macros-jvm (1 Scala source)
Compiled macros-jvm (719ms)
Compiling example-jvm (1 Scala source)
Compiled macros-js (1031ms)
Compiling example-js (1 Scala source)
Compiled example-jvm (315ms)
Compiled example-js (409ms)

[error] Process exited with non-zero exit code
- Build project with compiler plug-in defined on platform 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)
[compile] Compiling macros-js (1 Scala source)
Compiling macros-jvm (1 Scala source)
Compiled macros-jvm (473ms)
Compiling example-jvm (1 Scala source)
Compiled example-jvm (261ms)
Compiled macros-js (775ms)
Compiling example-js (1 Scala source)
Compiled example-js (436ms)

[error] Process exited with non-zero exit code
- Build project with overridden compiler plug-in version *** 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)
- Build modules with different Scala versions
- Build project with custom class target
- Build project with custom command target
- Build project with failing custom command target
- Link module and interpret Bloop events
- Package modules with same package
[error] Error: Total 47, Failed 0, Errors 4, Passed 43
[error] Error during tests:
[error] 	seed.generation.BloopIntegrationSpec
[error] (Test / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 39 s, completed Jul 24, 2019 10:27:55 PM

@tindzk
Copy link
Owner Author

tindzk commented Jul 25, 2019

I believe Node.js is not installed on your system. After I removed Node.js here, the log output looks identical to yours.

This actually shows a usability problem in Bloop as it only returns a non-zero exit code without writing the cause of failure to stderr:

/tmp/seed1566034107928575769/example-paradise-platform $ bloop run example-js
Generated JavaScript file '/tmp/seed1566034107928575769/example-paradise-platform/build/example.js'
/tmp/seed1566034107928575769/example-paradise-platform $ echo $?         
64

- 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.
@tindzk tindzk merged commit 37b376c into master Jul 25, 2019
@tindzk tindzk deleted the issue/30 branch July 25, 2019 07:54
@megri
Copy link
Contributor

megri commented Jul 25, 2019

I do have node.js installed.

➜  seed git:(issue/30) ✗ node --version
v11.12.0

@megri
Copy link
Contributor

megri commented Jul 25, 2019

I tried running bloop run example-js example-jvm as done by the test suite and I got spurious errors. At first it resulted in an error but the subsequent run succeeded. So it may be some issue with bloop..

➜  example-paradise-versions bloop run example-js example-jvm
hello
Generated JavaScript file '/var/folders/gk/lg03rzws1xvgfgm55236ff2m0000gn/T/seed3796335164859073647/example-paradise-versions/build/example.js'
Jul 25, 2019 11:55:57 AM com.zaxxer.nuprocess.osx.OsxProcess start
WARNING: Exception thrown from handler
java.lang.RuntimeException: Invocation of posix_spawn() failed, return code: 2, last error: 2
        at com.zaxxer.nuprocess.internal.BasePosixProcess.checkReturnCode(BasePosixProcess.java:639)
        at com.zaxxer.nuprocess.osx.OsxProcess.start(OsxProcess.java:85)
        at com.zaxxer.nuprocess.osx.OsxProcessFactory.createProcess(OsxProcessFactory.java:34)
        at com.zaxxer.nuprocess.NuProcessBuilder.start(NuProcessBuilder.java:266)
        at bloop.exec.Forker$.$anonfun$run$2(Forker.scala:175)
        at monix.eval.internal.TaskRunLoop$.monix$eval$internal$TaskRunLoop$$loop$1(TaskRunLoop.scala:187)
        at monix.eval.internal.TaskRunLoop$RestartCallback$1.onSuccess(TaskRunLoop.scala:119)
        at monix.eval.Task$.$anonfun$forkedUnit$2(Task.scala:1463)
        at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

➜  example-paradise-versions bloop run example-js example-jvm
hello
Generated JavaScript file '/var/folders/gk/lg03rzws1xvgfgm55236ff2m0000gn/T/seed3796335164859073647/example-paradise-versions/build/example.js'

@tindzk
Copy link
Owner Author

tindzk commented Jul 26, 2019

This looks like a problem with Bloop indeed. You could pass in --verbose to see more debug output. Feel free to open an issue on the Bloop project for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix tests
2 participants