You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Joe Swatosh <jo...@gmail.com> on 2007/05/08 06:31:43 UTC

Re: Ruby bindings test failures on Windows

Hi kou,

On 4/24/07, Kouhei Sutou <ko...@cozmixng.org> wrote:
> Hi Joe,
>
> > D:\SVN\src-trunk\subversion\bindings\swig\ruby>ruby test\run-test.rb
> > Loaded suite .
> > Started
> > ..........................................................E.............................................................EE..........
> > ......................................................................
> > Finished in 945.926 seconds.
> >
> >   1) Error:
> > test_windows_simple_provider(SvnClientTest):
> > Svn::Error::RaNotAuthorized:
> > D:\SVN\src-trunk\subversion\libsvn_ra_svn\internal_auth.c:96 Can't get
> > password
> >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/util.rb:86:in
> > `svn_client_cat2'
> >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/util.rb:86:in `cat2'
> >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/client.rb:326:in `cat'
> >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_client.rb:1720:in
> > `assert_simple_provider'
> >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_client.rb:1729:in
> > `test_windows_simple_provider'
>
> I don't know why the test is failed. Test case may be
> wrong...
>

how about:

Index: subversion/bindings/swig/ruby/test/test_client.rb
===================================================================
--- subversion/bindings/swig/ruby/test/test_client.rb   (revision 24966)
+++ subversion/bindings/swig/ruby/test/test_client.rb   (working copy)
@@ -1716,6 +1716,7 @@

     ctx = Svn::Client::Context.new
     setup_auth_baton(ctx.auth_baton)
+    ctx.auth_baton[Svn::Core::AUTH_PARAM_DEFAULT_PASSWORD] = @password
     ctx.send(method)
     assert_equal(normalize_line_break(src), ctx.cat(svnserve_uri))
   end


??

--
Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby bindings test failures on Windows

Posted by Joe Swatosh <jo...@gmail.com>.
Hi

On 5/12/07, Kouhei Sutou <ko...@cozmixng.org> wrote:
> Hi Joe,
>
> In <ae...@mail.gmail.com>
>  "Re: Ruby bindings test failures on Windows" on Fri, 11 May 2007 19:06:42 -0700,
>  "Joe Swatosh" <jo...@gmail.com> wrote:
>
> > > >

>
> Thanks! Could you commit the patch?
>
> --
> kou
>

Done in r25004.

Thanks
--
Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby bindings test failures on Windows

Posted by Kouhei Sutou <ko...@cozmixng.org>.
Hi Joe,

In <ae...@mail.gmail.com>
  "Re: Ruby bindings test failures on Windows" on Fri, 11 May 2007 19:06:42 -0700,
  "Joe Swatosh" <jo...@gmail.com> wrote:

> > >   I changed assert_simple_provider to assert that no matter the provider, if no
> > >   credentials are supplied then access is denied, when credentials are supplied
> > >   access is allowed.
> > >
> > >   Modified the tests to use the new assert_simple_provider (don't know if it
> > >   makes even a little sense with the keychain provider, but it works for the
> > >   others).
> > >
> > > This seems simpler to me.  It may be too simple to be correct.
> >
> > OK. Your concept makes sence. I approve your concept.
> > Could you adapt your concept to the current test_client.rb style
> > and commit it?
> >
> > > Could you please explain what the original version of
> > > assert_simple_provider was
> > > doing?
> >
> > Perhaps I wanted to do what you did but I don't remember
> > that...
> >
> 
> It sure looks like that what you intended....

> [[[
> Use the passed in method to add the provider then show that it doesn't work
> without a password, then does work with a password.  Finish what kou started.
> 
> * subversion/bindings/swig/ruby/test/test_client.rb
>   (SvnClientTest#assert_simple_provider) finish implementing
> ]]]

Thanks! Could you commit the patch?

--
kou

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby bindings test failures on Windows

Posted by Joe Swatosh <jo...@gmail.com>.
Hi

On 5/9/07, Kouhei Sutou <ko...@cozmixng.org> wrote:
> Hi,
>
> >   I changed assert_simple_provider to assert that no matter the provider, if no
> >   credentials are supplied then access is denied, when credentials are supplied
> >   access is allowed.
> >
> >   Modified the tests to use the new assert_simple_provider (don't know if it
> >   makes even a little sense with the keychain provider, but it works for the
> >   others).
> >
> > This seems simpler to me.  It may be too simple to be correct.
>
> OK. Your concept makes sence. I approve your concept.
> Could you adapt your concept to the current test_client.rb style
> and commit it?
>
> > Could you please explain what the original version of
> > assert_simple_provider was
> > doing?
>
> Perhaps I wanted to do what you did but I don't remember
> that...
>

It sure looks like that what you intended....

--
Joe

[[[
Use the passed in method to add the provider then show that it doesn't work
without a password, then does work with a password.  Finish what kou started.

* subversion/bindings/swig/ruby/test/test_client.rb
  (SvnClientTest#assert_simple_provider) finish implementing
]]]

Index: subversion/bindings/swig/ruby/test/test_client.rb
===================================================================
--- subversion/bindings/swig/ruby/test/test_client.rb	(revision 25000)
+++ subversion/bindings/swig/ruby/test/test_client.rb	(working copy)
@@ -1699,25 +1699,19 @@

     ctx = Svn::Client::Context.new
     setup_auth_baton(ctx.auth_baton)
-    ctx.add_simple_provider
+    ctx.send(method)
     assert_raises(Svn::Error::RaNotAuthorized) do
-      assert_equal(src, ctx.cat(svnserve_uri))
+      ctx.cat(svnserve_uri)
     end

     ctx = Svn::Client::Context.new
     setup_auth_baton(ctx.auth_baton)
-    ctx.add_simple_provider
+    ctx.send(method)
     ctx.add_simple_prompt_provider(0) do |cred, realm, username, may_save|
       cred.username = @author
       cred.password = @password
-      cred.may_save = true
     end
     assert_equal(normalize_line_break(src), ctx.cat(svnserve_uri))
-
-    ctx = Svn::Client::Context.new
-    setup_auth_baton(ctx.auth_baton)
-    ctx.send(method)
-    assert_equal(normalize_line_break(src), ctx.cat(svnserve_uri))
   end

   def test_simple_provider

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby bindings test failures on Windows

Posted by Kouhei Sutou <ko...@cozmixng.org>.
Hi,

>   I changed assert_simple_provider to assert that no matter the provider, if no
>   credentials are supplied then access is denied, when credentials are supplied
>   access is allowed.
>
>   Modified the tests to use the new assert_simple_provider (don't know if it
>   makes even a little sense with the keychain provider, but it works for the
>   others).
>
> This seems simpler to me.  It may be too simple to be correct.

OK. Your concept makes sence. I approve your concept.
Could you adapt your concept to the current test_client.rb style
and commit it?

> Could you please explain what the original version of
> assert_simple_provider was
> doing?

Perhaps I wanted to do what you did but I don't remember
that...


Thanks,
--
kou

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby bindings test failures on Windows

Posted by Joe Swatosh <jo...@gmail.com>.
Hi

On 5/9/07, Kouhei Sutou <ko...@cozmixng.org> wrote:
> Hi,
>

> I think that your patch needs to a bit works:
>
Sure.  I mostly wanted a way to show what I was thinking.

>    We need to learn more about auth providers...
>
!!!


> > I didn't want to start it before asking, but perhaps it would be a good idea to
> > make the assert_simple_provider() more focused and use it more like the 3rd
> > test_windows_provider test?  Perhaps splitting up the other provider tests a
> > bit?  As I said, it's not clear to me why the various provider tests need to
> > have the simple provider setup so often.  Could be I just don't know enough.
>
> OK. Could you make a  patch that describes your idea?
>

I don't remember where I was going when I wrote that, but here is where I ended
up (I created a new file that just has to the provider tests.....  IOW
this is just to
talk about, if we come up with something useful I'll write a real patch.)

  Instead of returning from a test when the underlying method is not defined,
  don't define the test at all.

  I changed assert_simple_provider to assert that no matter the provider, if no
  credentials are supplied then access is denied, when credentials are supplied
  access is allowed.

  Modified the tests to use the new assert_simple_provider (don't know if it
  makes even a little sense with the keychain provider, but it works for the
  others).

This seems simpler to me.  It may be too simple to be correct.

Could you please explain what the original version of
assert_simple_provider was
doing?

<code file=test_simple_providers.rb>

require "my-assertions"
require "util"

require "svn/core"
require "svn/client"

class SvnClientTest < Test::Unit::TestCase
  include SvnTestUtil

  def setup
    setup_basic(true)
  end

  def teardown
    teardown_basic
  end

  def assert_simple_provider method
    log = "sample log"
    src = "source\n"
    file = "sample.txt"
    path = File.join(@wc_path, file)
    svnserve_uri = "#{@repos_svnserve_uri}/#{file}"

    File.open(path, "w") {|f| f.print(src)}

    ctx = make_context(log)
    setup_auth_baton(ctx.auth_baton)
    ctx.add(path)
    ctx.commit(@wc_path)

    ctx = Svn::Client::Context.new
    setup_auth_baton(ctx.auth_baton)
    ctx.__send__ method
    assert_raises(Svn::Error::RaNotAuthorized) do
      ctx.cat(svnserve_uri)
    end

    ctx = Svn::Client::Context.new
    setup_auth_baton(ctx.auth_baton)
    ctx.__send__ method
    ctx.add_simple_prompt_provider(0) do |cred, realm, username, may_save|
      cred.username = @author
      cred.password = @password
    end
    assert_equal(normalize_line_break(src), ctx.cat(svnserve_uri))
  end

  def test_simple_provider
    assert_simple_provider :add_simple_provider
  end

  if Svn::Core.respond_to?(:auth_get_windows_simple_provider)
    def test_windows_simple_provider
      assert_simple_provider :add_windows_simple_provider
    end
  end

  if Svn::Core.respond_to?(:auth_get_keychain_simple_provider)
    def test_keychain_simple_provider
      assert_simple_provider :add_keychain_simple_provider
    end
  end

end

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby bindings test failures on Windows

Posted by Kouhei Sutou <ko...@cozmixng.org>.
Hi,

2007/5/9, Joe Swatosh <jo...@gmail.com>:

> Okay.  Your patch wouldn't pass the tests because
> assert_simple_provider() can't
> be run more than once in a test (it tries to add the file to the repository
> every time).  The attached patch passes the tests.  I made
> test_simple_windows_provider() into three different tests.  To do this I had to
> modify the block in the third test somewhat.

I think that your patch needs to a bit works:

  * add the following code to test_windows_simple_provider[23]:
      return unless Svn::Core.respond_to?(:auth_get_windows_simple_provider)

  * rename test_windows_simple_provider[123] to more self-
    describing name.

  * test_windows_simple_provider[23] may be needless.
    The authentications are passed by
    add_simple{,_prompt}_provider not
    add_windows_simple_provider. To test
    add_windows_simple_provider, we should only use
    add_windows_simple_provider and confirm a test doesn't
    raise Svn::Error::RaNotAuthorized.

    We need to learn more about auth providers...

> I didn't want to start it before asking, but perhaps it would be a good idea to
> make the assert_simple_provider() more focused and use it more like the 3rd
> test_windows_provider test?  Perhaps splitting up the other provider tests a
> bit?  As I said, it's not clear to me why the various provider tests need to
> have the simple provider setup so often.  Could be I just don't know enough.

OK. Could you make a  patch that describes your idea?


Thanks,
--
kou

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby bindings test failures on Windows

Posted by Joe Swatosh <jo...@gmail.com>.
Hi,

On 5/8/07, Kouhei Sutou <ko...@cozmixng.org> wrote:
> Hi,
>
> 2007/5/9, Joe Swatosh <jo...@gmail.com>:
>
> > Are you sure that's the right patch?  It modified and deleted many
> > tests
>
> Oh, sorry... I sent a wrong patch...
> I'll attach a correct patch.
>
> >  I knew my patch affected the other simple provider test, what
> > other tests did it impact?
>
> It's the problem.
> I think that we should not modify existing tests if there is no
> reason. It seems that the other simple provider tests has no
> problem. I want you to modify only
> test_windows_simple_provider. If there is other problem,
> we should fix that in another revision.

Okay.  Your patch wouldn't pass the tests because
assert_simple_provider() can't
be run more than once in a test (it tries to add the file to the repository
every time).  The attached patch passes the tests.  I made
test_simple_windows_provider() into three different tests.  To do this I had to
modify the block in the third test somewhat.

I'm not crazy for assert_simple_provider().  To me it is confusing to be
creating invoking the ctx.add_simple_provider() so many times during a test of
add_windows_simple provider() or for that matter add_keychain_simple_provider().

I didn't want to start it before asking, but perhaps it would be a good idea to
make the assert_simple_provider() more focused and use it more like the 3rd
test_windows_provider test?  Perhaps splitting up the other provider tests a
bit?  As I said, it's not clear to me why the various provider tests need to
have the simple provider setup so often.  Could be I just don't know enough.
--
Joe

Re: Ruby bindings test failures on Windows

Posted by Kouhei Sutou <ko...@cozmixng.org>.
Hi,

2007/5/9, Joe Swatosh <jo...@gmail.com>:

> Are you sure that's the right patch?  It modified and deleted many
> tests

Oh, sorry... I sent a wrong patch...
I'll attach a correct patch.

>  I knew my patch affected the other simple provider test, what
> other tests did it impact?

It's the problem.
I think that we should not modify existing tests if there is no
reason. It seems that the other simple provider tests has no
problem. I want you to modify only
test_windows_simple_provider. If there is other problem,
we should fix that in another revision.


Thanks,
--
kou

Re: Ruby bindings test failures on Windows

Posted by Joe Swatosh <jo...@gmail.com>.
Hi kou,

On 5/7/07, Kouhei Sutou <ko...@cozmixng.org> wrote:
> Hi,
>
> 2007/5/8, Joe Swatosh <jo...@gmail.com>:
>
> > > >   1) Error:
> > > > test_windows_simple_provider(SvnClientTest):
> > > > Svn::Error::RaNotAuthorized:
> > > > D:\SVN\src-trunk\subversion\libsvn_ra_svn\internal_auth.c:96 Can't get
> > > > password
> > > >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/util.rb:86:in
> > > > `svn_client_cat2'
> > > >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/util.rb:86:in `cat2'
> > > >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/client.rb:326:in `cat'
> > > >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_client.rb:1720:in
> > > > `assert_simple_provider'
> > > >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_client.rb:1729:in
> > > > `test_windows_simple_provider'
> > >
> > > I don't know why the test is failed. Test case may be
> > > wrong...
> > >
> >
> > how about:
> >
> > Index: subversion/bindings/swig/ruby/test/test_client.rb
> > ===================================================================
> > --- subversion/bindings/swig/ruby/test/test_client.rb   (revision 24966)
> > +++ subversion/bindings/swig/ruby/test/test_client.rb   (working copy)
> > @@ -1716,6 +1716,7 @@
> >
> >      ctx = Svn::Client::Context.new
> >      setup_auth_baton(ctx.auth_baton)
> > +    ctx.auth_baton[Svn::Core::AUTH_PARAM_DEFAULT_PASSWORD] = @password
> >      ctx.send(method)
> >      assert_equal(normalize_line_break(src), ctx.cat(svnserve_uri))
> >    end
> >
> >
> > ??
>
> That effects other tests. How about the attached patch?
>

Are you sure that's the right patch?  It modified and deleted many
tests.  I knew my patch affected the other simple provider test, what
other tests did it impact?
--
Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby bindings test failures on Windows

Posted by Kouhei Sutou <ko...@cozmixng.org>.
Hi,

2007/5/8, Joe Swatosh <jo...@gmail.com>:

> > >   1) Error:
> > > test_windows_simple_provider(SvnClientTest):
> > > Svn::Error::RaNotAuthorized:
> > > D:\SVN\src-trunk\subversion\libsvn_ra_svn\internal_auth.c:96 Can't get
> > > password
> > >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/util.rb:86:in
> > > `svn_client_cat2'
> > >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/util.rb:86:in `cat2'
> > >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/client.rb:326:in `cat'
> > >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_client.rb:1720:in
> > > `assert_simple_provider'
> > >     D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_client.rb:1729:in
> > > `test_windows_simple_provider'
> >
> > I don't know why the test is failed. Test case may be
> > wrong...
> >
>
> how about:
>
> Index: subversion/bindings/swig/ruby/test/test_client.rb
> ===================================================================
> --- subversion/bindings/swig/ruby/test/test_client.rb   (revision 24966)
> +++ subversion/bindings/swig/ruby/test/test_client.rb   (working copy)
> @@ -1716,6 +1716,7 @@
>
>      ctx = Svn::Client::Context.new
>      setup_auth_baton(ctx.auth_baton)
> +    ctx.auth_baton[Svn::Core::AUTH_PARAM_DEFAULT_PASSWORD] = @password
>      ctx.send(method)
>      assert_equal(normalize_line_break(src), ctx.cat(svnserve_uri))
>    end
>
>
> ??

That effects other tests. How about the attached patch?

Thanks,
--
kou