BladeRunnerJS / brjs

BladeRunnerJS (BRJS) is an open source development toolkit and framework for modular construction of large single-page HTML5 apps. It consists of a set of conventions, supporting tools and micro-libraries that make it easy to develop, test, deploy and maintain complex JavaScript apps.
http://bladerunnerjs.org/
GNU Lesser General Public License v3.0
229 stars 36 forks source link

Can't run tests from the SDK folder #1342

Closed janhancic closed 9 years ago

janhancic commented 9 years ago

I've upgraded our app to CT v4.2.0 which uses BRJS v0.15.4.0. After the upgrade I can't run the tests from the SDK folder any more. I can run them one time, and every time after that BRJS errors out on every blade/bladeset/lib that has tests with this exception:

Testing myapp\users-bladeset\blades\clientsearch\tests\test-unit (UTs):
Unexpected Exception:
java.lang.RuntimeException: Unable to find test pack which represents the path D:\solutions\myapp\apps\myapp\users-bladeset\blades\clientsearch\tests\test-unit\js-test-driver
        at com.caplin.cutlass.command.test.testrunner.JsTestDriverBundleCreator.createRequiredBundles(JsTestDriverBundleCreator.java:50)
        at com.caplin.cutlass.command.test.testrunner.TestRunner.runTest(TestRunner.java:370)
        at com.caplin.cutlass.command.test.testrunner.TestRunner.runTestAndRecordDuration(TestRunner.java:357)
        at com.caplin.cutlass.command.test.testrunner.TestRunner.runAllTestsInDirectory(TestRunner.java:328)
        at com.caplin.cutlass.command.test.testrunner.TestRunner.runAllTestsInDirectory(TestRunner.java:333)
        at com.caplin.cutlass.command.test.testrunner.TestRunner.runTests(TestRunner.java:164)
        at com.caplin.cutlass.command.test.testrunner.TestRunnerController.run(TestRunnerController.java:118)
        at com.caplin.cutlass.command.test.TestCommand.doCommand(TestCommand.java:55)
        at org.bladerunnerjs.utility.CommandRunner.run(CommandRunner.java:25)
        at org.bladerunnerjs.model.BRJS.runCommand(BRJS.java:373)
        at org.bladerunnerjs.utility.UserCommandRunner.doRunCommand(UserCommandRunner.java:34)
        at org.bladerunnerjs.utility.UserCommandRunner.run(UserCommandRunner.java:26)
        at org.bladerunnerjs.model.BRJS.runUserCommand(BRJS.java:378)
        at org.bladerunnerjs.runner.CommandRunner.run(CommandRunner.java:111)
        at org.bladerunnerjs.runner.CommandRunner.main(CommandRunner.java:63)

If I run the tests from outside the SDK folder (in the root of the app or in the blade) then everything works as expected.

I've cloned a fresh repo assembled it and this still happens.

I'm on WIndows 7, using git-bash. My Java version is:

java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

Let me know if I can provide any more info.

briandipalma commented 9 years ago

Seeing this too, Windows and Java version:

java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
thanhc commented 9 years ago

@janhancic I just tried the scenario you mentioned on salestrader but I'm able to run the test multiple times, or have I misunderstood the steps:

thanhc@THANHC-T440P /d/Development/Motifs/salestrader/sdk (develop) $ ./brjs test ../apps/salestrader/motf-bladeset/blades/motfticket/ UTs

To help us improve BladeRunnerJS we would like to collect data on the commands run and the size of applications used with the toolkit This data is completely anonymous, does not identify you as an individual or your company and does not include any source code. Do you agree to the collection of this anonymous data? (Y/n) y

The app 'salestrader' is either missing BRJS jar(s), contains BRJS jar(s) it shouldn't or the BRJS jar(s) are outdated. You should de

Testing salestrader\motf-bladeset\blades\motfticket\tests\test-unit (UTs): ...................................................................... ........... Total 81 tests (Passed: 81; Fails: 0; Errors: 0) (425.00 ms) Chrome 36.0.1978.0 Windows: Run 81 tests (Passed: 81; Fails: 0; Errors 0) (425.00 ms) Tests Passed.

thanhc@THANHC-T440P /d/Development/Motifs/salestrader/sdk (develop) $ ./brjs test ../apps/salestrader/motf-bladeset/blades/motfticket/ UTs The app 'salestrader' is either missing BRJS jar(s), contains BRJS jar(s) it shouldn't or the BRJS jar(s) are outdated. You should de

Testing salestrader\motf-bladeset\blades\motfticket\tests\test-unit (UTs): ...................................................................... ........... Total 81 tests (Passed: 81; Fails: 0; Errors: 0) (409.00 ms) Chrome 36.0.1978.0 Windows: Run 81 tests (Passed: 81; Fails: 0; Errors 0) (409.00 ms) Tests Passed.

thanhc@THANHC-T440P /d/Development/Motifs/salestrader/sdk (develop) $ java -version java version "1.7.0_67" Java(TM) SE Runtime Environment (build 1.7.0_67-b01) Java HotSpot(TM) Client VM (build 24.65-b04, mixed mode, sharing)

janhancic commented 9 years ago

It doesn't happen on every machine. Other team members don't have this problem for instance. But it's not just my machine either, as @briandipalma experienced the same thing on a different project.

janhancic commented 9 years ago

Weird thing happened just now. Ran the tests from outside the SDK folder with sdk/brjs test apps/ and got this problem. Then ran them from inside the SDK folder and they ran fine.

ioanalianabalas commented 9 years ago

I was not able to replicate this either on my machine, neither from within or outside the sdk. My specifications are as follows:

java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

I will be continuing the investigation.

ioanalianabalas commented 9 years ago

I have reached the conclusion that symlinked paths are what is causing the test packs not to be recognized. A scenario that would cause this is listed on #1384, for example (which looks to be a duplicate of this issue).

janhancic commented 9 years ago

I don't have any symlinks in my project.

ioanalianabalas commented 9 years ago

@janhancic, I see. Would you mind trying with the 1.0-RC1 and check whether you can reproduce this issue with that?

janhancic commented 9 years ago

Do you know if latest CT has that version of BRJS?

ioanalianabalas commented 9 years ago

Yes, it's 4.2.0-64-g5ea622a-dev, I confirmed it with @thanhc.

janhancic commented 9 years ago

OK, I'll see if I have any time today. Will let you know, thanks.

ioanalianabalas commented 9 years ago

Hi @janhancic, I -think- I have managed to reproduce the issue you are having.

Here are steps I took, and I am getting the same exception message as you are.

My intention was to create an isolated app on the Desktop.

  1. From git-bash within ConEmu, in ~/Desktop: brjs create-app myapp. This created my app in brjs-apps in my original BRJS installation.
  2. I moved myapp to ~/Desktop.
  3. From git-bash within ConEmu, in ~/Desktop: brjs test myapp.

So I think there is not much point in you testing the behaviour with 1.0-RC1 since I am currently on our develop branch which incorporates the changes there.

janhancic commented 9 years ago

Lovely :)

ioanalianabalas commented 9 years ago

Fixed by #1405.

thanhc commented 9 years ago

Not able to reproduce the issue locally but closing as #1405 itself seems good, @janhancic feel free to re-open if its not fix in the next brjs release