Debugging a command-line unit test build step...

Hello. New to the group and new to TeamCity so any help would be greatly appreciated (without too much laughter).

I have a jasmine based test harness that is utilizing a requrejs backbone configuration for accessing the javascript assests for the test process.

this is worlking fine standalone, e.g., :
C:\work\test\src\libs>phantomjs runners\phantomjs-testrunner.js file:///C:/work/test//specrunner.html
%cPortal application - OnStartup color: green;
%cInitializing views. color: blue;
Adding JobsMonitorDataManager to IntervalManager process.
IntervalManager Starting...
%cRoute  not recognized. Navigating to app home. color: green;
##teamcity[progressStart 'Running Jasmine Tests']
%cNo cookie found, redirecting to login page. color: green;
##teamcity[testSuiteStarted name='A demo']
##teamcity[testStarted name='should add two numbers correctly' captureStandardOutput='true']
##teamcity[testFinished name='should add two numbers correctly']
...
and finishes with no errors.

Trying to setup this in TeamCity as such:

Runner type: Command Line
Step name: JavaScript Tests
Execute step: If all previous steps finished successfully
Working directory: %teamcity.build.checkoutDir%\test\src\libs
Run: Executable with parameters
Command executable: %teamcity.build.checkoutDir%\3rdParty\Phantomjs-1.9.7\phantomjs
Command parameters: runners\phantomjs-testrunner.js file:///%teamcity.build.checkoutDir%/WAOnline.Test.Javascript/specrunner.html
(be aware that my testrunner will replace backslashes from windows file references to forward, thus "fixing" the file:/// reference if necessary... it does load).

but when this build step executes it fails like this:

[16:35:48]Step 5/5: Javascript Tests (Command Line) (1m:06s)
[16:35:48]Starting: C:\Windows\system32\cmd.exe /c C:\TeamCity\buildAgent\work\d24dd4b0ece47a41\3rdParty\Phantomjs-1.9.7\phantomjs runners\phantomjs-testrunner.js file:///C:\TeamCity\buildAgent\work\d24dd4b0ece47a41/test/specrunner.html
[16:35:48]in directory: C:\TeamCity\buildAgent\work\d24dd4b0ece47a41\test\src\libs
[16:35:49]Loading file:///C:/TeamCity/buildAgent/work/d24dd4b0ece47a41/test/specrunner.html
[16:35:49]Error: Script error for: PortalPhrases
[16:35:49]
[16:35:49] file:///C:/TeamCity/buildAgent/work/d24dd4b0ece47a41/WAOnline.Web.Common/Frameworks/require.js:13 in da
[16:35:49] file:///C:/TeamCity/buildAgent/work/d24dd4b0ece47a41/WAOnline.Web.Common/Frameworks/require.js:32 in w
[16:35:49] file:///C:/TeamCity/buildAgent/work/d24dd4b0ece47a41/WAOnline.Web.Common/Frameworks/require.js:122
[16:35:49]Error: Script error for: templates
[16:35:49]
[16:35:49] file:///C:/TeamCity/buildAgent/work/d24dd4b0ece47a41/WAOnline


...
and basically goes on to fail miserably.

from my limited experience it would appear that require is not finding the referenced assets in this environment since no actual errors exist in the code itself.
Would this be a logical assessment? Is there something obvious I'm doing incorrectly in defining my build step here? Can someone provide some ideas on how to debug the problem(s) ?

Thanks in advance for any help on this,
Karl
1 comment
Comment actions Permalink

so my answer is "yes". There are custom build steps in our VS Solution build that generates composite JS files and drops them in place. Since no such process is in our TC process these assets do not exist. This needs to be duplicated in TeamCity.

0

Please sign in to leave a comment.