8784: Skip redundant arv-put invocations.
authorTom Clegg <tom@curoverse.com>
Wed, 21 Jun 2017 15:24:59 +0000 (11:24 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 21 Jun 2017 15:34:50 +0000 (11:34 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curoverse.com>

apps/workbench/test/integration/download_test.rb

index a19cde3db83e8387b0d8c915173ba4b614e8a071..1098240c964abc3c626e29fbf3d31b89ccb9a424 100644 (file)
@@ -4,6 +4,8 @@ require 'helpers/download_helper'
 class DownloadTest < ActionDispatch::IntegrationTest
   include KeepWebConfig
 
+  @@wrote_test_data = false
+
   setup do
     use_keep_web_config
 
@@ -13,10 +15,13 @@ class DownloadTest < ActionDispatch::IntegrationTest
 
     # Keep data isn't populated by fixtures, so we have to write any
     # data we expect to read.
-    ['foo', 'w a z', "Hello world\n"].each do |data|
-      md5 = `echo -n #{data.shellescape} | arv-put --no-progress --raw -`
-      assert_match /^#{Digest::MD5.hexdigest(data)}/, md5
-      assert $?.success?, $?
+    if !@@wrote_test_data
+      ['foo', 'w a z', "Hello world\n"].each do |data|
+        md5 = `echo -n #{data.shellescape} | arv-put --no-progress --raw -`
+        assert_match /^#{Digest::MD5.hexdigest(data)}/, md5
+        assert $?.success?, $?
+      end
+      @@wrote_test_data = true
     end
   end