[ARVADOS] updated: 8f528fc58389c4e27251407bc5ebe988e881640a
git at public.curoverse.com
git at public.curoverse.com
Mon Jan 4 14:34:17 EST 2016
Summary of changes:
services/api/test/unit/container_test.rb | 157 +++++++++++++++----------------
1 file changed, 76 insertions(+), 81 deletions(-)
via 8f528fc58389c4e27251407bc5ebe988e881640a (commit)
from eb98d5ff700b0352f0886cb60ecf1c16d4f5e0ab (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 8f528fc58389c4e27251407bc5ebe988e881640a
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Mon Jan 4 14:34:12 2016 -0500
8080: Pull c.reload etc out of the assert_raises. Remove spurious blank lines.
diff --git a/services/api/test/unit/container_test.rb b/services/api/test/unit/container_test.rb
index 9264544..0cac6ac 100644
--- a/services/api/test/unit/container_test.rb
+++ b/services/api/test/unit/container_test.rb
@@ -2,92 +2,90 @@ require 'test_helper'
class ContainerTest < ActiveSupport::TestCase
def check_illegal_modify c
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.command = ["echo", "bar"]
- c.save!
- end
-
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.container_image = "img2"
- c.save!
- end
+ c.reload
+ c.command = ["echo", "bar"]
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.cwd = "/tmp2"
- c.save!
- end
+ c.reload
+ c.container_image = "img2"
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.environment = {"FOO" => "BAR"}
- c.save!
- end
+ c.reload
+ c.cwd = "/tmp2"
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.mounts = {"FOO" => "BAR"}
- c.save!
- end
+ c.reload
+ c.environment = {"FOO" => "BAR"}
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.output_path = "/tmp3"
- c.save!
- end
+ c.reload
+ c.mounts = {"FOO" => "BAR"}
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.runtime_constraints = {"FOO" => "BAR"}
- c.save!
- end
+ c.reload
+ c.output_path = "/tmp3"
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
+ c.reload
+ c.runtime_constraints = {"FOO" => "BAR"}
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
end
def check_bogus_states c
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.state = nil
- c.save!
- end
+ c.reload
+ c.state = nil
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.state = "Flubber"
- c.save!
- end
+ c.reload
+ c.state = "Flubber"
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
end
def check_no_change_from_complete c
- check_illegal_modify c
- check_bogus_states c
-
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.priority = 3
- c.save!
- end
+ check_illegal_modify c
+ check_bogus_states c
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.state = "Queued"
- c.save!
- end
+ c.reload
+ c.priority = 3
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.state = "Running"
- c.save!
- end
+ c.reload
+ c.state = "Queued"
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
- assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.state = "Complete"
- c.save!
- end
+ c.reload
+ c.state = "Running"
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
+ c.reload
+ c.state = "Complete"
+ assert_raises(ActiveRecord::RecordInvalid) do
+ c.save!
+ end
end
test "Container create" do
@@ -120,9 +118,9 @@ class ContainerTest < ActiveSupport::TestCase
c.output_path = "/tmp"
c.save!
+ c.reload
+ c.state = "Complete"
assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.state = "Complete"
c.save!
end
@@ -133,9 +131,9 @@ class ContainerTest < ActiveSupport::TestCase
check_illegal_modify c
check_bogus_states c
+ c.reload
+ c.state = "Queued"
assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.state = "Queued"
c.save!
end
@@ -209,16 +207,16 @@ class ContainerTest < ActiveSupport::TestCase
c.state = "Running"
c.save!
+ c.reload
+ c.exit_code = 1
assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.exit_code = 1
c.save!
end
+ c.reload
+ c.exit_code = 1
+ c.state = "Cancelled"
assert_raises(ActiveRecord::RecordInvalid) do
- c.reload
- c.exit_code = 1
- c.state = "Cancelled"
c.save!
end
@@ -226,9 +224,6 @@ class ContainerTest < ActiveSupport::TestCase
c.exit_code = 1
c.state = "Complete"
c.save!
-
end
end
-
-
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list