LU-2202: Start unittests during installation or build of pungi

* added section with tests and pytest module to requires
IMPORTANT - build.sh script is commented
* added pyfakefs dependency
* fixed little mock_open issue for runroot test
* bumped version

@BS-TARGET-CL8

Change-Id: I036db225646875eb610736cd26f473850a78447c
This commit is contained in:
Danylo Kuropiatnyk 2021-02-17 15:03:50 +02:00
parent 02686d7bdf
commit 41381df6a5
3 changed files with 13 additions and 5 deletions

View File

@ -1,7 +1,7 @@
%{?python_enable_dependency_generator}
Name: pungi
Version: 4.2.9
Version: 4.2.10
Release: 1%{?dist}.cloudlinux
Summary: Distribution compose tool
@ -10,7 +10,10 @@ URL: https://pagure.io/pungi
Source0: %{name}-%{version}.tar.bz2
BuildRequires: python3-nose
BuildRequires: python3-pytest
BuildRequires: python3-mock
BuildRequires: python3-pyfakefs
BuildRequires: python3-ddt
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-productmd >= 1.23
@ -115,8 +118,12 @@ rm %{buildroot}%{_bindir}/pungi
# CLOUDLINUX: We don't need fedmsg stuff
rm %{buildroot}%{_bindir}/%{name}-fedmsg-notification
#%check
#nosetests-3 --exe
%check
python3 -m pytest
# master branch part of %check segment. Currently it doesn't work
# because of pungi-koji requirement in bash tests
#./tests/data/specs/build.sh
#cd tests && ./test_compose.sh
%files
%license COPYING GPL
@ -150,6 +157,7 @@ rm %{buildroot}%{_bindir}/%{name}-fedmsg-notification
%{_bindir}/%{name}-compare-depsolving
%{_bindir}/%{name}-wait-for-signed-ostree-handler
%changelog
* Thu Feb 11 2021 Stepan Oksanichenko <soksanichenko@cloudlinux.com> - 4.2.9-1
- LNX-133: Create a server for building nightly builds of AlmaLinux

View File

@ -93,7 +93,7 @@ class Runroot(kobo.log.LoggingBase):
log_file = os.path.join(log_dir, "program.log")
try:
with open(log_file) as f:
for line in f:
for line in f.readlines():
if "losetup: cannot find an unused loop device" in line:
return True
if re.match("losetup: .* failed to set up loop device", line):

View File

@ -25,7 +25,7 @@ packages = sorted(packages)
setup(
name="pungi",
version="4.2.9",
version="4.2.10",
description="Distribution compose tool",
url="https://pagure.io/pungi",
author="Dennis Gilmore",