[ARVADOS] updated: 70b1ac0b5a02879bb5b60f651bf0810e8362f074
git at public.curoverse.com
git at public.curoverse.com
Wed Oct 1 13:06:23 EDT 2014
Summary of changes:
services/api/test/unit/job_test.rb | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
via 70b1ac0b5a02879bb5b60f651bf0810e8362f074 (commit)
from 3412c35d3da73b94c133099dceab9770fb465165 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 70b1ac0b5a02879bb5b60f651bf0810e8362f074
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Wed Oct 1 13:06:17 2014 -0400
3859: unit test for job state changes
diff --git a/services/api/test/unit/job_test.rb b/services/api/test/unit/job_test.rb
index 19b6eb2..abf7ce3 100644
--- a/services/api/test/unit/job_test.rb
+++ b/services/api/test/unit/job_test.rb
@@ -206,6 +206,27 @@ class JobTest < ActiveSupport::TestCase
end
end
+ test "Test job state changes" do
+ all = ["Queued", "Running", "Complete", "Failed", "Cancelled"]
+ valid = {"Queued" => all, "Running" => ["Complete", "Failed", "Cancelled"]}
+ all.each do |start|
+ all.each do |finish|
+ if start != finish
+ job = Job.create! job_attrs(state: start)
+ assert_equal start, job.state
+ job.state = finish
+ job.save
+ job.reload
+ if valid[start] and valid[start].include? finish
+ assert_equal finish, job.state
+ else
+ assert_equal start, job.state
+ end
+ end
+ end
+ end
+ end
+
test "Test job locking" do
set_user_from_auth :active_trustedclient
job = Job.create! job_attrs
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list