From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 From: Aleksei Nikiforov To: devel@lists.altlinux.org Date: Tue, 10 Dec 2019 18:23:42 +0300 Message-Id: <20191210152343.33867-38-darktemplar@altlinux.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191210152343.33867-1-darktemplar@altlinux.org> References: <20191210152343.33867-1-darktemplar@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Aleksei Nikiforov Subject: [devel] [PATCH for apt 37/38] Enable integration test suite during package build X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 15:26:02 -0000 Archived-At: List-Archive: List-Post: --- apt.spec | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/apt.spec b/apt.spec index 5291a4a..7c91f70 100644 --- a/apt.spec +++ b/apt.spec @@ -1,3 +1,5 @@ +%def_enable check + Name: apt Version: 0.5.15lorg2 Release: alt71 @@ -56,6 +58,13 @@ BuildPreReq: liblua5.3-devel BuildRequires: bzlib-devel cvs docbook-utils gcc-c++ libreadline-devel librpm-devel setproctitle-devel zlib-devel BuildRequires: libgnutls-devel +# dependencies of tests +%if_enabled check +BuildRequires: /usr/bin/genbasedir +BuildRequires: /usr/sbin/nginx +BuildRequires: /usr/bin/openssl +%endif + %package -n libapt Summary: APT's core libraries Group: System/Libraries @@ -92,6 +101,12 @@ Summary(ru_RU.UTF-8): Поддержка метода https для APT Group: Other Requires: %name = %EVR +%package tests +Summary: Test suite for APT +Summary(ru_RU.UTF-8): Набор тестов для APT +Group: Other +Requires: %name = %EVR + # {{{ descriptions %define risk_usage_en This package is still under development. @@ -153,6 +168,9 @@ This package contains method 'https' for APT. %risk_usage_en +%description tests +This package contains test suite for APT. + %description -n libapt -l ru_RU.UTF-8 В этом пакете находится библиотеки управления пакетами из комплекта APT. В отличие от оригинальной версии для Debian, этот @@ -195,7 +213,8 @@ This package contains method 'https' for APT. %risk_usage -# }}} +%description tests -l ru_RU.UTF-8 +В этом пакете находится набор тестов для APT. %prep %setup @@ -245,6 +264,7 @@ mkdir -p %buildroot%_sysconfdir/%name/{%name.conf,sources.list,vendors.list,pref mkdir -p %buildroot%_libdir/%name/scripts mkdir -p %buildroot%_localstatedir/%name/{lists/partial,prefetch} mkdir -p %buildroot%_cachedir/%name/{archives/partial,gen{pkg,src}list} +mkdir -p %buildroot%_libdir/%name/tests %makeinstall includedir=%buildroot%_includedir/apt-pkg @@ -272,17 +292,28 @@ find %buildroot%_includedir -type f -name '*.h' |while read f; do EOF done +cp -r test/integration %buildroot%_libdir/%name/tests/ + %find_lang %name unset RPM_PYTHON %set_verify_elf_method strict +%check +# run tests multiple times to make sure no tests are randomly failing +pushd test/integration +for i in $(seq 1 10) ; do +LD_LIBRARY_PATH=%buildroot%_libdir PATH=$PATH:%buildroot%_bindir METHODSDIR=%buildroot%_libdir/apt/methods ./run-tests +done +popd + %files -f %name.lang %_bindir/apt-* %_libdir/%name %exclude %_libdir/%name/methods/rsync %exclude %_libdir/%name/methods/https +%exclude %_libdir/%name/tests %dir %_sysconfdir/%name %config(noreplace) %_sysconfdir/%name/%name.conf %dir %_sysconfdir/%name/*.d @@ -319,6 +350,9 @@ unset RPM_PYTHON %dir %_libdir/%name/methods %_libdir/%name/methods/https +%files tests +%_libdir/%name/tests + %changelog * Mon Jul 22 2019 Aleksei Nikiforov 0.5.15lorg2-alt71 - Introduced new function ListUpdate for improved packagekit support. -- 2.24.0