From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Nieder Subject: Re: [PATCH 2/3] t9010-svn-fi: Add tests for svn-fi Date: Tue, 1 Feb 2011 12:58:17 -0600 Message-ID: <20110201185817.GG3771@burratino> References: <1296570403-9082-1-git-send-email-artagnon@gmail.com> <1296570403-9082-3-git-send-email-artagnon@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Git List , David Barr , Sverre Rabbelier , Junio C Hamano To: Ramkumar Ramachandra X-From: git-owner@vger.kernel.org Tue Feb 01 19:58:44 2011 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PkLR6-0006FJ-1S for gcvg-git-2@lo.gmane.org; Tue, 01 Feb 2011 19:58:44 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752448Ab1BAS60 (ORCPT ); Tue, 1 Feb 2011 13:58:26 -0500 Received: from mail-iw0-f174.google.com ([209.85.214.174]:46857 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752080Ab1BAS60 (ORCPT ); Tue, 1 Feb 2011 13:58:26 -0500 Received: by iwn9 with SMTP id 9so6799419iwn.19 for ; Tue, 01 Feb 2011 10:58:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=nfS7LsnCjynmVu7ClSm6FE0eo8u/SW3vH+mkRfVinqc=; b=HH1Gwi4nTxXyKHRhVkq6bY+9gBgkf9iZzYVTirauLgmssEct2aTaTrU3xe8mHAg+5z 5HX7s9RiERBeVhvXy0E6w1yogejQA8T0NvTTiuBiY6f8cv3s6GRrbvhsxiGG0GOEsrVK SBU12FI2F1L+IopBazzzbP+On7jYLv8UYoSYs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=D5XO6bR/xzwdEKfTrliom7a1aqc9pdtPMgS6sKUTqMSK2NfJKswGSanlGxo+5X/5GU Upn3kIptDImCDDJctqe9lI6YRXoOROYtqhVJtKC3a0xRyk5Utb+NrfvkTp1DIrRAQUfW 6q0mX+LwQpNkaafUNjtv1J72HMDoxgbtucn8Y= Received: by 10.231.35.204 with SMTP id q12mr8737033ibd.191.1296586705350; Tue, 01 Feb 2011 10:58:25 -0800 (PST) Received: from burratino (adsl-69-209-75-28.dsl.chcgil.sbcglobal.net [69.209.75.28]) by mx.google.com with ESMTPS id 34sm19074981ibi.8.2011.02.01.10.58.22 (version=SSLv3 cipher=RC4-MD5); Tue, 01 Feb 2011 10:58:24 -0800 (PST) Content-Disposition: inline In-Reply-To: <1296570403-9082-3-git-send-email-artagnon@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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. > @@ -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. > +svn_look () { > + subcommand=$1 && > + shift && > + svnlook "$subcommand" "$svnrepo" "$@" > +} Needed? The svn_cmd function exists to point to a configuration directory. > +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 1170199019 +0100 > + committer nobody 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). > +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 1170199019 +0100 > + committer nobody 1170199019 +0100 > + data 0 > + M 100644 inline foo > + data 0 > + > + EOF > + try_load input must_fail What's wrong with this stream? > +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 1170199019 +0100 > + committer nobody 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