From 6dc62852839d0dc9b9c510d29c723de35a77911a Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Fri, 10 Nov 2017 00:48:10 -0500 Subject: [PATCH] Improve test suite coverage 3041eeb (Run git test suite, 2016-12-16) enabled the test suite, but many of the tests were skipped due to missing requirements. Improve the test suite coverage by ensuring as many requirements are present as possible. Also add an option to run the test suite with multiple jobs using the %{?_smp_mflags} macro. This cut the test suite run time roughly in half in local testing. The -O option to 'make' helps ensure the output of each job is collected together rather than interspersed with output from other jobs. Sadly, the tests fail when run in parallel in koji, so this is disabled by default. It is included to speed up local builds. To enable in rpmbuild and mock, use either "--with parallel_tests" or "--define 'parallel_tests 1'" arguments. This is only supported on Fedora, as it requires make >= 4.0, which neither EL6 nor EL7 satisfy. Disable 2 failing tests which run with a limited stack on aarch64, arm*, and ppc* architectures. Some debugging with the affected hardware is needed. Similarly, disable "git svn branch tests" globally for both t9128-git-svn-cmd-branch and t9167-git-svn-cmd-branch-subproject because they fail randomly. The bug seems likely to be in the subversion perl bindings, but requires more testing. The failure output from a manual run (./t9128-git-svn-cmd-branch.sh -v -x -d): ++ git svn branch a Copying file:///home/tmz/rpmbuild/BUILD/git-2.14.2/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk at r2 to file:///home/tmz/rpmbuild/BUILD/git-2.14.2/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/branches/a... Found possible branch point: file:///home/tmz/rpmbuild/BUILD/git-2.14.2/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk => file:///home/tmz/rpmbuild/BUILD/git-2.14.2/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/branches/a, 2 Found branch parent: (refs/remotes/origin/a) bb43a88ce94511096d7d774f4d5feae281603eb0 Following parent with do_switch Successfully followed parent r3 = 2e27ee45dadc098239114bc13a6ae6cf6122d16f (refs/remotes/origin/a) error: git-svn died of signal 11 + test_eval_ret_=139 + want_trace + test t = t + test t = t + set +x error: last command exited with $?=139 not ok 3 - git svn branch tests The failure in t9167-git-svn-cmd-branch-subproject is similar. --- git.spec | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/git.spec b/git.spec index ceab34f..e3b876b 100644 --- a/git.spec +++ b/git.spec @@ -43,6 +43,19 @@ %global test_links 0 %endif +# Allow tests to run in parallel. Disabled by default due to unresolved +# failures when building in koji. Enabling it speeds up the test suite quite a +# bit though. The -O (--output-sync) option requires make > 4.0, which is not +# available on EL <= 7. Without it, running the tests in parallel causes the +# output to be rather unweildy, so restrict parallel tests to Fedora. +# +# Pass "--with parallel_tests" or "--define 'parallel_tests 1'" to +# rpmbuild/mock. +%bcond_with parallel_tests +%if %{with parallel_tests} && 0%{?fedora} +%global make_test_opts -O %{?_smp_mflags} +%endif + Name: git Version: 2.15.0 Release: 2%{?dist} @@ -113,6 +126,36 @@ BuildRequires: pkgconfig(bash-completion) BuildRequires: systemd %endif +# Test suite requirements +%if 0%{?fedora} && 0%{?fedora} >= 27 +# Needed by t5540-http-push-webdav.sh +BuildRequires: apr-util-bdb +%endif +BuildRequires: cvs +BuildRequires: cvsps +BuildRequires: gnupg +%if 0%{?fedora} || ( 0%{?rhel} && 0%{?rhel} == 7 && %{_arch} != ppc64 ) +BuildRequires: highlight +%endif +BuildRequires: httpd +%if 0%{?fedora} +BuildRequires: jgit +%endif +BuildRequires: pcre +BuildRequires: perl(CGI) +BuildRequires: perl(CGI::Carp) +BuildRequires: perl(CGI::Util) +BuildRequires: perl(DBD::SQLite) +BuildRequires: perl(Digest::MD5) +BuildRequires: perl(IO::Pty) +BuildRequires: perl(Mail::Address) +BuildRequires: perl(Memoize) +BuildRequires: perl(Test::More) +BuildRequires: perl(Time::HiRes) +BuildRequires: subversion +BuildRequires: subversion-perl +BuildRequires: time + Requires: git-core = %{version}-%{release} Requires: git-core-doc = %{version}-%{release} Requires: perl(Error) @@ -568,13 +611,39 @@ find %{buildroot}%{_pkgdocdir}/{howto,technical} -type f \ %if %{test_links} find %{buildroot}%{_pkgdocdir} -name "*.html" | xargs linkchecker %endif + +# Tests to skip on all releases and architectures +# t9128-git-svn-cmd-branch - "branch tests" fails randomnly +# t9167-git-svn-cmd-branch-subproject - "branch tests" fails randomnly +GIT_SKIP_TESTS="t9128.3 t9167.3" + +%ifarch aarch64 %{arm} %{power64} +# Skip tests which fail on aarch64, arm, and ppc +# +# The following 2 tests use run_with_limited_cmdline, which calls ulimit -s 128 +# to limit the maximum stack size. +# t5541.33 'push 2000 tags over http' +# t5551.25 'clone the 2,000 tag repo to check OS command line overflow' +GIT_SKIP_TESTS="$GIT_SKIP_TESTS t5541.33 t5551.25" +%endif + %ifarch s390x # Skip grep tests which fail intermittently on s390x ## - probably it is because of current troubles with binutils on s390x. Will ## try tests when troubles on s390x will be resolved -export GIT_SKIP_TESTS="t7008 t7810 t7811 t7812 t7813 t7814" +GIT_SKIP_TESTS="$GIT_SKIP_TESTS t7008 t7810 t7811 t7812 t7813 t7814" %endif -make test + +export GIT_SKIP_TESTS + +# Set LANG so various UTF-8 tests are run +export LANG=en_US.UTF-8 + +# Set SVNSERVE_PORT to run svnserve tests +export SVNSERVE_PORT=9000 + +# Run the tests +make %{?make_test_opts} test %clean rm -rf %{buildroot} @@ -739,6 +808,7 @@ rm -rf %{buildroot} - Rename %%gitcoredir to %%gitexecdir; upstream uses the latter - Move commands which no longer require perl into git-core - Move filter-branch out of core, it needs perl now +- Improve test suite coverage * Mon Oct 30 2017 Todd Zullinger - 2.15.0-1 - Update to 2.15.0