Jasmine tests

35 views
Skip to first unread message

Shell (Aridhia Informatics)

unread,
Feb 18, 2013, 5:14:59 AM2/18/13
to choru...@googlegroups.com
Hi,

I'm taking a look at front-end testing but have come unstuck when it comes to running the Jasmine tests; I'm unsure of the full requirements to get them running, but this is what I have:

1) Full dev environment up and running, no outstanding problems
2) From $CHORUS_HOME, run rake spec or rake fixtures generates an error:

10:06:31 OpenChorus $ rake spec
/Users/shellbryson/.rvm/rubies/jruby-1.7.0/bin/jruby -S rspec spec/controllers/analyze_controller_spec.rb spec/controllers/application_controller_spec.rb spec/controllers/attachment_downloads_controller_spec.rb spec/controllers/attachments_controller_spec.rb spec/controllers/chorus_views_controller_spec.rb spec/controllers/column_controller_spec.rb spec/controllers/comments_controller_spec.rb spec/controllers/configurations_controller_spec.rb spec/controllers/data_downloads_controller_spec.rb spec/controllers/data_source

[...]

spec/services/workfile_name_spec.rb
io/console not supported; tty will not be manipulated
Rack::File headers parameter replaces cache_control after Rack 1.5.
NoMethodError: undefined method `[]' for nil:NilClass
  InstanceIntegration at /Users/shellbryson/RubymineProjects/OpenChorus/spec/support/database_integration/instance_integration.rb:13
               (root) at /Users/shellbryson/RubymineProjects/OpenChorus/spec/support/database_integration/instance_integration.rb:6
              require at org/jruby/RubyKernel.java:1019
              require at /Users/shellbryson/.rvm/gems/jruby-1.7.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251
      load_dependency at /Users/shellbryson/.rvm/gems/jruby-1.7.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236
              require at /Users/shellbryson/.rvm/gems/jruby-1.7.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251
               (root) at /Users/shellbryson/RubymineProjects/OpenChorus/spec/spec_helper.rb:1
                 each at org/jruby/RubyArray.java:1612
               (root) at /Users/shellbryson/RubymineProjects/OpenChorus/spec/spec_helper.rb:31
              require at org/jruby/RubyKernel.java:1019
               (root) at /Users/shellbryson/RubymineProjects/OpenChorus/spec/spec_helper.rb:31
                 load at org/jruby/RubyKernel.java:1045
               (root) at /Users/shellbryson/RubymineProjects/OpenChorus/spec/controllers/analyze_controller_spec.rb:1
                 each at org/jruby/RubyArray.java:1612
               (root) at /Users/shellbryson/RubymineProjects/OpenChorus/spec/controllers/analyze_controller_spec.rb:1
               (root) at /Users/shellbryson/.rvm/gems/jruby-1.7.0/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:1
      load_spec_files at /Users/shellbryson/.rvm/gems/jruby-1.7.0/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789
      load_spec_files at /Users/shellbryson/.rvm/gems/jruby-1.7.0/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789

rake aborted!
/Users/shellbryson/.rvm/rubies/jruby-1.7.0/bin/jruby -S rspec spec/controllers/analyze_controller_spec.rb spec/controllers/application_controller_spec.rb

[...]

p_spec.rb spec/services/multiple_resultset_query_spec.rb spec/services/solr_indexer_spec.rb spec/services/sql_executor_spec.rb spec/services/svg_to_png_spec.rb spec/services/workfile_name_spec.rb failed
/Users/shellbryson/.rvm/gems/jruby-1.7.0/gems/rspec-core-2.12.2/lib/rspec/core/rake_task.rb:156:in `run_task'
/Users/shellbryson/.rvm/gems/jruby-1.7.0/gems/rspec-core-2.12.2/lib/rspec/core/rake_task.rb:124:in `initialize'
org/jruby/RubyBasicObject.java:1673:in `__send__'
org/jruby/RubyKernel.java:2081:in `send'
/Users/shellbryson/.rvm/gems/jruby-1.7.0/gems/rspec-core-2.12.2/lib/rspec/core/rake_task.rb:122:in `initialize'
org/jruby/RubyProc.java:249:in `call'
org/jruby/RubyArray.java:1612:in `each'
org/jruby/RubyArray.java:1612:in `each'
org/jruby/RubyKernel.java:1045:in `load'
org/jruby/RubyKernel.java:1065:in `eval'
/Users/shellbryson/.rvm/gems/jruby-1.7.0/bin/ruby_noexec_wrapper:14:in `(root)'
Tasks: TOP => spec
(See full trace by running task with --trace)

[end]

3) Instructions also suggest hitting http://localhost:8888. There's nothing running on this port Am I supposed to run some other process?
4) I haven't setup the Greenplum VM - rather not unless it's absolutely required for UI testing as my dev machine is fairly weak.
5) I have Open Chorus running - should I shut it down before attempting to run Jasmine tests?

Apologies for these questions, this is part of the technology stack I have no experience of.

Shell

Joseph Palermo

unread,
Feb 18, 2013, 6:48:16 AM2/18/13
to choru...@googlegroups.com
It looks like you are on an older revision that doesn't handle not having a test instance of Greenplum DB very well.  This has been cleaned up in later commits.

You don't need a Greenplum DB for actually running the Jasmine specs, but you'll need it to build the JSON fixtures that are used in Jasmine, you'll either need to update to a more recent version, or point your machine at a Greenplum DB.  It doesn't have to be running locally though.  In your version, you should be able to edit the test_instance_connection_config.yml file, and add a new entry for your Greenplum DB instance.  Then when you run the specs, just specify GPDB_HOST=your_host_name_here and it will use that instance.

Once you get that file pointed at a Greenplum instance, you'll want to run "GPDB_HOST=your_host_name_here rake jasmine:fixtures" to generate the JSON fixtures. (I updated the wiki with this correction).

To access the specs on localhost:8888 you'll need to start the Jasmine server.  To start all the test dependencies, you can run "foreman start".  If you are only running Jasmine, you can start only it by running "foreman start jasmine".

You don't need all of Chorus running to run the tests, but it is fine to leave running.  To build the JSON fixtures you'll need at least postgres running, but once those are built, you shouldn't need any of Chorus running to run the Jasmine specs.

Shell (Aridhia Informatics)

unread,
Feb 18, 2013, 9:15:22 AM2/18/13
to choru...@googlegroups.com
Okay, that makes sense. Firstly, trying to get our branch brought up-to-date before I tackle this in anger. Will try again then.

Thanks, Joseph.

S.
Reply all
Reply to author
Forward
0 new messages