[packages/git-cola] run tests

glen glen at pld-linux.org
Tue Feb 23 06:55:06 CET 2016


commit ce0e6d4af65af6a4c0c408358dac20a2020db6c0
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Feb 23 07:54:59 2016 +0200

    run tests

 disable-live-tests.patch | 22 ++++++++++++++++++++++
 git-cola.spec            | 12 +++++++++++-
 2 files changed, 33 insertions(+), 1 deletion(-)
---
diff --git a/git-cola.spec b/git-cola.spec
index ce0e7c1..ac2de9c 100644
--- a/git-cola.spec
+++ b/git-cola.spec
@@ -1,5 +1,6 @@
 #
 # Conditional build:
+%bcond_without	tests	# do not perform "make test"
 %bcond_without	doc	# don't build doc
 
 Summary:	A sleek and powerful git GUI
@@ -7,9 +8,10 @@ Name:		git-cola
 Version:	2.3
 Release:	1
 License:	GPL v2+
+Group:		Development/Tools
 Source0:	https://github.com/git-cola/git-cola/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	0f3c5355eda07e752d1f8f536882a2d0
-Group:		Development/Tools
+Patch0:		disable-live-tests.patch
 URL:		http://git-cola.github.io/
 BuildRequires:	desktop-file-utils
 BuildRequires:	gettext-tools
@@ -22,6 +24,9 @@ BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
 BuildRequires:	sed >= 4.0
 %if %{with doc}
+BuildRequires:	python-nose
+%endif
+%if %{with doc}
 BuildRequires:	rsync
 BuildRequires:	sphinx-pdg-2
 %endif
@@ -49,15 +54,20 @@ Dokumentacja do git-cola.
 
 %prep
 %setup -q
+%patch0 -p1
 
 # fix #!/usr/bin/env python -> #!/usr/bin/python:
 %{__sed} -i -e '1s,^#!.*python,#!%{__python},' bin/git-* cola/widgets/*.py extras/*/*.py share/git-cola/bin/git*
 
+# requires X for test
+rm test/qtutils_test.py
+
 # cleanup backups after patching
 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
 
 %build
 %{__make}
+%{?with_tests:%{__make} test NOSETESTS=nosetests-%{py_ver}}
 %{?with_doc:%{__make} doc SPHINXBUILD=sphinx-build-2}
 
 %install
diff --git a/disable-live-tests.patch b/disable-live-tests.patch
new file mode 100644
index 0000000..2ebdc98
--- /dev/null
+++ b/disable-live-tests.patch
@@ -0,0 +1,22 @@
+diff --git a/test/git_test.py b/test/git_test.py
+index 9f812b2..ff7da24 100644
+--- a/test/git_test.py
++++ b/test/git_test.py
+@@ -53,17 +53,6 @@ class GitCommandTest(unittest.TestCase):
+         version = self.git.version()[STDOUT]
+         self.failUnless(version.startswith('git version'))
+ 
+-    def test_tag(self):
+-        """Test running 'git tag'"""
+-        tags = self.git.tag()[STDOUT].splitlines()
+-        self.failUnless( 'v1.0.0' in tags )
+-
+-    def test_show(self):
+-        """Test running 'git show'"""
+-        sha = '1b9742bda5d26a4f250fa64657f66ed20624a084'
+-        contents = self.git.show(sha)[STDOUT].splitlines()
+-        self.failUnless(contents[0] == '/build')
+-
+     def test_stdout(self):
+         """Test overflowing the stdout buffer"""
+         # Write to stdout only
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/git-cola.git/commitdiff/ce0e6d4af65af6a4c0c408358dac20a2020db6c0



More information about the pld-cvs-commit mailing list