Vote #64341
完了Darcs test unit wrong repos content.... Mercurial's one duplicated
0%
説明
Darcs
gunzip < test/fixtures/repositories/darcs_repository.tar.gz | tar -xv -C tmp/test
same content as Mercurial one ( watchers.rb)
so tests fail ..
def test_cat @repository.fetch_changesets cat = @repository.cat("sources/welcome_controller.rb", 2) assert_not_nil cat assert cat.include?('class WelcomeController < ApplicationController') end
journals
> same content as Mercurial one
Same files but one is a Mercurial repository, and the other one is a Darcs repository.
> so tests fail
Tests pass for me. Maybe you could post the test failure?
--------------------------------------------------------------------------------
1) Failure:
test_add_file(ProjectsControllerTest)
[./test/functional/projects_controller_test.rb:133:in `test_add_file'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
<nil>
expected to be kind_of?
<TMail::Mail> but was
<NilClass>.
2) Failure:
test_browse_at_given_revision(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:73:in `test_browse_at_given_revision'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">
3) Failure:
test_browse_directory(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:60:in `test_browse_directory'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">
4) Failure:
test_browse_root(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:49:in `test_browse_root'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">
5) Failure:
test_changes(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:81:in `test_changes'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">
6) Failure:
test_diff(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:90:in `test_diff'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">
7) Failure:
test_show(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:41:in `test_show'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">
331 tests, 1278 assertions, 7 failures, 0 errors
--------------------------------------------------------------------------------
OK, you've got 500 errors. So please read [[SubmittingBugs]] and attach the stack traces.
--------------------------------------------------------------------------------
Oh, and make sure you have Darcs installed and available in your path.
--------------------------------------------------------------------------------
No feedback?
--------------------------------------------------------------------------------
Reopen if needed.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> Reopen if needed.
sorry.. for the last log (error 500) was not ther ight one...
tested with last redmine trunk ..
the command sent to DARCS was :
darcs show content --repodir /Users/yves/Sites/rails/redmine/tmp/test/darcs_repository --match \"hash 20080308225413-98289-21b8e42854e60a780294bdf21e21a39ba8c47eff.gz\" 'sources/welcome_controller.rb'
which was wrong
darcs failed: Invalid --match pattern '"hash'.
"match" (line 1, column 1):
unexpected "\""
expecting match rule
I modified the line 139 in
redmine/scm/adapters/darcs_adapter
<pre>
def cat(path, identifier=nil)
cmd = "#{DARCS_BIN} show content --repodir #{@url}"
139 cmd << " --match \"hash #{identifier}\"" if identifier
cmd << " #{shell_quote path}"
debugger
cat = nil
shellout(cmd) do |io|
io.binmode
cat = io.read
end
return nil if $? && $?.exitstatus != 0
cat
end
</pre>
TO :
<pre>
139 cmd << " --match 'hash #{identifier}'" if identifier
</pre>
so the command is now :
darcs show content --repodir /Users/yves/Sites/rails/redmine/tmp/test/darcs_repository --match 'hash 20080308225413-98289-21b8e42854e60a780294bdf21e21a39ba8c47eff.gz' 'sources/welcome_controller.r
and test if good
yves
--------------------------------------------------------------------------------
OK, quotes are Win32 style and thus it fails on *nix OS.
I'll fix it.
--------------------------------------------------------------------------------
I've fixed DarcsAdapter in r2232, using the appropriate quotes depending on the OS.
Please confirm it's OK. Thanks.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------