[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Allow testing of svn client exit codes

From: jeremy hinds <jeremy.hinds_at_gmail.com>
Date: Tue, 4 Mar 2008 17:29:58 -0700

Thanks for offering to test these changes on Windows. I've modified
the rest of the test scripts to accept the returned exit-code and made
a few other changes and fixes. Platforms without the Popen3 class
have an exit code of "None" passed around, so Windows compatibility
should be handled by doing no exit-code validation when it is None.

If I generalized too much in the commit message for the individual
test scripts, let me know and I'll provide more detail about what was
changed.

[[[
Allow testing of application exit codes.

This makes all of the lower-level process-running functions in
cmdline/svntest/main.py and cmdline/svntest/actions.py return
the exit code, all of the "run_and_verify_*()" functions guess the
expected exit code based on whether or not output on stderr is
expected, and new "run_and_verify_*2()" functions allow the
expected exit code to be provided explicitly.

On platforms without the Popen3 Python class (e.g. Windows), exit
codes are returned as None, and therefore disregarded during
validation.

* subversion/tests/cmdline/svntest/main.py
 (run_command, run_svn, run_svnadmin, run_svnlook, run_svnsync,
  run_svnversion): Include exit_code in the returned tuple.

 (create_repos): Accept exit_code returned from run_command.

 (run_one): Clarify a comment concerning exit codes

* subversion/tests/cmdline/svntest/actions.py
 (run_and_verify_svnlook2, run_and_verify_svnadmin2,
  run_and_verify_svnversion2, run_and_verify_svn2,
  run_and_verify_svn_match_any2): New, execute the indicated binary
  and check actual outputs and exit code against the expected value
  parameters.

 (run_and_verify_svnlook, run_and_verify_svnadmin,
  run_and_verify_svnversion, run_and_verify_svn,
  run_and_verify_svn_match_any): Guess whether the expected exit should
  be 0 or 1 based on whether output is expected on stderr. Then invoke
  the coresponding run_and_verify_*2 function with that value. Return
  exit_code, stdout_lines, stderr_lines.

 (setup_pristine_repository, run_and_verify_load, run_and_verify_dump,
  run_and_verify_checkout, run_and_verify_update, run_and_verify_commit,
  run_and_verify_status, run_and_verify_unquiet_status,
  run_and_verify_diff_summarize, run_and_verify_diff_summarize_xml,
  run_and_verify_log_xml, run_and_verify_merge2,
  run_and_verify_mergeinfo, run_and_verify_switch, run_and_validate_lock,
  check_prop, inject_conflict_into_wc, run_and_verify_export):
  Accept exit_code value returned from main.run_svn, main.run_command,
  main.run_svnadmin, main.run_command_stdin, actions.run_and_verify_svn

* subversion/tests/cmdline/svntest/tree.py
 (get_props): Accept exit code returned by main.run_svn.

* subversion/tests/cmdline/svntest/verify.py
 (SVNUnexpectedExitCode): New exception raised when the exit code was not
 what was expected.

 (verify_exit_code): New, compares expected and actual exit code and raises
 an exception if they are different. Comparison is not performed if expected
 exit code is None.

* subversion/tests/cmdline/cat_tests.py,
  subversion/tests/cmdline/lock_tests.py,
  subversion/tests/cmdline/stat_tests.py:
  Accept exit code returned from run_*(), replacing those calls with the
  run_*2() counterparts for cases where stderr output is produced while
  exiting 0.

* subversion/tests/cmdline/authz_tests.py,
  subversion/tests/cmdline/autoprop_tests.py,
  subversion/tests/cmdline/basic_tests.py,
  subversion/tests/cmdline/blame_tests.py,
  subversion/tests/cmdline/changelist_tests.py,
  subversion/tests/cmdline/checkout_tests.py,
  subversion/tests/cmdline/commit_tests.py,
  subversion/tests/cmdline/copy_tests.py,
  subversion/tests/cmdline/depth_tests.py,
  subversion/tests/cmdline/diff_tests.py,
  subversion/tests/cmdline/getopt_tests.py,
  subversion/tests/cmdline/import_tests.py,
  subversion/tests/cmdline/log_tests.py,
  subversion/tests/cmdline/merge_tests.py,
  subversion/tests/cmdline/prop_tests.py,
  subversion/tests/cmdline/revert_tests.py,
  subversion/tests/cmdline/schedule_tests.py,
  subversion/tests/cmdline/special_tests.py,
  subversion/tests/cmdline/svnadmin_tests.py,
  subversion/tests/cmdline/svndumpfilter_tests.py,
  subversion/tests/cmdline/svnlook_tests.py,
  subversion/tests/cmdline/svnsync_tests.py,
  subversion/tests/cmdline/svnversion_tests.py,
  subversion/tests/cmdline/switch_tests.py,
  subversion/tests/cmdline/update_tests.py:
  Accept exit code returned from the run_*() function calls.

]]]

On Tue, Mar 4, 2008 at 10:56 AM, Paul Burba <ptburba_at_gmail.com> wrote:
> On Tue, Mar 4, 2008 at 8:56 AM, Julian Foad <julianfoad_at_btopenworld.com> wrote:
> > Is anyone able to review Jeremy's patch for the test suite, or test it
> > (especially on Windows)?
>
> I'll try it out on Windows. But first, Jeremy, could you please
> resend your patch as an attachment? When the patch is embedded within
> the text of the e-mail, the lines get wrapped at 80 characters. I
> tried to fix these manually, but I'm still getting strange errors when
> applying the patch. Admittedly I'm using a nightly build of
> TortoiseSVN to do this, so the problem might be there, but it would be
> nice to eliminate the possibility I've mangled the patch. In general
> it's best to send patches as attachments - see
> http://subversion.tigris.org/hacking.html#patches.
>
> Thanks!
>
> Paul
>
>
>
> > Some brief comments on the log message:
> > (1) There's no indication that any of this is platform-specific; is it?
> > (Does it work properly on Windows, as a possible problem was mentioned earlier?)
> > (2) I'd add your second paragraph below ("This has all...") into the log
> > message.
> > (3) Where you write "Capture exit_code ..." that kind of implies saving it,
> > but in fact it gets ignored; perhaps you could use words like "Accept and
> > ignore the exit code" instead.
> >
> > These things are just niceties for when the patch gets accepted and committed.
> >
> > - Julian
> >
> >
> >
> >
> > jeremy hinds wrote:
> > > Here is the revised patch for review. Corresponding changes to the
> > > test scripts aren't included yet (though a few are in the attachment,
> > > so that these changes can actually be executed).
> > >
> > > This has all of the lower-level process-running functions returning
> > > the exit code, all of the "run_and_verify_*()" functions guessing the
> > > expected exit code, and new "run_and_verify_*2()" functions allowing
> > > the expected exit code to be provided explicitly.
> > >
> > > [[[
> > > Allow testing of application exit codes.
> > >
> > > * subversion/tests/cmdline/svntest/main.py
> > > (run_command, run_svn, run_svnadmin, run_svnlook, run_svnsync,
> > > run_svnversion): Include exit_code in the returned tuple.
> > >
> > > (create_repos): Capture exit_code returned from run_command.
> > >
> > > * subversion/tests/cmdline/svntest/actions.py
> > > (run_and_verify_svnlook2, run_and_verify_svnadmin2,
> > > run_and_verify_svnversion2, run_and_verify_svn2,
> > > run_and_verify_svn_match_any2): New, execute the indicated binary
> > > and check actual outputs and exit code against the expected value
> > > parameters.
> > >
> > > (run_and_verify_svnlook, run_and_verify_svnadmin,
> > > run_and_verify_svnversion, run_and_verify_svn,
> > > run_and_verify_svn_match_any): Guess whether the expected exit should
> > > be 0 or 1 based on whether output is expected on stderr. Then invoke
> > > the coresponding run_and_verify_*2 function with that value. Return
> > > exit_code, stdout_lines, stderr_lines.
> > >
> > > (setup_pristine_repository, run_and_verify_load, run_and_verify_dump,
> > > run_and_verify_checkout, run_and_verify_update, run_and_verify_commit,
> > > run_and_verify_status, run_and_verify_unquiet_status,
> > > run_and_verify_diff_summarize, check_prop, inject_conflict_into_wc):
> > > Capture exit_code value returned from main.run_svn, main.run_command,
> > > main.run_svnadmin, main.run_command_stdin
> > >
> > > * subversion/tests/cmdline/svntest/tree.py
> > > (get_props): Capture exit code returned by main.run_svn.
> > >
> > > * subversion/tests/cmdline/svntest/verify.py
> > > (SVNUnexpectedExitCode): New exception raised when the exit code was not
> > > what was expected.
> > >
> > > (verify_exit_code): New, compares expected and actual exit code and raises
> > > an exception if they are different.
> > > ]]]
> > [...]
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
> > For additional commands, e-mail: dev-help_at_subversion.tigris.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org

Received on 2008-03-05 01:30:30 CET

This is an archived mail posted to the Subversion Dev mailing list.