[ARVADOS] updated: 466e0e2623bb85870943f48fe1ab3016dc32d652
Git user
git at public.curoverse.com
Mon Apr 10 13:57:03 EDT 2017
Summary of changes:
services/api/app/models/node.rb | 2 +-
services/api/test/unit/node_test.rb | 8 +-------
2 files changed, 2 insertions(+), 8 deletions(-)
via 466e0e2623bb85870943f48fe1ab3016dc32d652 (commit)
from 2f46fb5769f41ac9cddf8c46bd0d2ab094375e82 (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 466e0e2623bb85870943f48fe1ab3016dc32d652
Author: Lucas Di Pentima <lucas at curoverse.com>
Date: Mon Apr 10 14:56:04 2017 -0300
6304: Corrected test setup to make it pass.
Added a separator to the temp file so that its name is more readable.
diff --git a/services/api/app/models/node.rb b/services/api/app/models/node.rb
index ca706d2..82ea0ac 100644
--- a/services/api/app/models/node.rb
+++ b/services/api/app/models/node.rb
@@ -183,7 +183,7 @@ class Node < ArvadosModel
end
hostfile = File.join Rails.configuration.dns_server_conf_dir, "#{hostname}.conf"
- Tempfile.open(["#{hostname}", ".conf.tmp"],
+ Tempfile.open(["#{hostname}-", ".conf.tmp"],
Rails.configuration.dns_server_conf_dir) do |f|
tmpfile = f.path
f.puts template % template_vars
diff --git a/services/api/test/unit/node_test.rb b/services/api/test/unit/node_test.rb
index 3895f04..2c3e5d8 100644
--- a/services/api/test/unit/node_test.rb
+++ b/services/api/test/unit/node_test.rb
@@ -79,16 +79,10 @@ class NodeTest < ActiveSupport::TestCase
end
test "don't leave temp files behind if there's an error writing them" do
+ Rails.configuration.dns_server_conf_template = Rails.root.join 'config', 'unbound.template'
Tempfile.any_instance.stubs(:puts).raises(IOError)
Dir.mktmpdir do |tmpdir|
Rails.configuration.dns_server_conf_dir = tmpdir
- # This works
- assert_raises IOError do
- Tempfile.open(['testfile.txt']) do |f|
- f.puts "This won't get written."
- end
- end
- # This fails
refute Node.dns_server_update 'compute65535', '127.0.0.127'
assert Dir.entries(tmpdir).select{|f| File.file? f}.empty?
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list