[ARVADOS] updated: dbb0d22a96fa2de606430d78c05c254598f501df
Git user
git at public.curoverse.com
Tue Mar 14 10:00:25 EDT 2017
Summary of changes:
services/api/config/application.default.yml | 2 +-
services/api/test/unit/container_request_test.rb | 3 ++-
services/api/test/unit/job_test.rb | 29 +++++++++++++++++-------
3 files changed, 24 insertions(+), 10 deletions(-)
via dbb0d22a96fa2de606430d78c05c254598f501df (commit)
via 918e16de43e993894dcaffbe0cafa0fc1d2f16b3 (commit)
from a72205728f94f5261b657766e01f5767dc15d4b5 (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 dbb0d22a96fa2de606430d78c05c254598f501df
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Mon Mar 13 17:37:31 2017 -0400
8567: Tests default to image format v1 to avoid breaking all the tests that
uses the :docker_image collection.
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index 61ada89..cae6bbd 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -463,4 +463,4 @@ test:
git_internal_dir: <%= Rails.root.join 'tmp', 'internal.git' %>
websocket_address: <% if ENV['ARVADOS_TEST_EXPERIMENTAL_WS'] %>"wss://0.0.0.0:<%= ENV['ARVADOS_TEST_WSS_PORT'] %>/websocket"<% else %>false<% end %>
trash_sweep_interval: -1
- docker_image_formats: ["v1", "v2"]
\ No newline at end of file
+ docker_image_formats: ["v1"]
diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index 8935170..af1d4b2 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -395,7 +395,8 @@ class ContainerRequestTest < ActiveSupport::TestCase
test "container_image_for_container(pdh)" do
set_user_from_auth :active
- [:docker_image, :docker_image_1_12].each do |coll|
+ [[:docker_image, 'v1'], [:docker_image_1_12, 'v2']].each do |coll, ver|
+ Rails.configuration.docker_image_formats = [ver]
pdh = collections(coll).portable_data_hash
cr = ContainerRequest.new(container_image: pdh)
resolved = cr.send :container_image_for_container
commit 918e16de43e993894dcaffbe0cafa0fc1d2f16b3
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Mon Mar 13 17:31:20 2017 -0400
8567: Adjust job container resolve test now that images are filtered based on
support version.
diff --git a/services/api/test/unit/job_test.rb b/services/api/test/unit/job_test.rb
index 8fe5e5d..5677776 100644
--- a/services/api/test/unit/job_test.rb
+++ b/services/api/test/unit/job_test.rb
@@ -444,18 +444,31 @@ class JobTest < ActiveSupport::TestCase
].each do |existing_image, request_image, expect_image|
test "if a #{existing_image} job exists, #{request_image} yields #{expect_image} after migration" do
Rails.configuration.docker_image_formats = ['v1']
- oldjob = Job.create!(
- job_attrs(
- script: 'foobar1',
- runtime_constraints: {
- 'docker_image' => collections(existing_image).portable_data_hash}))
- oldjob.reload
- assert_equal(oldjob.docker_image_locator,
- collections(existing_image).portable_data_hash)
+
+ if existing_image == :docker_image
+ oldjob = Job.create!(
+ job_attrs(
+ script: 'foobar1',
+ runtime_constraints: {
+ 'docker_image' => collections(existing_image).portable_data_hash}))
+ oldjob.reload
+ assert_equal(oldjob.docker_image_locator,
+ collections(existing_image).portable_data_hash)
+ elsif existing_image == :docker_image_1_12
+ assert_raises(ActiveRecord::RecordInvalid,
+ "Should not resolve v2 image when only v1 is supported") do
+ oldjob = Job.create!(
+ job_attrs(
+ script: 'foobar1',
+ runtime_constraints: {
+ 'docker_image' => collections(existing_image).portable_data_hash}))
+ end
+ end
Rails.configuration.docker_image_formats = ['v2']
add_docker19_migration_link
+ # Check that both v1 and v2 images get resolved to v2.
newjob = Job.create!(
job_attrs(
script: 'foobar1',
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list