You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Peter Samuelson <pe...@p12n.org> on 2008/06/21 02:19:48 UTC
[PATCH 2/2] run ruby tests out-of-tree
[Peter Samuelson]
> This is needed in order to run the ruby tests out-of-tree. But it
> apparently breaks some assumptions in a few of the tests.
> 1) Failure:
> test_copy(SvnClientTest) [{SRC_DIR}/subversion/bindings/swig/ruby/test/test_client.rb:1170]:
> <["../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/sample2.txt"]> expected but was
> <["subversion/bindings/swig/ruby/test/wc-tmp/wc/sample2.txt"]>.
So, the problem is that the ruby tests set up a working copy in
"../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc", then
test the notify callback on a commit. The wc notifier helpfully strips
off the leading "../../../../../". Several of the ruby tests compare
the callback path with the original path, which of course fails.
This raises the question: why do the ruby tests put their temp files in
the _source_ directory, anyway? Why not just in the current directory?
Here is my fix.
[[[
In the ruby testsuite, create temporary directories in the build tree,
not in the source tree. This avoids failures caused by the fact that
relative wc paths ("../../../../../subversion/bindings/swig/etc.") are
partially stripped ("subversion/bindings/swig/etc.") when passed to
svn_wc_notify_func2.
[In subversion/bindings/swig/ruby/test]
* util.rb (setup_default_variables): Eliminate @base_dir; anchor all
temporary files in the current dir rather than the source dir.
* windows_util.rb (setup_svnserve): Move svnserve temp dir likewise.
Patch by: Peter Samuelson <pe...@p12n.org>
]]]
--- a/subversion/bindings/swig/ruby/test/util.rb
+++ b/subversion/bindings/swig/ruby/test/util.rb
@@ -15,20 +15,19 @@
def setup_default_variables
test_dir = Pathname.new(File.dirname(__FILE__))
pwd = Pathname.new(Dir.pwd)
- @base_dir = test_dir.relative_path_from(pwd).to_s
@author = ENV["USER"] || "sample-user"
@password = "sample-password"
@realm = "sample realm"
- @repos_path = File.join(@base_dir, "repos")
+ @repos_path = "repos"
@full_repos_path = File.expand_path(@repos_path)
@repos_uri = "file://#{@full_repos_path.sub(/^\/?/, '/')}"
@svnserve_host = "127.0.0.1"
@svnserve_ports = (64152..64282).collect{|x| x.to_s}
- @wc_base_dir = File.join(@base_dir, "wc-tmp")
+ @wc_base_dir = "wc-tmp"
@wc_path = File.join(@wc_base_dir, "wc")
@full_wc_path = File.expand_path(@wc_path)
- @tmp_path = File.join(@base_dir, "tmp")
- @config_path = File.join(@base_dir, "config")
+ @tmp_path = "tmp"
+ @config_path = "config"
@greek = Greek.new(@tmp_path, @wc_path, @repos_uri)
end
--- a/subversion/bindings/swig/ruby/test/windows_util.rb
+++ b/subversion/bindings/swig/ruby/test/windows_util.rb
@@ -53,7 +53,7 @@
service_control('stop') unless service_stopped?
service_control('delete') if service_exists?
- svnserve_dir = File.expand_path(File.join(@base_dir, "svnserve"))
+ svnserve_dir = File.expand_path("svnserve")
FileUtils.mkdir_p(svnserve_dir)
at_exit do
service_control('stop') unless service_stopped?
Re: [PATCH 2/2] run ruby tests out-of-tree
Posted by Kouhei Sutou <ko...@cozmixng.org>.
Hi,
In <20...@p12n.org>
"Re: [PATCH 2/2] run ruby tests out-of-tree" on Mon, 23 Jun 2008 18:11:04 -0500,
Peter Samuelson <pe...@p12n.org> wrote:
>
> [Kouhei Sutou]
> > Could you commit your patches?
>
> I'm not a committer.
You became a committer!
Could you commit your patches?
Thanks,
--
kou
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH 2/2] run ruby tests out-of-tree
Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Peter Samuelson wrote on Mon, 23 Jun 2008 at 18:11 -0500:
> I'm not a committer.
That's a dangerous phrase to use on this mailing list. I still remember
what happened the last time I used it :)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH 2/2] run ruby tests out-of-tree
Posted by Peter Samuelson <pe...@p12n.org>.
[Kouhei Sutou]
> Could you commit your patches?
I'm not a committer.
--
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/
Re: [PATCH 2/2] run ruby tests out-of-tree
Posted by Peter Samuelson <pe...@p12n.org>.
[Kouhei Sutou]
> Could you commit your patches?
r31907.
--
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/
Re: [PATCH 2/2] run ruby tests out-of-tree
Posted by Kouhei Sutou <ko...@cozmixng.org>.
Hi,
I'm sorry for my late response.
# RubyKaigi 2008 was convened at the last weekend.
2008/6/21 Peter Samuelson <pe...@p12n.org>:
>> This is needed in order to run the ruby tests out-of-tree. But it
>> apparently breaks some assumptions in a few of the tests.
> This raises the question: why do the ruby tests put their temp files in
> the _source_ directory, anyway? Why not just in the current directory?
> Here is my fix.
>
> [[[
> In the ruby testsuite, create temporary directories in the build tree,
> not in the source tree. This avoids failures caused by the fact that
> relative wc paths ("../../../../../subversion/bindings/swig/etc.") are
> partially stripped ("subversion/bindings/swig/etc.") when passed to
> svn_wc_notify_func2.
>
> [In subversion/bindings/swig/ruby/test]
>
> * util.rb (setup_default_variables): Eliminate @base_dir; anchor all
> temporary files in the current dir rather than the source dir.
>
> * windows_util.rb (setup_svnserve): Move svnserve temp dir likewise.
>
> Patch by: Peter Samuelson <pe...@p12n.org>
> ]]]
Could you commit your patches?
Thanks,
--
kou
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org