wisdom-maven-plugin NodeManagerTest fails due to uninstalled coffeescript #157

Closed
Riduidel opened this Issue Apr 15, 2014 · 15 comments

Comments

Projects
None yet
2 participants
@Riduidel
Contributor

Riduidel commented Apr 15, 2014

When I run NodeManagerTest (in wisdom-maven-plugin project), I get failures on

  • testInstallationOfCoffeeScript
  • testReinstallation
  • testExecution

First issue (in testInstallationOfCoffeeScript) ends with failure on

     assertThat(npm.findExecutable("coffee")).isFile();

After some lookup in my folders, I found out there is a target/test folder created, in which are supposed to be stored coffeee and node-related thingies (or i guess so).

But my coffee subfolder is empty, and in my node folder, the test\node\bin\node_modules\coffee-script only contains a package.json file which is perfectly valid, but - as I've already said - is ALONE in that folder - and I guess it's what starts all that craziness.

So, I guess there is some kind of mess with installation of coffeescript ... I'll investigate that and journal my observations here ...

@Riduidel

This comment has been minimized.

Show comment
Hide comment
@Riduidel

Riduidel Apr 15, 2014

Contributor

As a related issue, is it normal NPM is extracted below node folder ?
Cause I obtain the following folder hierarchy

\---node
    \---bin
        \---node_modules
            \---npm
                +---bin
                +---doc
                +---html
                +---lib
                +---man
                +---node_modules
                |   +---abbrev
                |   \---which
                +---scripts

What specially puzzles me is the double node-modules folder hierarchy ...

Contributor

Riduidel commented Apr 15, 2014

As a related issue, is it normal NPM is extracted below node folder ?
Cause I obtain the following folder hierarchy

\---node
    \---bin
        \---node_modules
            \---npm
                +---bin
                +---doc
                +---html
                +---lib
                +---man
                +---node_modules
                |   +---abbrev
                |   \---which
                +---scripts

What specially puzzles me is the double node-modules folder hierarchy ...

@Riduidel

This comment has been minimized.

Show comment
Hide comment
@Riduidel

Riduidel Apr 15, 2014

Contributor

Installation of coffeescript is done through following command-line (isn't it a bit long ?)

[info] Executing [C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node.exe, C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\npm\bin\npm-cli.js, install, -g, coffee-script@1.7.1]

which outputs

[warn] npm http GET https://registry.npmjs.org/coffee-script/1.7.1
[warn] npm http 304 https://registry.npmjs.org/coffee-script/1.7.1
[warn] npm http GET https://registry.npmjs.org/mkdirp
[warn] npm http 304 https://registry.npmjs.org/mkdirp
[info] C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\coffee -> C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script\bin\coffee
[info] C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\cake -> C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script\bin\cake
[info] coffee-script@1.7.1 C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script
[info] ��������� mkdirp@0.3.5
[warn]
[info]

Wait ... do the two redirection lines indicates both coffee and cake are available through symbolic links or any Linux-system path manipulation ? If so, THIS IS BAD. Will do some diving in the "magical" world of node.js dependency management ...

Contributor

Riduidel commented Apr 15, 2014

Installation of coffeescript is done through following command-line (isn't it a bit long ?)

[info] Executing [C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node.exe, C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\npm\bin\npm-cli.js, install, -g, coffee-script@1.7.1]

which outputs

[warn] npm http GET https://registry.npmjs.org/coffee-script/1.7.1
[warn] npm http 304 https://registry.npmjs.org/coffee-script/1.7.1
[warn] npm http GET https://registry.npmjs.org/mkdirp
[warn] npm http 304 https://registry.npmjs.org/mkdirp
[info] C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\coffee -> C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script\bin\coffee
[info] C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\cake -> C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script\bin\cake
[info] coffee-script@1.7.1 C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script
[info] ��������� mkdirp@0.3.5
[warn]
[info]

Wait ... do the two redirection lines indicates both coffee and cake are available through symbolic links or any Linux-system path manipulation ? If so, THIS IS BAD. Will do some diving in the "magical" world of node.js dependency management ...

@Riduidel

This comment has been minimized.

Show comment
Hide comment
@Riduidel

Riduidel Apr 15, 2014

Contributor

Notice running the "standard" node command provides a different result :

C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin>npm install -g coffee-script
npm http GET https://registry.npmjs.org/coffee-script
npm http 200 https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/mkdirp
C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\coffee -> C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script\bin\coffee
C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\cake -> C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script\bin\cake
coffee-script@1.7.1 C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script
└── mkdirp@0.3.5

Which obviously ends with the correct creation of a coffee-script folder in node_modules beside the npm one. So i guess it could be a quite good idea to change used command line, if it seems possible ... no ?

Contributor

Riduidel commented Apr 15, 2014

Notice running the "standard" node command provides a different result :

C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin>npm install -g coffee-script
npm http GET https://registry.npmjs.org/coffee-script
npm http 200 https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/mkdirp
C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\coffee -> C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script\bin\coffee
C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\cake -> C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script\bin\cake
coffee-script@1.7.1 C:\Users\ndx\Documents\workspaces\git\wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script
└── mkdirp@0.3.5

Which obviously ends with the correct creation of a coffee-script folder in node_modules beside the npm one. So i guess it could be a quite good idea to change used command line, if it seems possible ... no ?

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Apr 15, 2014

Member

You mean calling npm.exe ?

The main issue here is that Wisdom is holding it's own node version in +~/.wisdom/node+. This choice was made to avoid conflicts with the node modules installed by the user.

Will try to have a look this afternoon.

Member

cescoffier commented Apr 15, 2014

You mean calling npm.exe ?

The main issue here is that Wisdom is holding it's own node version in +~/.wisdom/node+. This choice was made to avoid conflicts with the node modules installed by the user.

Will try to have a look this afternoon.

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Apr 15, 2014

Member

BTW, what kind on windows are you using ? I need the version and the architecture.

Member

cescoffier commented Apr 15, 2014

BTW, what kind on windows are you using ? I need the version and the architecture.

@Riduidel

This comment has been minimized.

Show comment
Hide comment
@Riduidel

Riduidel Apr 15, 2014

Contributor

I'm using Windows 7 x64.

And what I did to have node working was

  • go in target/test/node/bin
  • run the command defined upper, which is precisely npm install -g coffee-script

Notice that, in that folder, npm is available as npm.cmd which content is

:: Created by npm, please don't edit manually.
@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
) ELSE (
  node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
)
Contributor

Riduidel commented Apr 15, 2014

I'm using Windows 7 x64.

And what I did to have node working was

  • go in target/test/node/bin
  • run the command defined upper, which is precisely npm install -g coffee-script

Notice that, in that folder, npm is available as npm.cmd which content is

:: Created by npm, please don't edit manually.
@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
) ELSE (
  node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
)
@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Apr 15, 2014

Member

I've a failure and an error, but I'm not sure it's the same as yours:

The error:

testExecution(org.wisdom.maven.node.NodeManagerTest)  Time elapsed: 0.005 sec  <<< ERROR!
java.lang.IllegalStateException: Cannot execute NPM coffee-script - cannot find the JavaScript file matching coffee in the package.json file
        at org.wisdom.maven.node.NPM.execute(NPM.java:128)
        at org.wisdom.maven.node.NodeManagerTest.testExecution(NodeManagerTest.java:114)
        ...

The failure:

[debug] NPM coffee-script already installed in C:\Users\Clement\Documents\GitHub\wisdom\core\wisdom-maven-plugin\target\
test\node\bin\node_modules\coffee-script (1.7.1)
[error] A matching javascript file was found for coffee but the file does not exist - C:\Users\Clement\Documents\GitHub\
wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script\.\bin\coffee
Tests run: 5, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 132.745 sec <<< FAILURE!
testReinstallation(org.wisdom.maven.node.NodeManagerTest)  Time elapsed: 0.015 sec  <<< FAILURE!
java.lang.AssertionError:
Expecting actual not to be null
        at org.wisdom.maven.node.NodeManagerTest.testReinstallation(NodeManagerTest.java:94)
        ...
Member

cescoffier commented Apr 15, 2014

I've a failure and an error, but I'm not sure it's the same as yours:

The error:

testExecution(org.wisdom.maven.node.NodeManagerTest)  Time elapsed: 0.005 sec  <<< ERROR!
java.lang.IllegalStateException: Cannot execute NPM coffee-script - cannot find the JavaScript file matching coffee in the package.json file
        at org.wisdom.maven.node.NPM.execute(NPM.java:128)
        at org.wisdom.maven.node.NodeManagerTest.testExecution(NodeManagerTest.java:114)
        ...

The failure:

[debug] NPM coffee-script already installed in C:\Users\Clement\Documents\GitHub\wisdom\core\wisdom-maven-plugin\target\
test\node\bin\node_modules\coffee-script (1.7.1)
[error] A matching javascript file was found for coffee but the file does not exist - C:\Users\Clement\Documents\GitHub\
wisdom\core\wisdom-maven-plugin\target\test\node\bin\node_modules\coffee-script\.\bin\coffee
Tests run: 5, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 132.745 sec <<< FAILURE!
testReinstallation(org.wisdom.maven.node.NodeManagerTest)  Time elapsed: 0.015 sec  <<< FAILURE!
java.lang.AssertionError:
Expecting actual not to be null
        at org.wisdom.maven.node.NodeManagerTest.testReinstallation(NodeManagerTest.java:94)
        ...
@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Apr 15, 2014

Member

Got it !

The FileReader on the package.json file is not closed... Strange, Sonar didn't catch that one.

Member

cescoffier commented Apr 15, 2014

Got it !

The FileReader on the package.json file is not closed... Strange, Sonar didn't catch that one.

@cescoffier cescoffier added this to the 0.5 milestone Apr 16, 2014

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Apr 16, 2014

Member

@Riduidel Did you have time to retry ?

Member

cescoffier commented Apr 16, 2014

@Riduidel Did you have time to retry ?

@Riduidel

This comment has been minimized.

Show comment
Hide comment
@Riduidel

Riduidel Apr 17, 2014

Contributor

On 16/04/2014 19:22, Clement Escoffier wrote:

@Riduidel https://github.com/Riduidel Did you have time to retry ?

Not yet. i plan to take some time on this subject tomorrow.

Nicolas Delsaux

Contributor

Riduidel commented Apr 17, 2014

On 16/04/2014 19:22, Clement Escoffier wrote:

@Riduidel https://github.com/Riduidel Did you have time to retry ?

Not yet. i plan to take some time on this subject tomorrow.

Nicolas Delsaux

@Riduidel

This comment has been minimized.

Show comment
Hide comment
@Riduidel

Riduidel Apr 18, 2014

Contributor

On 16/04/2014 19:22, Clement Escoffier wrote:

@Riduidel https://github.com/Riduidel Did you have time to retry ?

After an update, i retried building wisdom -Pcore, this time with
success ! So consider that bug fixed.

Nicolas Delsaux

Contributor

Riduidel commented Apr 18, 2014

On 16/04/2014 19:22, Clement Escoffier wrote:

@Riduidel https://github.com/Riduidel Did you have time to retry ?

After an update, i retried building wisdom -Pcore, this time with
success ! So consider that bug fixed.

Nicolas Delsaux

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Apr 18, 2014

Member

Cool great news ! Did you try a full build on Windows ?

On 18 avr. 2014, at 14:09, Nicolas Delsaux notifications@github.com wrote:

On 16/04/2014 19:22, Clement Escoffier wrote:

@Riduidel https://github.com/Riduidel Did you have time to retry ?

After an update, i retried building wisdom -Pcore, this time with
success ! So consider that bug fixed.

Nicolas Delsaux

Reply to this email directly or view it on GitHub.

Member

cescoffier commented Apr 18, 2014

Cool great news ! Did you try a full build on Windows ?

On 18 avr. 2014, at 14:09, Nicolas Delsaux notifications@github.com wrote:

On 16/04/2014 19:22, Clement Escoffier wrote:

@Riduidel https://github.com/Riduidel Did you have time to retry ?

After an update, i retried building wisdom -Pcore, this time with
success ! So consider that bug fixed.

Nicolas Delsaux

Reply to this email directly or view it on GitHub.

@Riduidel

This comment has been minimized.

Show comment
Hide comment
@Riduidel

Riduidel Apr 18, 2014

Contributor

On 18/04/2014 14:15, Clement Escoffier wrote:

Cool great news ! Did you try a full build on Windows ?

Welli'm currenttly building wisdom framework and will go on until all is
built.

However, i've already worked on projects with complex dependencies
trees, and I found useful then to create assembly modules (which
contains the various profiles of current main module)

Do you think it would be possible to do so on wisdom to have a fully
runnable build ?

Besides, compiling framework ended with
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space

Nicolas Delsaux

Contributor

Riduidel commented Apr 18, 2014

On 18/04/2014 14:15, Clement Escoffier wrote:

Cool great news ! Did you try a full build on Windows ?

Welli'm currenttly building wisdom framework and will go on until all is
built.

However, i've already worked on projects with complex dependencies
trees, and I found useful then to create assembly modules (which
contains the various profiles of current main module)

Do you think it would be possible to do so on wisdom to have a fully
runnable build ?

Besides, compiling framework ended with
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space

Nicolas Delsaux

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Apr 18, 2014

Member

On 18 avr. 2014, at 14:17, Nicolas Delsaux notifications@github.com wrote:

On 18/04/2014 14:15, Clement Escoffier wrote:

Cool great news ! Did you try a full build on Windows ?

Welli'm currenttly building wisdom framework and will go on until all is
built.

However, i've already worked on projects with complex dependencies
trees, and I found useful then to create assembly modules (which
contains the various profiles of current main module)

Do you think it would be possible to do so on wisdom to have a fully
runnable build ?

Like having a pom file in core, one in framework and so on ? It would be great. I often find myself launching the build from the wrong directory….

Besides, compiling framework ended with
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space

Well, this is expected if you are not using Java 8 ;-). I suppose it’s the documentation project ?
Here is the CI’s configuration: -Xmx1024m -XX:MaxPermSize=512m

Nicolas Delsaux

Reply to this email directly or view it on GitHub.

Member

cescoffier commented Apr 18, 2014

On 18 avr. 2014, at 14:17, Nicolas Delsaux notifications@github.com wrote:

On 18/04/2014 14:15, Clement Escoffier wrote:

Cool great news ! Did you try a full build on Windows ?

Welli'm currenttly building wisdom framework and will go on until all is
built.

However, i've already worked on projects with complex dependencies
trees, and I found useful then to create assembly modules (which
contains the various profiles of current main module)

Do you think it would be possible to do so on wisdom to have a fully
runnable build ?

Like having a pom file in core, one in framework and so on ? It would be great. I often find myself launching the build from the wrong directory….

Besides, compiling framework ended with
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space

Well, this is expected if you are not using Java 8 ;-). I suppose it’s the documentation project ?
Here is the CI’s configuration: -Xmx1024m -XX:MaxPermSize=512m

Nicolas Delsaux

Reply to this email directly or view it on GitHub.

@Riduidel

This comment has been minimized.

Show comment
Hide comment
@Riduidel

Riduidel Apr 18, 2014

Contributor

On 18/04/2014 14:23, Clement Escoffier wrote:

On 18 avr. 2014, at 14:17, Nicolas Delsaux notifications@github.com
wrote:

Like having a pom file in core, one in framework and so on ? It would be
great. I often find myself launching the build from the wrong directory….

Yeah, exactly, with framework depending upon core, and so on.
Will try to do that.

Besides, compiling framework ended with
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space

Well, this is expected if you are not using Java 8 ;-). I suppose it’s
the documentation project ?

No, it's during framework compilation.

Here is the CI’s configuration: -Xmx1024m -XX:MaxPermSize=512m

Well, using -Xmx800M -XX:MaxPermSize=256M seems enough with Java7

Nicolas Delsaux

Contributor

Riduidel commented Apr 18, 2014

On 18/04/2014 14:23, Clement Escoffier wrote:

On 18 avr. 2014, at 14:17, Nicolas Delsaux notifications@github.com
wrote:

Like having a pom file in core, one in framework and so on ? It would be
great. I often find myself launching the build from the wrong directory….

Yeah, exactly, with framework depending upon core, and so on.
Will try to do that.

Besides, compiling framework ended with
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space

Well, this is expected if you are not using Java 8 ;-). I suppose it’s
the documentation project ?

No, it's during framework compilation.

Here is the CI’s configuration: -Xmx1024m -XX:MaxPermSize=512m

Well, using -Xmx800M -XX:MaxPermSize=256M seems enough with Java7

Nicolas Delsaux

@cescoffier cescoffier added the bug label May 1, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment