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

Having multiple JasmineSuite test cases fails #49

Open
SoftwareMaven opened this issue Sep 25, 2014 · 1 comment
Open

Having multiple JasmineSuite test cases fails #49

SoftwareMaven opened this issue Sep 25, 2014 · 1 comment

Comments

@SoftwareMaven
Copy link

I've separated my coffeescript into their respective Django apps. As such, I have multiple test cases, one for each app. When I have one test case run, everything is fine, but when I add a second, the test fails. It actually "feels" like the tests run, but the output never makes it back.

Here is the output with verbosity turned on:

======================================================================
 ERROR: test (uln_ui.systemlist.tests.SystemListJSTestCase)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/travis/src/uln/eggs/django.js-0.8.1-py3.3.egg/djangojs/runners.py", line 285, in test
     self.run_suite()
   File "/home/travis/src/uln/eggs/django.js-0.8.1-py3.3.egg/djangojs/runners.py", line 170, in run_suite
     self.phantomjs(self.phantomjs_runner, url, title=self.title)
   File "/home/travis/src/uln/eggs/django.js-0.8.1-py3.3.egg/djangojs/runners.py", line 154, in phantomjs
     raise JsTestException('Failed javascript assertions', failures)
 nose.proxy.JsTestException: Failed javascript assertions
  + encountered a declaration exception - expected: 'undefined', got: 'undefined'
         http://localhost:8081/static/js/djangojs/django.min.js:1
         :8
         :308
-------------------- >> begin captured stdout << ---------------------

======================================================================
                       SystemList Jasmine Suite
======================================================================
Executing: ('phantomjs', '--cookies-file=/tmp/tmpul5kx_', '/home/travis/src/uln/eggs/django.js-0.8.1-py3.3.egg/djangojs/phantomjs/jasmine-runner.js', 'http://localhost:8081/jasmine', '3')
Coffee: systemlist/tests.coffee

# module:  ULN System List App
    # module:  SystemList Controller
    # test: encountered a declaration exception
    not ok 1 - expected: 'undefined', got: 'undefined', source: at http://localhost:8081/static/js/djangojs/django.min.js:1
    #    at :8
    #    at http://localhost:8081/static/js/test/libs/jasmine.js:819
    #    at http://localhost:8081/static/js/test/libs/jasmine.js:603
    #    at :308
    #    at http://localhost:8081/static/js/test/libs/jasmine.js:819
    #    at http://localhost:8081/static/js/test/libs/jasmine.js:603

TypeError: 'null' is not an object (evaluating 'match[1]')
  http://localhost:8081/static/js/test/libs/jasmine-djangojs.js:100
  http://localhost:8081/static/js/test/libs/jasmine-djangojs.js:85
  http://localhost:8081/static/js/test/libs/jasmine-djangojs.js:74
  http://localhost:8081/static/js/test/libs/jasmine.js:1788
  http://localhost:8081/static/js/test/libs/jasmine.js:2343
  http://localhost:8081/static/js/test/libs/jasmine.js:2348
  http://localhost:8081/static/js/test/libs/jasmine.js:2377
  http://localhost:8081/static/js/test/libs/jasmine.js:2106
  http://localhost:8081/static/js/test/libs/jasmine.js:2086

'waitFor()' timeout

======================================================================
ULN System List App
    SystemList Controller
        encountered a declaration exception (ko)
======================================================================

--------------------- >> end captured stdout << ----------------------

I did some digging, to the extent I could follow, and it looks like it is failing trying to communicate with phantomjs. The tests all run fine if I run them manually in the test server.

My workaround is probably going to be using a single test case that includes all of my test specs, but I find it sub-optimal. :)

@SoftwareMaven
Copy link
Author

Color me confused. It isn't actually a function of multiple tests. It is a function of reverse() not finding a URL, and, while the exception that gets thrown is very clear, that information gets hidden completely, even with verbosity high.

So, that begs the question of the best method to handle URLs in test_urls: is it best to include urls.py for the app and override/append, or should we duplicate only what we need?

Since better information could be presented to the user in case of an error, I'm leaving this issue open, though I'm not sure exactly how to accomplish this. :)

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

No branches or pull requests

1 participant