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/20 20:17:56 UTC
[PATCH, HELP] run ruby tests out-of-tree
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 message
is just a heads-up, I'll try to fix this myself later this evening, but
if someone wants to beat me to it, even better. (:
[[[
Fix 'make check-swig-rb' invocation for an out-of-tree build.
* subversion/bindings/swig/ruby/test/run-test.rb
(base_dir): Set to current directory.
(base_src_dir): New name for the old base_dir. Add it to LOAD_PATH.
Patch by: Peter Samuelson <pe...@p12n.org>
]]]
--- a/subversion/bindings/swig/ruby/test/run-test.rb
+++ b/subversion/bindings/swig/ruby/test/run-test.rb
@@ -4,7 +4,8 @@
require "fileutils"
test_dir = File.expand_path(File.join(File.dirname(__FILE__)))
-base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+base_src_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+base_dir = Dir.pwd
top_dir = File.expand_path(File.join(base_dir, "..", "..", "..", ".."))
ext_dir = File.join(base_dir, ".ext")
@@ -20,6 +21,7 @@
SvnTestUtil.setup_test_environment(top_dir, base_dir, ext_svn_ext_dir)
$LOAD_PATH.unshift(ext_dir)
+$LOAD_PATH.unshift(base_src_dir)
$LOAD_PATH.unshift(base_dir)
$LOAD_PATH.unshift(test_dir)
{BUILD_DIR} $ make check-swig-rb
cd {BUILD_DIR}/subversion/bindings/swig/ruby; \
/usr/bin/ruby1.8 -I {SRC_DIR}/subversion/bindings/swig/ruby \
{SRC_DIR}/subversion/bindings/swig/ruby/test/run-test.rb \
--verbose=normal
Loaded suite .
Started
...............F........................FFFFF.......................................................................................................................................................................
Finished in 483.637445 seconds.
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"]>.
2) Failure:
test_mkdir_multiple(SvnClientTest) [{SRC_DIR}/subversion/bindings/swig/ruby/test/test_client.rb:175]:
<["../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/dir",
"../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/dir2"]> expected but was
<["subversion/bindings/swig/ruby/test/wc-tmp/wc/dir",
"subversion/bindings/swig/ruby/test/wc-tmp/wc/dir2"]>.
3) Failure:
test_mkdir_multiple2(SvnClientTest) [{SRC_DIR}/subversion/bindings/swig/ruby/test/test_client.rb:210]:
<["../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/dir",
"../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/dir2"]> expected but was
<["subversion/bindings/swig/ruby/test/wc-tmp/wc/dir",
"subversion/bindings/swig/ruby/test/wc-tmp/wc/dir2"]>.
4) Failure:
test_mkdir_p(SvnClientTest) [{SRC_DIR}/subversion/bindings/swig/ruby/test/test_client.rb:241]:
<["../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/parent",
"../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/parent/child"]> expected but was
<["subversion/bindings/swig/ruby/test/wc-tmp/wc/parent",
"subversion/bindings/swig/ruby/test/wc-tmp/wc/parent/child"]>.
5) Failure:
test_move(SvnClientTest) [{SRC_DIR}/subversion/bindings/swig/ruby/test/test_client.rb:1200]:
<["../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/sample1.txt",
"../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/sample2.txt"]> expected but was
<["subversion/bindings/swig/ruby/test/wc-tmp/wc/sample1.txt",
"subversion/bindings/swig/ruby/test/wc-tmp/wc/sample2.txt"]>.
6) Failure:
test_move_force(SvnClientTest) [{SRC_DIR}/subversion/bindings/swig/ruby/test/test_client.rb:1244]:
<["../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/sample1.txt",
"../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/sample2.txt",
"../../../../../subversion/bindings/swig/ruby/test/wc-tmp/wc/sample2.txt"]> expected but was
<["subversion/bindings/swig/ruby/test/wc-tmp/wc/sample1.txt",
"subversion/bindings/swig/ruby/test/wc-tmp/wc/sample2.txt",
"subversion/bindings/swig/ruby/test/wc-tmp/wc/sample2.txt"]>.
212 tests, 1428 assertions, 6 failures, 0 errors
make: *** [check-swig-rb] Error 1
---------------------------------------------------------------------
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 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
[PATCH 2/2] run ruby tests out-of-tree
Posted by Peter Samuelson <pe...@p12n.org>.
[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?