git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] t9010-svn-fi: Add tests for svn-fi

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Feb 1, 2011, 18:58 UTC
Message-ID
<20110201185817.GG3771@burratino>
In-Reply-To
<1296570403-9082-3-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra wrote:
> Create a test-svn-fi in toplevel directory, add rules to build it, and
> add some basic tests.
Thanks.  Probably this should be squashed with patch #1?
> --- /dev/null
> +++ b/t/t9010-svn-fi.sh
Test number's already taken.  9012 is free, though.
Show 12 quoted lines
> @@ -0,0 +1,303 @@
> +#!/bin/sh
> +
> +test_description='check svn dumpfile exporter'
> +
> +. ./test-lib.sh
> +
> +if ! svnadmin -h >/dev/null 2>&1
> +then
> +	skip_all='skipping svn-fi tests, svn not available'
> +	test_done
> +fi

Is it impossible to test without svn present or otherwise speed these up? Some random ideas:

 - feed svn-fi output into svn-fe and compare git repos
 - check if "svn-fi after svn-fe" is idempotent (should it be?)
 - check for individual salient features from svn-fi output, using
   "grep", "sed", or "awk" to ignore the rest
 - use svnrdump in place of "svnadmin load" if available (is it
   faster?)
 - find the bottleneck in svnadmin and fix it

Of course at least one test of the "svn-fe | svnadmin load" pipeline seems worthwhile; I'm just thinking we should avoid habits that slow down the test suite too much.

Show 5 quoted lines
> +svn_look () {
> +	subcommand=$1 &&
> +	shift &&
> +	svnlook "$subcommand" "$svnrepo" "$@"
> +}

Needed? The svn_cmd function exists to point to a configuration directory.

Show 13 quoted lines
> +test_expect_success 'normal empty files' '
> +	reinit_svn &&
> +	cat >expect.tree <<-\EOF &&
> +	/
> +	 foo
> +	 bar
> +	EOF
> +	cat >input <<-\EOF &&
> +	reset refs/heads/master
> +	commit refs/heads/master
> +	mark :1
> +	author nobody <nobody@localhost> 1170199019 +0100
> +	committer nobody <nobody@localhost> 1170199019 +0100

Where do the dates come from? Why should I (the reader) expect them?

> +# TODO: How to test date? Need to convert from local timestamp
Ah, you saw. :)

One possibility is to fuzz away whatever is unimportant when comparing results (and using tools like "awk" to extract the date to perform whatever tests on it are appropriate where it matters).

Show 14 quoted lines
> +test_expect_success 'malformed fast-import stream: author 2' '
> +	reinit_svn &&
> +	cat >input <<-\EOF &&
> +	reset refs/heads/master
> +	commit refs/heads/master
> +	mark :1
> +	author nobody <localhost> 1170199019 +0100
> +	committer nobody <nobody@localhost> 1170199019 +0100
> +	data 0
> +	M 100644 inline foo
> +	data 0
> +
> +	EOF
> +	try_load input must_fail
What's wrong with this stream?
Show 22 quoted lines
> +test_expect_success 'svn:special and svn:executable' '
> +	reinit_svn &&
> +	cat >input <<-\EOF &&
> +	reset refs/heads/master
> +	commit refs/heads/master
> +	mark :1
> +	author nobody <nobody@localhost> 1170199019 +0100
> +	committer nobody <nobody@localhost> 1170199019 +0100
> +	data 7
> +	nothing
> +	M 100755 inline foo
> +	data 0
> +	M 755 inline moo
> +	data 0
> +	M 120000 inline bar
> +	data 0
> +
> +	EOF
> +	try_load input &&
> +	svn_look propget svn:executable foo &&
> +	svn_look propget svn:executable moo &&
> +	svn_look propget svn:special bar

Maybe worth checking for the absence of svn:executable + svn:special from an ordinary file, too?

> +test_expect_success 'replace symlink with normal file' '

Nice. "replace symlink with executable" and "replace symlink with directory" might also be interesting.

Regards, Jonathan

Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 7 of 13 in “Towards a Git-to-SVN bridge”
  1. 0/3 Towards a Git-to-SVN bridgeRamkumar Ramachandra, Feb 1, 2011
  2. 1/3 vcs-svn: Introduce svnload, a dumpfile producerRamkumar Ramachandra, Feb 1, 2011
  3. Erik Faye-LundFeb 1, 2011
  4. Ramkumar RamachandraFeb 2, 2011
  5. Erik Faye-LundFeb 2, 2011
  6. 2/3 t9010-svn-fi: Add tests for svn-fiRamkumar Ramachandra, Feb 1, 2011
  7. Jonathan NiederFeb 1, 2011
  8. Ramkumar RamachandraFeb 2, 2011
  9. Jonathan NiederFeb 2, 2011
  10. 3/3 vcs-svn: Refactor dump_export code into dispatch tableRamkumar Ramachandra, Feb 1, 2011
  11. Jonathan NiederFeb 1, 2011
  12. Junio C HamanoFeb 1, 2011
  13. Ramkumar RamachandraFeb 2, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.