taverna-player 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/.gitignore +1 -0
  2. data/.travis.yml +8 -0
  3. data/CHANGES.rdoc +47 -0
  4. data/README.rdoc +43 -3
  5. data/Rakefile +1 -4
  6. data/app/assets/stylesheets/taverna_player/coderay.css +30 -20
  7. data/app/controllers/taverna_player/application_controller.rb +2 -2
  8. data/app/controllers/taverna_player/job_queue_controller.rb +18 -0
  9. data/app/models/taverna_player/run.rb +10 -3
  10. data/app/views/taverna_player/job_queue/index.html.erb +47 -0
  11. data/app/views/taverna_player/runs/_interaction.html.erb +7 -1
  12. data/app/views/taverna_player/runs/embedded/new.html.erb +1 -1
  13. data/config/locales/en.yml +36 -0
  14. data/config/routes.rb +4 -1
  15. data/db/migrate/20140226135723_change_taverna_player_runs_status_message_to_use_keys.rb +19 -0
  16. data/lib/generators/taverna_player/install_generator.rb +6 -1
  17. data/lib/generators/templates/ReadMe.txt +6 -0
  18. data/lib/generators/templates/controllers/job_queue_controller.rb +19 -0
  19. data/lib/generators/templates/player_initializer.rb +8 -0
  20. data/lib/tasks/delete-cancelled-runs.rake +1 -1
  21. data/lib/taverna-player.rb +9 -1
  22. data/lib/taverna_player/concerns/controllers/job_queue_controller.rb +38 -0
  23. data/lib/taverna_player/concerns/controllers/runs_controller.rb +2 -13
  24. data/lib/taverna_player/concerns/models/run.rb +22 -9
  25. data/lib/taverna_player/concerns/models/run_port.rb +5 -0
  26. data/lib/taverna_player/port_renderer.rb +1 -1
  27. data/lib/taverna_player/version.rb +1 -1
  28. data/lib/taverna_player/worker.rb +78 -51
  29. data/taverna_player.gemspec +7 -5
  30. data/test/dummy/app/views/home/index.html.erb +1 -1
  31. data/test/dummy/app/views/layouts/application.html.erb +2 -1
  32. data/test/dummy/config/application.rb +1 -0
  33. data/test/dummy/config/initializers/taverna_player.rb +8 -3
  34. data/test/dummy/config/locales/taverna_player.en.yml +36 -0
  35. data/test/dummy/db/migrate/20140226143013_change_taverna_player_runs_status_message_to_use_keys.taverna_player.rb +20 -0
  36. data/test/dummy/db/schema.rb +9 -9
  37. data/test/dummy/lib/callbacks.rb +1 -5
  38. data/test/fixtures/files/non-ascii.csv +30 -0
  39. data/test/fixtures/taverna_player/interactions.yml +4 -1
  40. data/test/fixtures/taverna_player/runs.yml +6 -1
  41. data/test/functional/taverna_player/job_queue_controller_test.rb +35 -0
  42. data/test/functional/taverna_player/runs_controller_test.rb +20 -0
  43. data/test/functional/taverna_player/service_credentials_controller_test.rb +3 -3
  44. data/test/test_helper.rb +4 -1
  45. data/test/unit/helpers/taverna_player/runs_helper_test.rb +20 -1
  46. data/test/unit/taverna_player/run_port_test.rb +41 -5
  47. data/test/unit/{utils_test.rb → taverna_player/utils_test.rb} +0 -0
  48. data/test/unit/taverna_player/worker_test.rb +201 -0
  49. metadata +67 -18
  50. data/test/fixtures/files/crassostrea_gigas.csv +0 -737
@@ -34,19 +34,21 @@ Gem::Specification.new do |s|
34
34
  s.test_files = `git ls-files -- test/*`.split("\n")
35
35
 
36
36
  s.add_dependency "rails", "~> 3.2.12"
37
- s.add_dependency "jquery-rails", "~> 3.0.4"
38
- s.add_dependency "paperclip", "~> 3.4.1"
37
+ s.add_dependency "jquery-rails", "~> 3.0"
38
+ s.add_dependency "paperclip", "~> 4.1"
39
39
  s.add_dependency "t2-server", "~> 1.0.0"
40
- s.add_dependency "delayed_job_active_record", "~> 0.4.3"
40
+ s.add_dependency "delayed_job_active_record", "~> 4.0"
41
41
  s.add_dependency "daemons", "~> 1.1.9"
42
42
  s.add_dependency "rubyzip", "~> 0.9.9"
43
- s.add_dependency "coderay", "~> 1.0.9"
43
+ s.add_dependency "coderay", "~> 1.1"
44
44
  s.add_dependency "rails_autolink", "~> 1.1.0"
45
45
  s.add_dependency "require_all", "~> 1.3.1"
46
- s.add_dependency "jbuilder", "~> 1.5.2"
46
+ s.add_dependency "jbuilder", "~> 2.0"
47
47
  s.add_dependency "pmrpc-rails", "~> 1.0.0"
48
48
 
49
49
  s.add_development_dependency "sqlite3"
50
+ s.add_development_dependency "coveralls"
51
+ s.add_development_dependency "flexmock", "~> 1.3"
50
52
 
51
53
  s.require_path = "lib"
52
54
  end
@@ -14,5 +14,5 @@
14
14
 
15
15
  <h2>An embedded workflow</h2>
16
16
  <div>
17
- <iframe src="<%= new_embedded_run_url(3) %>&input=10" width="100%" height="500px"></iframe>
17
+ <iframe src="<%= new_embedded_run_url(3) %>&input[input]=10" width="100%" height="500px"></iframe>
18
18
  </div>
@@ -28,7 +28,8 @@
28
28
  <%= link_to "Home", main_app.root_path %> |
29
29
  <%= link_to "Workflows", main_app.workflows_path %> |
30
30
  <%= link_to "Runs", taverna_player.runs_path %> |
31
- <%= link_to "Service Credentials", taverna_player.service_credentials_path %>
31
+ <%= link_to "Service Credentials", taverna_player.service_credentials_path %> |
32
+ <%= link_to "Job Queue", taverna_player.job_queue_path %>
32
33
  </p>
33
34
 
34
35
  <p id="notice"><%= notice %></p>
@@ -25,6 +25,7 @@ module Dummy
25
25
  # config.time_zone = 'Central Time (US & Canada)'
26
26
 
27
27
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
28
+ I18n.enforce_available_locales = true
28
29
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
29
30
  # config.i18n.default_locale = :de
30
31
 
@@ -1,5 +1,5 @@
1
1
  #------------------------------------------------------------------------------
2
- # Copyright (c) 2013 The University of Manchester, UK.
2
+ # Copyright (c) 2013, 2014 The University of Manchester, UK.
3
3
  #
4
4
  # BSD Licenced. See LICENCE.rdoc for details.
5
5
  #
@@ -13,9 +13,14 @@
13
13
  # Taverna Player configuration
14
14
 
15
15
  TavernaPlayer.setup do |config|
16
- config.workflow_model_proxy("Workflow")
16
+ config.workflow_model_proxy("Workflow") do |proxy|
17
+ proxy.file_method_name = :file
18
+ end
17
19
  config.user_model_proxy = "User"
18
- config.current_user_callback = :user_one
20
+ config.current_user_callback = Proc.new { User.find(1) }
21
+
22
+ # Move admin resources into their own namespace.
23
+ config.admin_scope = "admin"
19
24
 
20
25
  # Callbacks to be run at various points during a workflow run.
21
26
  require "callbacks"
@@ -0,0 +1,36 @@
1
+ #------------------------------------------------------------------------------
2
+ # Copyright (c) 2014 The University of Manchester, UK.
3
+ #
4
+ # BSD Licenced. See LICENCE.rdoc for details.
5
+ #
6
+ # Taverna Player was developed in the BioVeL project, funded by the European
7
+ # Commission 7th Framework Programme (FP7), through grant agreement
8
+ # number 283359.
9
+ #
10
+ # Author: Robert Haines
11
+ #------------------------------------------------------------------------------
12
+
13
+ en:
14
+ taverna_player:
15
+ status:
16
+ pending: "Queued!"
17
+ pre-callback: "Running pre-run tasks"
18
+ connect: "Connecting to Taverna Server"
19
+ full: "Server full - please wait; run will start soon"
20
+ initialized: "Initializing new workflow run"
21
+ inputs: "Uploading run inputs"
22
+ start: "Starting run"
23
+ busy: "Server busy - please wait; run will start soon"
24
+ running: "Running!"
25
+ interact: "Waiting for user input"
26
+ outputs: "Gathering run outputs and log"
27
+ post-callback: "Running post-run tasks"
28
+ finished: "Finished!"
29
+ cancel: "Cancelling"
30
+ cancel-callback: "Running post-cancel tasks"
31
+ cancelled: "Cancelled!"
32
+ timeout: "Run execution timed out"
33
+ fail-callback: "Running post-failure tasks"
34
+ failed: "Failed!"
35
+ errors:
36
+ invalid-parent: "Parents must have lower ids than their children"
@@ -0,0 +1,20 @@
1
+ # This migration comes from taverna_player (originally 20140226135723)
2
+ class ChangeTavernaPlayerRunsStatusMessageToUseKeys < ActiveRecord::Migration
3
+ def up
4
+ rename_column :taverna_player_runs, :status_message, :status_message_key
5
+
6
+ TavernaPlayer::Run.all.each do |run|
7
+ run.status_message_key = run.saved_state
8
+ run.save
9
+ end
10
+ end
11
+
12
+ def down
13
+ rename_column :taverna_player_runs, :status_message_key, :status_message
14
+
15
+ TavernaPlayer::Run.all.each do |run|
16
+ run.status_message = run.saved_state.capitalize
17
+ run.save
18
+ end
19
+ end
20
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20131127172420) do
14
+ ActiveRecord::Schema.define(:version => 20140226143013) do
15
15
 
16
16
  create_table "delayed_jobs", :force => true do |t|
17
17
  t.integer "priority", :default => 0
@@ -66,21 +66,21 @@ ActiveRecord::Schema.define(:version => 20131127172420) do
66
66
 
67
67
  create_table "taverna_player_runs", :force => true do |t|
68
68
  t.string "run_id"
69
- t.string "saved_state", :default => "pending", :null => false
69
+ t.string "saved_state", :default => "pending", :null => false
70
70
  t.datetime "create_time"
71
71
  t.datetime "start_time"
72
72
  t.datetime "finish_time"
73
- t.integer "workflow_id", :null => false
74
- t.datetime "created_at", :null => false
75
- t.datetime "updated_at", :null => false
76
- t.string "status_message"
73
+ t.integer "workflow_id", :null => false
74
+ t.datetime "created_at", :null => false
75
+ t.datetime "updated_at", :null => false
76
+ t.string "status_message_key"
77
77
  t.string "results_file_name"
78
78
  t.integer "results_file_size"
79
- t.boolean "embedded", :default => false
80
- t.boolean "stop", :default => false
79
+ t.boolean "embedded", :default => false
80
+ t.boolean "stop", :default => false
81
81
  t.string "log_file_name"
82
82
  t.integer "log_file_size"
83
- t.string "name", :default => "None"
83
+ t.string "name", :default => "None"
84
84
  t.integer "delayed_job_id"
85
85
  t.text "failure_message"
86
86
  t.integer "parent_id"
@@ -1,5 +1,5 @@
1
1
  #------------------------------------------------------------------------------
2
- # Copyright (c) 2013 The University of Manchester, UK.
2
+ # Copyright (c) 2013, 2014 The University of Manchester, UK.
3
3
  #
4
4
  # BSD Licenced. See LICENCE.rdoc for details.
5
5
  #
@@ -29,7 +29,3 @@ def player_run_failed_callback(run)
29
29
  w = Workflow.find(run.workflow_id)
30
30
  puts "Run-failed callback called for run '#{run.name}' of workflow '#{w.id}'"
31
31
  end
32
-
33
- def user_one
34
- User.find(1)
35
- end
@@ -0,0 +1,30 @@
1
+ authorship,genusPart,infragenericEpithet,specificEpithet,infraspecificEpithet,nameComplete,uninomial,taxonName,occurrenceID,decimalLatitude,decimalLongitude,earliestDateCollected,latestDateCollected,coordinateUncertaintyInMeters,country,collector,fieldNotes,locality,maximumDepthInMeters,maximumElevationInMeters,minimumDepthInMeters,minimumElevationInMeters,value,dataProviderName,dataResourceName,dataResourceRights,dataResourceCitation
2
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354286810,55.0315,8.428,2009-08-18,2009-08-18,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2009,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2009, doi:10.1594/PANGAEA.755038"
3
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354286812,55.0304,8.4339,2009-08-18,2009-08-18,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2009,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2009, doi:10.1594/PANGAEA.755038"
4
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354286811,55.0312,8.4314,2009-08-18,2009-08-18,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2009,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2009, doi:10.1594/PANGAEA.755038"
5
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354288927,55.0312,8.4314,2010-08-10,2010-08-10,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2010,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2010, doi:10.1594/PANGAEA.755039"
6
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354288926,55.0315,8.428,2010-08-10,2010-08-10,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2010,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2010, doi:10.1594/PANGAEA.755039"
7
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354288929,55.0304,8.4339,2010-08-10,2010-08-10,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2010,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2010, doi:10.1594/PANGAEA.755039"
8
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354288928,55.0368,8.4172,2010-08-10,2010-08-10,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2010,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2010, doi:10.1594/PANGAEA.755039"
9
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354285291,55.0315,8.428,2007-08-21,2007-08-21,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2007,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2007, doi:10.1594/PANGAEA.755036"
10
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354285292,55.0312,8.4314,2007-08-21,2007-08-21,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2007,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2007, doi:10.1594/PANGAEA.755036"
11
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354285293,55.0304,8.4339,2007-08-21,2007-08-21,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2007,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2007, doi:10.1594/PANGAEA.755036"
12
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354286707,55.0312,8.4314,2008-08-01,2008-08-01,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2008,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2008, doi:10.1594/PANGAEA.755037"
13
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354286705,55.0304,8.4339,2008-08-01,2008-08-01,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2008,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2008, doi:10.1594/PANGAEA.755037"
14
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354286704,55.0315,8.428,2008-08-01,2008-08-01,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2008,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2008, doi:10.1594/PANGAEA.755037"
15
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,354286706,55.0368,8.4172,2008-08-01,2008-08-01,,,,,,,,0,,,PANGAEA - Publishing Network for Geoscientific and Environmental Data,Abundance of macrobenthos organisms in the northern Wadden Sea in 2008,,"Buschbaum, Christian (2010): Abundance of macrobenthos organisms in the northern Wadden Sea in 2008, doi:10.1594/PANGAEA.755037"
16
+ ,,,gigas,,Crassostrea gigas,,Crassostrea gigas,675167609,58.447262,8.8255959,2009-04-25,2009-04-25,70,Norway,Olsen K.M.,,Flangeborgkilen ?��?�???��?�?��?��?��?????��?�?��?????��???�?��?�???��?�??��?��?��?????����?��?�???��?�??��?��?��?�???��?�??��?�?��?�???��?�?��?��?��?????��?�?�??��?????��???�?��?�???��?�??��?��?��????���??��?�???��?�?��?��?��?????��?�?�??��?????��???ᬨ�����Ƭ���?��?�,0,0,0,0,,"Natural History Museum, University of Oslo",BioFokus,,
17
+ ,,,gigas,,Crassostrea gigas,,Crassostrea gigas,675183925,58.624622,9.0724735,2010-07-14,2010-07-14,180,Norway,Olsen K.M.,,Engholmen ?��?�???��?�?��?��?��?????��?�?��?????��???�?��?�???��?�??��?��?��?????����?��?�???��?�??��?��?��?�???��?�??��?�?��?�???��?�?��?��?��?????��?�?�??��?????��???�?��?�???��?�??��?��?��????���??��?�???��?�?��?��?��?????��?�?�??��?????��???ᬨ�����Ƭ���?��?� Pollen p?��?�???��?�?��?��?��?????��?�?��?????��???�?��?�???��?�??��?��?��?�???��?�?��?�?�??��?�???��?�??��?��?��?�???��?�??��?�?��?�???��?�?��?��?��?????��?�?��?????��???�?��?�???��?�??��?��?��?????�����������Ƭ������� nordsiden,0,2,0,0,,"Natural History Museum, University of Oslo",BioFokus,,
18
+ ,,,gigas,,Crassostrea gigas,,Crassostrea gigas,675159927,58.624821,9.0718365,2009-06-02,2009-06-02,7,Norway,Monrad J.V.,,Engholmkilen ?��?�???��?�?��?��?��?????��?�?��?????��???�?��?�???��?�??��?��?��?????����?��?�???��?�??��?��?��?�???��?�??��?�?��?�???��?�?��?��?��?????��?�?�??��?????��???�?��?�???��?�??��?��?��????���??��?�???��?�?��?��?��?????��?�?�??��?????��???ᬨ�����Ƭ���?��?� Der veien slutter ved Nordmannsvik og Engholmkilen,0,0,0,0,,"Natural History Museum, University of Oslo",BioFokus,,
19
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,251587382,54.42686225641775,-3.57473127238348,1994-11-30,1994-11-30,70.7,GB,Ian Killeen;Shelagh Smith,,"Nethertown, 6km north of Sellafield,Cumbria.",,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
20
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,251577332,51.780431971927264,1.0374767507215295,,,707,GB,Pam Wilson;Peter Wilson,,Colne point Nature Reserve Essex,,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
21
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,323579489,49.251403,-2.115802,1998-09-10,1998-09-10,70.7,,Ian Killeen;Jan Light,,Bonne Nuit Bay,,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
22
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,251581774,51.74780687224405,0.9048652323607271,1997-09-15,1997-09-15,707,GB,Pam Wilson;Peter Wilson,,Bradwell on sea Essex,,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
23
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,323586215,49.180744,-2.186292,1998-09-09,1998-09-09,70.7,,Anon @Conch Soc,,Ouaisne Jersey,,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
24
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,323566084,48.574139,-2.767877,1997-05-11,1997-05-11,70.7,,Ian Killeen;Jan Light,,Tournemine W Greve des Rosaires,,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
25
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,251613062,53.14742113099659,-4.302225486046831,2001-07-25,2001-07-25,70.7,GB,Tom Clifton,,"Menaifron, Menai Strait, Anglesey.",,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
26
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,251609930,53.31752338375657,-4.641740177559318,1993-05-22,1993-05-22,70.7,GB,Tom Clifton,,"Holyhead Harbour, Anglesey.",,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
27
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,251556416,50.57310347016449,-2.4943183095345627,1989-11-23,1989-11-23,7071,GB,Dennis Seaward,,Middle and East Fleet Dorset,,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
28
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,323585993,49.151749,-2.042473,1998-09-08,1998-09-08,70.7,,Ian Killeen;Jan Light,,Le Hocq St Crements Bay,,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
29
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,323586310,49.251403,-2.115802,1998-09-10,1998-09-10,70.7,,Ian Killeen;Jan Light,,Bonne Nuit Bay Jersey,,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
30
+ ,,,,,Crassostrea gigas,,Crassostrea gigas,251613098,53.166018176771246,-4.270302423010207,1991-09-15,1991-09-15,70.7,GB,Tom Clifton,,"Barras, Menai Strait, Anglesey.",,,,,,UK National Biodiversity Network,Conchological Society of Great Britain &amp; Ireland - Mollusc (marine) data for Great Britain and Ireland,Access Constraints: None Use Constraints: None,
@@ -1,5 +1,5 @@
1
1
  #------------------------------------------------------------------------------
2
- # Copyright (c) 2013 The University of Manchester, UK.
2
+ # Copyright (c) 2013, 2014 The University of Manchester, UK.
3
3
  #
4
4
  # BSD Licenced. See LICENCE.rdoc for details.
5
5
  #
@@ -15,15 +15,18 @@ one:
15
15
  replied: false
16
16
  displayed: false
17
17
  run_id: 4
18
+ page_uri: ""
18
19
 
19
20
  two:
20
21
  serial: Nested_workflow:Interaction0
21
22
  replied: true
22
23
  displayed: true
23
24
  run_id: 3
25
+ page_uri: "http://www.example.com/interactions/1.html"
24
26
 
25
27
  three:
26
28
  serial: Nested_workflow:Interaction0
27
29
  replied: false
28
30
  displayed: true
29
31
  run_id: 5
32
+ page_uri: "http://www.example.com/interactions/2.html"
@@ -1,5 +1,5 @@
1
1
  #------------------------------------------------------------------------------
2
- # Copyright (c) 2013 The University of Manchester, UK.
2
+ # Copyright (c) 2013, 2014 The University of Manchester, UK.
3
3
  #
4
4
  # BSD Licenced. See LICENCE.rdoc for details.
5
5
  #
@@ -67,3 +67,8 @@ six:
67
67
  create_time: 2013-03-13 10:55:46
68
68
  start_time: 2013-03-13 10:55:48
69
69
  workflow_id: 1
70
+
71
+ seven:
72
+ name: Test run 7
73
+ saved_state: pending
74
+ workflow_id: 1
@@ -0,0 +1,35 @@
1
+ #------------------------------------------------------------------------------
2
+ # Copyright (c) 2014 The University of Manchester, UK.
3
+ #
4
+ # BSD Licenced. See LICENCE.rdoc for details.
5
+ #
6
+ # Taverna Player was developed in the BioVeL project, funded by the European
7
+ # Commission 7th Framework Programme (FP7), through grant agreement
8
+ # number 283359.
9
+ #
10
+ # Author: Robert Haines
11
+ #------------------------------------------------------------------------------
12
+
13
+ require 'test_helper'
14
+
15
+ module TavernaPlayer
16
+ class JobQueueControllerTest < ActionController::TestCase
17
+ setup do
18
+ @routes = TavernaPlayer::Engine.routes
19
+ end
20
+
21
+ test "should route to the job queue" do
22
+ assert_routing "#{TavernaPlayer.admin_scope}/job_queue",
23
+ { :controller => "taverna_player/job_queue",
24
+ :action => "index" }, {}, {}, "Did not route correctly"
25
+ end
26
+
27
+ test "should get index" do
28
+ get :index
29
+ assert_response :success, "Response was not success"
30
+ assert_not_nil assigns(:jobs), "Jobs not assigned"
31
+ assert_template "application", "Did not render with the correct layout"
32
+ end
33
+
34
+ end
35
+ end
@@ -174,6 +174,26 @@ module TavernaPlayer
174
174
  refute assigns(:run).user_id.nil?, "Run should have a user_id"
175
175
  end
176
176
 
177
+ test "should create inputs along with run" do
178
+ assert_difference("Run.count") do
179
+ assert_difference("RunPort.count") do
180
+ post :create, :run => { :workflow_id => workflows(:three).id,
181
+ :inputs_attributes => [{:value => 'test', :name => 'IN'}]
182
+ }
183
+ end
184
+ end
185
+
186
+ assert_redirected_to run_path(assigns(:run)),
187
+ "Did not redirect correctly"
188
+ assert_equal "Run was successfully created.", flash[:notice],
189
+ "Incorrect or missing flash notice"
190
+ assert assigns(:run).valid?, "Created run was invalid"
191
+ refute assigns(:run).user_id.nil?, "Run should have a user_id"
192
+
193
+ assert_equal 1, assigns(:run).inputs.size
194
+ assert_equal 'test', assigns(:run).inputs.first.value
195
+ end
196
+
177
197
  test "should create embedded run via browser" do
178
198
  assert_difference("Run.count") do
179
199
  post :create,
@@ -1,5 +1,5 @@
1
1
  #------------------------------------------------------------------------------
2
- # Copyright (c) 2013 The University of Manchester, UK.
2
+ # Copyright (c) 2013, 2014 The University of Manchester, UK.
3
3
  #
4
4
  # BSD Licenced. See LICENCE.rdoc for details.
5
5
  #
@@ -21,13 +21,13 @@ module TavernaPlayer
21
21
  end
22
22
 
23
23
  test "should route to service credentials" do
24
- assert_routing "/service_credentials",
24
+ assert_routing "#{TavernaPlayer.admin_scope}/service_credentials",
25
25
  { :controller => "taverna_player/service_credentials",
26
26
  :action => "index" }, {}, {}, "Did not route correctly"
27
27
  end
28
28
 
29
29
  test "should route to a service credential" do
30
- assert_routing "/service_credentials/1",
30
+ assert_routing "#{TavernaPlayer.admin_scope}/service_credentials/1",
31
31
  { :controller => "taverna_player/service_credentials",
32
32
  :action => "show", :id => "1" }, {}, {}, "Did not route correctly"
33
33
  end
@@ -1,5 +1,5 @@
1
1
  #------------------------------------------------------------------------------
2
- # Copyright (c) 2013 The University of Manchester, UK.
2
+ # Copyright (c) 2013, 2014 The University of Manchester, UK.
3
3
  #
4
4
  # BSD Licenced. See LICENCE.rdoc for details.
5
5
  #
@@ -10,6 +10,9 @@
10
10
  # Author: Robert Haines
11
11
  #------------------------------------------------------------------------------
12
12
 
13
+ require 'coveralls'
14
+ Coveralls.wear!('rails')
15
+
13
16
  # Configure Rails Environment
14
17
  ENV["RAILS_ENV"] = "test"
15
18
 
@@ -1,5 +1,5 @@
1
1
  #------------------------------------------------------------------------------
2
- # Copyright (c) 2013 The University of Manchester, UK.
2
+ # Copyright (c) 2013, 2014 The University of Manchester, UK.
3
3
  #
4
4
  # BSD Licenced. See LICENCE.rdoc for details.
5
5
  #
@@ -14,6 +14,25 @@ require 'test_helper'
14
14
 
15
15
  module TavernaPlayer
16
16
  class RunsHelperTest < ActionView::TestCase
17
+ setup do
18
+ @int1 = taverna_player_interactions(:one)
19
+ @int2 = taverna_player_interactions(:two)
20
+ end
17
21
 
22
+ test "should redirect internally" do
23
+ redirect = interaction_redirect(@int1)
24
+ refute redirect.blank?, "Redirect was blank."
25
+ assert redirect.include?("/interaction/#{@int1.serial}"),
26
+ "Redirect did not include interaction serial number"
27
+ end
28
+
29
+ test "should redirect externally" do
30
+ redirect = interaction_redirect(@int2)
31
+ refute redirect.blank?, "Redirect was blank."
32
+ assert_equal redirect, @int2.page_uri,
33
+ "Redirect did not match the page URI."
34
+ refute redirect.include?("/interaction/#{@int2.serial}"),
35
+ "Redirect included interaction serial number"
36
+ end
18
37
  end
19
38
  end
@@ -117,6 +117,24 @@ module TavernaPlayer
117
117
  assert_nil port.file.path, "File present"
118
118
  end
119
119
 
120
+ test "should handle non ascii/utf-8 characters in small input values" do
121
+ test_value =
122
+ "\xC2"\
123
+ "01234567890123456789012345678901234567890123456789"\
124
+ "01234567890123456789012345678901234567890123456789"\
125
+ "01234567890123456789012345678901234567890123456789"\
126
+ "01234567890123456789012345678901234567890123456789"\
127
+ "\xC2"
128
+
129
+ port = RunPort::Input.create(:name => "test_port")
130
+ port.value = test_value
131
+ assert port.save, "Port did not save"
132
+ assert_nil port.file.path, "File present"
133
+ assert_equal test_value, port.value, "Saved value does not match test"
134
+ assert_equal port.value_preview, port.value,
135
+ "Value and preview should be equal"
136
+ end
137
+
120
138
  test "should handle non ascii/utf-8 characters in large input values" do
121
139
  test_value =
122
140
  "\xC2"\
@@ -136,6 +154,24 @@ module TavernaPlayer
136
154
  assert_not_equal port.value_preview, port.value, "Value and preview same"
137
155
  end
138
156
 
157
+ test "should handle non ascii/utf-8 characters in small output values" do
158
+ test_value =
159
+ "\xC2"\
160
+ "01234567890123456789012345678901234567890123456789"\
161
+ "01234567890123456789012345678901234567890123456789"\
162
+ "01234567890123456789012345678901234567890123456789"\
163
+ "01234567890123456789012345678901234567890123456789"\
164
+ "\xC2"
165
+
166
+ port = RunPort::Output.create(:name => "test_port")
167
+ port.value = test_value
168
+ assert port.save, "Port did not save"
169
+ assert_nil port.file.path, "File present"
170
+ assert_equal test_value, port.value, "Saved value does not match test"
171
+ assert_equal port.value_preview, port.value,
172
+ "Value and preview should be equal"
173
+ end
174
+
139
175
  test "should handle non ascii/utf-8 characters in large output values" do
140
176
  test_value =
141
177
  "\xC2"\
@@ -173,7 +209,7 @@ module TavernaPlayer
173
209
  end
174
210
 
175
211
  test "should not allow both file and value on create input" do
176
- file = fixture_file_upload "/files/crassostrea_gigas.csv"
212
+ file = fixture_file_upload "/files/non-ascii.csv"
177
213
  port = RunPort::Input.create(:name => "test_port", :value => "test",
178
214
  :file => file)
179
215
 
@@ -182,7 +218,7 @@ module TavernaPlayer
182
218
  end
183
219
 
184
220
  test "should not allow both file and value on create output" do
185
- file = fixture_file_upload "/files/crassostrea_gigas.csv"
221
+ file = fixture_file_upload "/files/non-ascii.csv"
186
222
  port = RunPort::Output.create(:name => "test_port", :value => "test",
187
223
  :file => file)
188
224
 
@@ -191,7 +227,7 @@ module TavernaPlayer
191
227
  end
192
228
 
193
229
  test "should not allow both file and value on update input" do
194
- file = fixture_file_upload "/files/crassostrea_gigas.csv"
230
+ file = fixture_file_upload "/files/non-ascii.csv"
195
231
  port = RunPort::Input.create(:name => "test_port")
196
232
 
197
233
  port.file = file
@@ -203,7 +239,7 @@ module TavernaPlayer
203
239
  end
204
240
 
205
241
  test "should not allow both file and value on update output" do
206
- file = fixture_file_upload "/files/crassostrea_gigas.csv"
242
+ file = fixture_file_upload "/files/non-ascii.csv"
207
243
  port = RunPort::Output.create(:name => "test_port")
208
244
 
209
245
  port.file = file
@@ -283,7 +319,7 @@ module TavernaPlayer
283
319
  refute port.value.blank?, "Value is empty"
284
320
  refute port.file.blank?, "File not present"
285
321
 
286
- port.file = fixture_file_upload "/files/crassostrea_gigas.csv"
322
+ port.file = fixture_file_upload "/files/non-ascii.csv"
287
323
  port.save
288
324
  assert_nil port[:value], "Port value not nil"
289
325
  refute port.file.blank?, "File not present"