From 89def5ea113b35c20d568042fe23375d0c4abefa Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Apr 01 2020 09:42:59 +0000 Subject: Update to upstream version 0.14.0 --- diff --git a/.gitignore b/.gitignore index 04172b7..79062f8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /DLRN-0.5.1.tar.gz /DLRN-0.9.0.tar.gz /DLRN-0.9.1.tar.gz +/DLRN-0.14.0.tar.gz diff --git a/0001-Fixes-to-unit-tests.patch b/0001-Fixes-to-unit-tests.patch new file mode 100644 index 0000000..dd0bf17 --- /dev/null +++ b/0001-Fixes-to-unit-tests.patch @@ -0,0 +1,59 @@ +From f08797ff36156bca143779fa04bed439f6ec3646 Mon Sep 17 00:00:00 2001 +From: Javier Pena +Date: Wed, 1 Apr 2020 10:51:49 +0200 +Subject: [PATCH] Fixes to unit tests + +When the unit tests are executed in a different environment (for +example, in mock when packaging DLRN itself), we need to add some +extra fixes. + +Change-Id: I71fff9c8f09b944cd978b29dccc687ce4c157b5c +--- + dlrn/tests/test_api.py | 6 ++++-- + dlrn/tests/test_driver_rdoinfo.py | 4 +++- + 2 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/dlrn/tests/test_api.py b/dlrn/tests/test_api.py +index 305007c..c2a44bd 100644 +--- a/dlrn/tests/test_api.py ++++ b/dlrn/tests/test_api.py +@@ -535,8 +535,10 @@ class TestPromoteBatch(DLRNAPITestCase): + os.makedirs('/tmp/component/tripleo') + + def tearDown(self): +- shutil.rmtree('/tmp/component/None') +- shutil.rmtree('/tmp/component/tripleo') ++ if os.path.exists('/tmp/component/None'): ++ shutil.rmtree('/tmp/component/None') ++ if os.path.exists('/tmp/component/tripleo'): ++ shutil.rmtree('/tmp/component/tripleo') + super(TestPromoteBatch, self).tearDown() + + def test_promote_batch_needs_auth(self, db2_mock, db_mock): +diff --git a/dlrn/tests/test_driver_rdoinfo.py b/dlrn/tests/test_driver_rdoinfo.py +index d375de7..1aac83b 100644 +--- a/dlrn/tests/test_driver_rdoinfo.py ++++ b/dlrn/tests/test_driver_rdoinfo.py +@@ -80,9 +80,10 @@ class TestDriverRdoInfo(base.TestCase): + + self.assertEqual(di_mock.call_args_list, expected) + ++ @mock.patch('os.environ.get', side_effect=['myuser']) + @mock.patch('sh.env', create=True) + @mock.patch('os.listdir', side_effect=_mocked_listdir) +- def test_custom_preprocess(self, ld_mock, sh_mock): ++ def test_custom_preprocess(self, ld_mock, sh_mock, get_mock): + self.config.custom_preprocess = ['/bin/true'] + driver = RdoInfoDriver(cfg_options=self.config) + driver.preprocess(package_name='foo') +@@ -90,6 +91,7 @@ class TestDriverRdoInfo(base.TestCase): + expected = [mock.call(['DLRN_PACKAGE_NAME=foo', + 'DLRN_DISTGIT=%s/foo_distro/' % self.temp_dir, + 'DLRN_SOURCEDIR=%s/foo' % self.temp_dir, ++ 'DLRN_USER=myuser', + '/bin/true'], + _cwd='%s/foo_distro/' % self.temp_dir, + _env={'LANG': 'C'})] +-- +2.25.1 + diff --git a/0001-Prevent-unit-tests-from-accessing-Internet.patch b/0001-Prevent-unit-tests-from-accessing-Internet.patch deleted file mode 100644 index 11c6231..0000000 --- a/0001-Prevent-unit-tests-from-accessing-Internet.patch +++ /dev/null @@ -1,64 +0,0 @@ -From c6dc1402b7e9aa3e9fe9396d2b4f6aaf853155cf Mon Sep 17 00:00:00 2001 -From: Javier Pena -Date: Fri, 15 Sep 2017 14:57:41 +0200 -Subject: [PATCH] Prevent unit tests from accessing Internet - -Unit tests for the remote import functionality were accessing the -internet via the rdoinfo driver's getpackages() method. Mocking that -call to avoid Internet access and allow packaging in isolated -environments. - -Change-Id: I2cc72a39ce78efb0e7ab5c8f3edeeecfe0aef507 ---- - dlrn/tests/test_api.py | 4 +++- - dlrn/tests/test_remote.py | 3 ++- - 2 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/dlrn/tests/test_api.py b/dlrn/tests/test_api.py -index 6d9e5ff..300abf2 100644 ---- a/dlrn/tests/test_api.py -+++ b/dlrn/tests/test_api.py -@@ -424,6 +424,7 @@ class TestRepoStatus(DLRNAPITestCase): - self.assertEqual(len(data), 1) - - -+ - @mock.patch('dlrn.remote.getSession', side_effect=mocked_session) - @mock.patch('dlrn.api.utils.getSession', side_effect=mocked_session) - class TestRemoteImport(DLRNAPITestCase): -@@ -431,11 +432,12 @@ class TestRemoteImport(DLRNAPITestCase): - response = self.app.post('/api/remote/import') - self.assertEqual(response.status_code, 401) - -+ @mock.patch('dlrn.drivers.rdoinfo.RdoInfoDriver.getpackages') - @mock.patch.object(sh.Command, '__call__', autospec=True) - @mock.patch('dlrn.remote.post_build') - @mock.patch('dlrn.remote.urlopen', side_effect=mocked_urlopen) - def test_post_remote_import_success(self, url_mock, build_mock, sh_mock, -- db2_mock, db_mock): -+ db2_mock, db_mock, gp_mock): - - req_data = json.dumps(dict(repo_url='http://example.com/1/')) - -diff --git a/dlrn/tests/test_remote.py b/dlrn/tests/test_remote.py -index dd381d5..cca81e9 100644 ---- a/dlrn/tests/test_remote.py -+++ b/dlrn/tests/test_remote.py -@@ -39,12 +39,13 @@ def mocked_urlopen(url): - return urlopen(url) - - -+@mock.patch('dlrn.drivers.rdoinfo.RdoInfoDriver.getpackages') - @mock.patch.object(sh.Command, '__call__', autospec=True) - @mock.patch('dlrn.remote.post_build') - @mock.patch('dlrn.remote.getSession', side_effect=mocked_session) - @mock.patch('dlrn.remote.urlopen', side_effect=mocked_urlopen) - class TestRemote(base.TestCase): -- def test_remote(self, url_mock, db_mock, build_mock, sh_mock): -+ def test_remote(self, url_mock, db_mock, build_mock, sh_mock, gp_mock): - testargs = ["dlrn-remote", "--config-file", "projects.ini", - "--repo-url", "http://example.com/1/"] - # There should be only one call to post_build(), even though there are --- -2.9.5 - diff --git a/dlrn.spec b/dlrn.spec index 1debe6a..bc99b94 100644 --- a/dlrn.spec +++ b/dlrn.spec @@ -11,8 +11,8 @@ %endif Name: %{pkg_name} -Version: 0.9.1 -Release: 5%{?dist} +Version: 0.14.0 +Release: 1%{?dist} Summary: Build and maintain yum repositories following upstream commits License: ASL 2.0 @@ -22,8 +22,10 @@ Source1: run-dlrn.sh Source2: projects.ini Source3: dlrn.service Source4: dlrn.timer +# https://softwarefactory-project.io/r/17981 +Patch0001: 0001-Fixes-to-unit-tests.patch BuildArch: noarch - + BuildRequires: systemd-units %if %{with python2} Requires: python2-%{pkg_name} == %{version}-%{release} @@ -78,10 +80,10 @@ BuildRequires: %{py2_dist testtools} BuildRequires: %{py2_dist PyYAML} Requires: mock Requires: rpm-build +Requires: rpmdevtools Requires: createrepo_c Requires: git Requires: %{py2_dist alembic} >= 0.7 -Requires: %{py2_dist Babel} Requires: %{py2_dist distroinfo} Requires: %{py2_dist Flask} Requires: %{py2_dist Flask-HTTPAuth} @@ -97,7 +99,6 @@ Requires: %{py2_dist six} Requires: %{py2_dist SQLAlchemy} Requires: %{py2_dist PyYAML} Requires: %{py2_dist rdopkg} >= 0.45 -Requires: %{py2_dist PrettyTable} %description -n python2-%{pkg_name} %{desc} @@ -129,10 +130,10 @@ BuildRequires: %{py3_dist testtools} BuildRequires: %{py3_dist PyYAML} Requires: mock Requires: rpm-build +Requires: rpmdevtools Requires: createrepo_c Requires: git Requires: %{py3_dist alembic} >= 0.7 -Requires: %{py3_dist Babel} Requires: %{py3_dist Flask} Requires: %{py3_dist Flask-HTTPAuth} Requires: %{py3_dist distroinfo} @@ -148,7 +149,6 @@ Requires: %{py3_dist six} Requires: %{py3_dist SQLAlchemy} Requires: %{py3_dist PyYAML} Requires: %{py3_dist rdopkg} >= 0.45 -Requires: %{py3_dist PrettyTable} %description -n python3-%{pkg_name} %{desc} @@ -216,11 +216,11 @@ install -p -D -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/dlrn.timer %check %if %{with python2} -PYTHON=python2 %{__python2} setup.py test +PYTHON=python2 %{__python2} setup.py testr %endif %if %{with python3} rm -rf .testrepository -PYTHON=python3 %{__python3} setup.py test +PYTHON=python3 %{__python3} setup.py testr %endif %pre @@ -281,6 +281,9 @@ exit 0 %endif %changelog +* Wed Apr 01 2020 Javier Peña - 0.14.0-1 +- Update to upstream version 0.14.0 + * Tue Jan 28 2020 Fedora Release Engineering - 0.9.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/projects.ini b/projects.ini index 9852a55..d8b62f4 100644 --- a/projects.ini +++ b/projects.ini @@ -1,27 +1,87 @@ [DEFAULT] datadir=/var/lib/dlrn/data scriptsdir=/usr/share/dlrn/scripts -baseurl=http://trunk.rdoproject.org/centos7 -templatedir=/usr/lib/python2.7/site-packages/dlrn/templates +configdir= +baseurl=http://trunk.rdoproject.org/centos8/ distro=rpm-master source=master -target=centos -maxretries=3 +target=centos8 smtpserver= reponame=delorean -tags= +templatedir=/usr/lib/python3.8/site-packages/dlrn/templates +project_name=RDO +maxretries=3 pkginfo_driver=dlrn.drivers.rdoinfo.RdoInfoDriver +build_driver=dlrn.drivers.mockdriver.MockBuildDriver +tags= +#tags=mitaka rsyncdest= rsyncport=22 workers=1 gerrit_topic=rdo-FTBFS database_connection=sqlite:///commits.sqlite +fallback_to_master=1 +nonfallback_branches=^master$,^rpm-master$ +release_numbering=0.date.hash +custom_preprocess= +include_srpm_in_repo=true +keep_changelog=false +allow_force_rechecks=false +use_components=false [gitrepo_driver] -# Options to be specified if pkginfo_driver is set to +# options to be specified if pkginfo_driver is set to # dlrn.drivers.gitrepo.GitRepoDriver # #repo=http://github.com/openstack/rpm-packaging #directory=/openstack #skip=openstack-macros,keystoneauth1 #use_version_from_spec=1 +#keep_tarball=0 + +[rdoinfo_driver] +# options to be specified if pkginfo_driver is set to +# dlrn.drivers.rdoinfo.RdoInfoDriver +# +#repo=http://github.com/org/rdoinfo-fork +#info_files=rdo.yml +#cache_dir= + +[downstream_driver] +# options to be specified if pkginfo_driver is set to +# dlrn.drivers.downstream.DownstreamInfoDriver +# +#repo=http://github.com/org/fooinfo +#info_files=foo.yml +#versions_url=https://trunk.rdoproject.org/centos7-master/current/versions.csv +#downstream_distro_branch=foo-rocky +#downstream_tag=foo- +#downstream_distgit_key=foo-distgit +#use_upstream_spec=False +#downstream_spec_replace_list=^foo/bar,string1/string2 +#cache_dir= + +[mockbuild_driver] +# options to be specified if build_driver is set to +# dlrn.drivers.mockdriver.MockBuildDriver +#install_after_build=1 + +[kojibuild_driver] +# options to be specified if build_driver is set to +# dlrn.drivers.kojidriver.KojiBuildDriver +#koji_exe=koji +#krb_principal=user@EXAMPLE.COM +#krb_keytab=/home/user/user.keytab +#scratch_build=True +#build_target=koji-target-build +#arch=x86_64 +#use_rhpkg=False +#fetch_mock_config=False +#mock_base_packages=basesystem rpm-build python2-devel gcc make python-sqlalchemy python-webob ghostscript graphviz python-sphinx python-eventlet python-six python-pbr openstack-macros git yum-plugin-priorities rubygems python-setuptools_scm +#additional_koji_tags= + +[coprbuild_driver] +# options to be specified if build_driver is set to +# dlrn.drivers.coprdriver.CoprBuildDriver +#coprid=account/repo + diff --git a/sources b/sources index a04cdd4..3c1b940 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (DLRN-0.9.1.tar.gz) = f3c38ef03b0e22d1d37879487b5696626ef1c117ec2b5603eeb2607ac2e9e687e96036a099d99ea3f4517d268f182a25828cc4cefb30b8205242550e5fb81d8c +SHA512 (DLRN-0.14.0.tar.gz) = 59d249e9f6eb5ba4f0f90a47f950817490bcd62e4af764ef089957b54555ac2e9097ba4fc143f984e98d27d0787bafecc110b70238c34778d63753479732adce