[ARVADOS] updated: 509f028df8876fee99e68918c3d23ac36073121d
Git user
git at public.curoverse.com
Wed Sep 21 14:27:49 EDT 2016
Summary of changes:
.../test/integration/container_requests_test.rb | 32 ++++++++++++++++++++++
services/api/test/fixtures/containers.yml | 2 +-
2 files changed, 33 insertions(+), 1 deletion(-)
via 509f028df8876fee99e68918c3d23ac36073121d (commit)
from 04d8e74e9b6476b2a87c5a66c07566f041c97b37 (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 509f028df8876fee99e68918c3d23ac36073121d
Author: radhika <radhika at curoverse.com>
Date: Wed Sep 21 14:27:21 2016 -0400
9514: add container log tests.
diff --git a/apps/workbench/test/integration/container_requests_test.rb b/apps/workbench/test/integration/container_requests_test.rb
index df6584e..d875807 100644
--- a/apps/workbench/test/integration/container_requests_test.rb
+++ b/apps/workbench/test/integration/container_requests_test.rb
@@ -96,4 +96,36 @@ class ContainerRequestsTest < ActionDispatch::IntegrationTest
wait_for_ajax
assert_text 'This container is queued'
end
+
+ def mock_container_log_data
+ content = "2014-01-01_12:00:01 container log message 1\n" +
+ "2014-01-01_12:00:02 container log message 2\n" +
+ "2014-01-01_12:00:03 container log message 3\n"
+ StringIO.new content, 'r'
+ end
+
+ [
+ false,
+ true,
+ ].each do |partial|
+ test "view container #{partial ? 'partial' : 'full'} log from log collection" do
+ Rails.configuration.log_viewer_max_bytes = 100 if partial
+
+ IO.expects(:popen).returns(mock_container_log_data)
+
+ cr = api_fixture('container_requests')['completed']
+ visit page_with_token("active", "/container_requests/#{cr['uuid']}")
+ find(:xpath, "//a[@href='#Log']").click
+ wait_for_ajax
+
+ if partial
+ assert page.has_text?('Showing only 100 bytes of this log') if partial
+ assert page.has_text? 'container log message 1'
+ else
+ assert page.has_text? 'container log message 1'
+ assert page.has_text? 'container log message 2'
+ assert page.has_text? 'container log message 3'
+ end
+ end
+ end
end
diff --git a/services/api/test/fixtures/containers.yml b/services/api/test/fixtures/containers.yml
index 87098dc..08fafff 100644
--- a/services/api/test/fixtures/containers.yml
+++ b/services/api/test/fixtures/containers.yml
@@ -73,7 +73,7 @@ completed:
finished_at: 2016-01-12 11:12:13.111111111 Z
container_image: test
cwd: test
- log: ea10d51bcf88862dbcc36eb292017dfd+45
+ log: 0b9a7787660e1fce4a93f33e01376ba6+81
output: zzzzz-4zz18-znfnqtbbv4spc3w
output_path: test
command: ["echo", "hello"]
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list