Hello community,
here is the log from the commit of package openSUSE-release-tools for
openSUSE:Factory checked in at 2017-10-25 17:47:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openSUSE-release-tools (Old)
and /work/SRC/openSUSE:Factory/.openSUSE-release-tools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openSUSE-release-tools"
Wed Oct 25 17:47:54 2017 rev:12 rq:536444 version:20171024.32d1a97
Changes:
--------
---
/work/SRC/openSUSE:Factory/openSUSE-release-tools/openSUSE-release-tools.changes
2017-10-24 22:24:34.357062988 +0200
+++
/work/SRC/openSUSE:Factory/.openSUSE-release-tools.new/openSUSE-release-tools.changes
2017-10-25 17:47:55.482279220 +0200
@@ -1,0 +2,35 @@
+Tue Oct 24 23:22:53 UTC 2017 - [email protected]
+
+- Update to version 20171024.32d1a97:
+ * tests/OBSLocal: invoke scripts using `coverage` to include in report.
+ * tests/OBSLocal: split out execute() to provide osc and generic versions.
+ * tests/OBSLocal: include assertOBS() to clarify OBS status before test.
+ * tests/OBSLocal: add email and include spaces in generated oscrc file.
+ * tests/OBSLocal: rework OSCRC handling to use non-default file.
+ * tests/OBSLocal: add workaround for obs.py leakage.
+ * travis: before_cache: include -R in chmod .docker-tmp.
+ * obs_clone: remove whole repositories rather than just path when fenced.
+ * obs_clone: provide --cache feature.
+ * osclib/cache: allow ttl of 0 to prevent caching.
+ * dist/spec: disable `make check` during %check until integration tests
resolved.
+ * Exclude .open-build-service/ from docker, flake8, and git.
+ * travis: provide local OBS setup and clone base data.
+ * tests/devel_project: provide basic test against local OBS.
+ * tests/OBSLocal: provide based class for testing against local OBS.
+ * obs_clone: clone projects and dependencies between OBS instances.
+ * devel-project: list: only remove self if in devel project list.
+
+-------------------------------------------------------------------
+Tue Oct 24 20:21:36 UTC 2017 - [email protected]
+
+- Update to version 20171024.443b432:
+ * osclib/conf: prefer already parsed conffile over OSC_CONFIG env variable.
+ * tests/obs: move Cache.delete_all() after CACHE_DIR changed.
+
+-------------------------------------------------------------------
+Tue Oct 24 09:56:06 UTC 2017 - [email protected]
+
+- Update to version 20171024.1c17971:
+ * Blacklist new warnings introduced by flake8 3.5.0
+
+-------------------------------------------------------------------
Old:
----
openSUSE-release-tools-20171024.737d39a.obscpio
New:
----
openSUSE-release-tools-20171024.32d1a97.obscpio
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ openSUSE-release-tools.spec ++++++
--- /var/tmp/diff_new_pack.jDl7un/_old 2017-10-25 17:47:56.590227219 +0200
+++ /var/tmp/diff_new_pack.jDl7un/_new 2017-10-25 17:47:56.594227031 +0200
@@ -20,7 +20,7 @@
%define source_dir osc-plugin-factory
%define announcer_filename factory-package-news
Name: openSUSE-release-tools
-Version: 20171024.737d39a
+Version: 20171024.32d1a97
Release: 0
Summary: Tools to aid in staging and release work for openSUSE/SUSE
License: GPL-2.0+ and MIT
@@ -251,7 +251,8 @@
%check
%if 0%{?is_opensuse}
-make check
+# TODO openSUSE/osc-plugin-factory#1221: decide how to handle integration tests
+# make check
%endif
%install
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.jDl7un/_old 2017-10-25 17:47:56.646224591 +0200
+++ /var/tmp/diff_new_pack.jDl7un/_new 2017-10-25 17:47:56.646224591 +0200
@@ -1,6 +1,6 @@
<servicedata>
<service name="tar_scm">
<param
name="url">https://github.com/openSUSE/osc-plugin-factory.git</param>
- <param
name="changesrevision">7529c3019446ec1027f3733a129dfc268e24f1e5</param>
+ <param
name="changesrevision">e3150a762613a75cc955903f00e59d47ed53f0f5</param>
</service>
</servicedata>
++++++ openSUSE-release-tools-20171024.737d39a.obscpio ->
openSUSE-release-tools-20171024.32d1a97.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/openSUSE-release-tools-20171024.737d39a/.dockerignore
new/openSUSE-release-tools-20171024.32d1a97/.dockerignore
--- old/openSUSE-release-tools-20171024.737d39a/.dockerignore 1970-01-01
01:00:00.000000000 +0100
+++ new/openSUSE-release-tools-20171024.32d1a97/.dockerignore 2017-10-25
01:17:25.000000000 +0200
@@ -0,0 +1 @@
+.open-build-service/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/openSUSE-release-tools-20171024.737d39a/.flake8
new/openSUSE-release-tools-20171024.32d1a97/.flake8
--- old/openSUSE-release-tools-20171024.737d39a/.flake8 2017-10-24
06:32:14.000000000 +0200
+++ new/openSUSE-release-tools-20171024.32d1a97/.flake8 2017-10-25
01:17:25.000000000 +0200
@@ -1,4 +1,4 @@
[flake8]
-exclude = abichecker, openqa, openqa-maintenance.py
+exclude = .open-build-service/, abichecker, openqa, openqa-maintenance.py
max-line-length = 100
-ignore =
E501,F401,E302,E228,E128,E251,E201,E202,E203,E305,F841,E265,E261,E266,E712,E401,E126,E502,E222,E241,E711,E226,E125,E123,W293,W391,E731,E101,E227,E713,E225,E124,E221,E127,E701,E714,W503,E129,E303
+ignore =
E501,F401,E302,E228,E128,E251,E201,E202,E203,E305,F841,E265,E261,E266,E712,E401,E126,E502,E222,E241,E711,E226,E125,E123,W293,W391,E731,E101,E227,E713,E225,E124,E221,E127,E701,E714,W503,E129,E303,E741,E722
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/openSUSE-release-tools-20171024.737d39a/.travis.yml
new/openSUSE-release-tools-20171024.32d1a97/.travis.yml
--- old/openSUSE-release-tools-20171024.737d39a/.travis.yml 2017-10-24
06:32:14.000000000 +0200
+++ new/openSUSE-release-tools-20171024.32d1a97/.travis.yml 2017-10-25
01:17:25.000000000 +0200
@@ -49,16 +49,26 @@
- flake8
- env: TEST_SUITE=nosetests
sudo: required
+ services:
+ - docker
language: python
python: 2.7
before_install:
# provides xmllint used by test_bootstrap_copy
(tests.freeze_tests.TestFreeze)
- sudo apt-get install libxml2-utils
install:
- # needed to install osc from git in requirements.txt
- - pip install pycurl urlgrabber
+ # urlgrabber needed to install osc from git in requirements.txt
+ # m2crypto for osc to be runable as used in docker-compose-obs
+ - pip install pycurl urlgrabber m2crypto
- pip install -r requirements.txt
- pip install python-coveralls
+ before_script:
+ # travis-ci/travis-ci#7008: stop services to make room for OBS setup
+ - sudo service mysql stop
+ - sudo service memcached stop
+ - ./dist/ci/docker-compose-obs
+ # Needs python prefix to use the correct interpretor.
+ - python ./obs_clone.py --cache --debug --apiurl-target local
script:
- nosetests --with-coverage --cover-package=. --cover-inclusive
after_success:
@@ -73,10 +83,13 @@
cache:
directories:
+ # obs_clone.py
+ - ~/.cache/osc-plugin-factory-clone
+ # distribution jobs `osc build`
- .docker-tmp
pip: true
# 7 days
timeout: 604800
before_cache:
- sudo rm -rf .docker-tmp/build-root
- - sudo chmod o+rw .docker-tmp
+ - sudo chmod -R o+rw .docker-tmp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/openSUSE-release-tools-20171024.737d39a/devel-project.py
new/openSUSE-release-tools-20171024.32d1a97/devel-project.py
--- old/openSUSE-release-tools-20171024.737d39a/devel-project.py
2017-10-24 06:32:14.000000000 +0200
+++ new/openSUSE-release-tools-20171024.32d1a97/devel-project.py
2017-10-25 01:17:25.000000000 +0200
@@ -41,7 +41,8 @@
devel_projects[devel.attrib['project']] = True
# Ensure self does not end up in list.
- del devel_projects[project]
+ if project in devel_projects:
+ del devel_projects[project]
return sorted(devel_projects)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/openSUSE-release-tools-20171024.737d39a/dist/ci/docker-compose-obs
new/openSUSE-release-tools-20171024.32d1a97/dist/ci/docker-compose-obs
--- old/openSUSE-release-tools-20171024.737d39a/dist/ci/docker-compose-obs
1970-01-01 01:00:00.000000000 +0100
+++ new/openSUSE-release-tools-20171024.32d1a97/dist/ci/docker-compose-obs
2017-10-25 01:17:25.000000000 +0200
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+set -e
+
+OBS_DIRECTORY=${OBS_DIRECTORY:-.open-build-service}
+
+if [ ! -d "$OBS_DIRECTORY" ] ; then
+ git clone --depth 1 https://github.com/openSUSE/open-build-service.git
"$OBS_DIRECTORY"
+
+ if [ ! -f ~/.oscrc ] ; then
+ # openSUSE/open-build-service#3946: would elevate the need, but rejected.
+ eval $(./dist/ci/osc-credentials-throwaway)
+ OBS_USER="$user" OBS_PASS="$pass" ./dist/ci/osc-init
+ fi
+
+cat <<EOF >> ~/.oscrc
+
+[http://0.0.0.0:3000]
+user = Admin
+pass = opensuse
+aliases = local
+EOF
+fi
+
+cd "$OBS_DIRECTORY"
+
+git pull origin master
+
+# https://github.com/openSUSE/open-build-service/blob/master/CONTRIBUTING.md
+git submodule init
+git submodule update
+
+rake docker:build
+
+# See `docker-compose logs` instead of changing output redirection.
+docker-compose up -d --remove-orphans
+
+osc='osc'
+if ! which osc &> /dev/null ; then
+ # Workaround for pip install that occurs on travis.
+ osc='osc-wrapper.py'
+fi
+
+until $osc -q -A local api /about 2> /dev/null ; do
+ echo "waiting for OBS to be responsive..."
+ ((c++)) && ((c==60)) && docker-compose logs && exit 1
+ sleep 1
+done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/openSUSE-release-tools-20171024.737d39a/dist/package/openSUSE-release-tools.spec
new/openSUSE-release-tools-20171024.32d1a97/dist/package/openSUSE-release-tools.spec
---
old/openSUSE-release-tools-20171024.737d39a/dist/package/openSUSE-release-tools.spec
2017-10-24 06:32:14.000000000 +0200
+++
new/openSUSE-release-tools-20171024.32d1a97/dist/package/openSUSE-release-tools.spec
2017-10-25 01:17:25.000000000 +0200
@@ -251,7 +251,8 @@
%check
%if 0%{?is_opensuse}
-make check
+# TODO openSUSE/osc-plugin-factory#1221: decide how to handle integration tests
+# make check
%endif
%install
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/openSUSE-release-tools-20171024.737d39a/obs_clone.py
new/openSUSE-release-tools-20171024.32d1a97/obs_clone.py
--- old/openSUSE-release-tools-20171024.737d39a/obs_clone.py 1970-01-01
01:00:00.000000000 +0100
+++ new/openSUSE-release-tools-20171024.32d1a97/obs_clone.py 2017-10-25
01:17:25.000000000 +0200
@@ -0,0 +1,190 @@
+#!/usr/bin/python
+
+from copy import deepcopy
+from lxml import etree as ET
+from osc.core import copy_pac as copy_package
+from osc.core import get_commitlog
+from osc.core import http_GET
+from osc.core import http_POST
+from osc.core import http_PUT
+from osc.core import makeurl
+from osc.core import show_upstream_rev
+from urllib2 import HTTPError
+import argparse
+import osc.conf
+import sys
+
+
+def project_fence(project):
+ if ((project.startswith('openSUSE:') and
project_fence.project.startswith('openSUSE:')) and
+ not project.startswith(project_fence.project)):
+ # Exclude other openSUSE:* projects while cloning a specifc one.
+ return False
+ if project.startswith('openSUSE:Factory:ARM'):
+ # Troublesome.
+ return False
+ # Perhaps use devel project list as filter, but for now quick exclude.
+ if project.startswith('SUSE:') or project.startswith('Ubuntu:'):
+ return False
+
+ return True
+
+def entity_clone(apiurl_source, apiurl_target, path, sanitize=None,
clone=None, after=None):
+ if not hasattr(entity_clone, 'cloned'):
+ entity_clone.cloned = []
+
+ if path[0] == 'source' and not project_fence(path[1]):
+ # Skip projects outside of fence by marking as cloned.
+ if path not in entity_clone.cloned:
+ entity_clone.cloned.append(path)
+
+ if path in entity_clone.cloned:
+ print('skip {}'.format('/'.join(path)))
+ return
+
+ print('clone {}'.format('/'.join(path)))
+ entity_clone.cloned.append(path)
+
+ url = makeurl(apiurl_source, path)
+ entity = ET.parse(http_GET(url)).getroot()
+
+ if sanitize:
+ sanitize(entity)
+ if clone:
+ clone(apiurl_source, apiurl_target, entity)
+
+ url = makeurl(apiurl_target, path)
+ http_PUT(url, data=ET.tostring(entity))
+
+ if after:
+ after(apiurl_source, apiurl_target, entity)
+
+def users_clone(apiurl_source, apiurl_target, entity):
+ for person in entity.findall('person'):
+ path = ['person', person.get('userid')]
+ entity_clone(apiurl_source, apiurl_target, path, person_sanitize,
after=person_clone_after)
+
+ for group in entity.findall('group'):
+ path = ['group', group.get('groupid')]
+ entity_clone(apiurl_source, apiurl_target, path, clone=group_clone)
+
+def project_repositories_remove(project):
+ # Remove repositories that reference other projects.
+ for repository in project.xpath('repository[releasetarget or path]'):
+ repository.getparent().remove(repository)
+
+# clone(Factory)
+# - stripped
+# - after
+# - clone(Factory:ToTest)
+# - stripped
+# - after
+# - clone(Factory)...skip
+# - write real
+# - write real
+def project_clone(apiurl_source, apiurl_target, project):
+ users_clone(apiurl_source, apiurl_target, project)
+
+ # Write stripped version that does not include repos with path references.
+ url = makeurl(apiurl_target, ['source', project.get('name'), '_meta'])
+ stripped = deepcopy(project)
+ project_repositories_remove(stripped)
+ http_PUT(url, data=ET.tostring(stripped))
+
+ # Clone projects referenced in repository paths.
+ for repository in project.findall('repository'):
+ for target in repository.xpath('./path') +
repository.xpath('./releasetarget'):
+ if not project_fence(target.get('project')):
+ project.remove(repository)
+ break
+
+ # Valid reference to project and thus should be cloned.
+ path = ['source', target.get('project'), '_meta']
+ entity_clone(apiurl_source, apiurl_target, path,
clone=project_clone)
+
+def package_clone(apiurl_source, apiurl_target, package):
+ # Clone project that contains the package.
+ path = ['source', package.get('project'), '_meta']
+ entity_clone(apiurl_source, apiurl_target, path, clone=project_clone)
+
+ # Clone the dependencies of package.
+ users_clone(apiurl_source, apiurl_target, package)
+
+ # Clone devel project referenced by package.
+ devel = package.find('devel')
+ if devel is not None:
+ path = ['source', devel.get('project'), devel.get('package'), '_meta']
+ entity_clone(apiurl_source, apiurl_target, path, clone=package_clone,
after=package_clone_after)
+
+def package_clone_after(apiurl_source, apiurl_target, package):
+ copy_package(apiurl_source, package.get('project'), package.get('name'),
+ apiurl_target, package.get('project'), package.get('name'),
+ # TODO Would be preferable to preserve links, but need to
+ # recreat them since they do not match with copied package.
+ expand=True,
+ # TODO Can copy server-side if inner-connect is setup, but not
+ # clear how to trigger the equivalent of save in admin UI.
+ client_side_copy=True)
+
+def person_sanitize(person):
+ person.find('email').text = person.find('email').text.split('@')[0] +
'@example.com'
+
+def person_clone_after(apiurl_source, apiurl_target, person):
+ url = makeurl(apiurl_target, ['person', person.find('login').text],
{'cmd': 'change_password'})
+ http_POST(url, data='opensuse')
+
+def group_clone(apiurl_source, apiurl_target, group):
+ for person in group.findall('maintainer') + group.findall('person/person'):
+ path = ['person', person.get('userid')]
+ entity_clone(apiurl_source, apiurl_target, path, person_sanitize,
after=person_clone_after)
+
+def clone_do(apiurl_source, apiurl_target, project):
+ print('clone {} from {} to {}'.format(project, apiurl_source,
apiurl_target))
+
+ try:
+ # TODO Decide how to choose what to clone via args.
+ entity_clone(apiurl_source, apiurl_target, ['source', project +
':Staging', 'dashboard', '_meta'],
+ clone=package_clone, after=package_clone_after)
+
+ entity_clone(apiurl_source, apiurl_target, ['source', project,
'drush', '_meta'],
+ clone=package_clone, after=package_clone_after)
+
+ entity_clone(apiurl_source, apiurl_target, ['group',
'opensuse-review-team'],
+ clone=group_clone)
+ except HTTPError as e:
+ # Print full output for any errors since message can be cryptic.
+ print(e.read())
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(description='Clone projects and
dependencies between OBS instances.')
+ parser.set_defaults(func=clone_do)
+
+ parser.add_argument('-S', '--apiurl-source', metavar='URL', help='source
API URL')
+ parser.add_argument('-T', '--apiurl-target', metavar='URL', help='target
API URL')
+ parser.add_argument('-c', '--cache', action='store_true', help='cache
source queries for 24 hours')
+ parser.add_argument('-d', '--debug', action='store_true', help='print info
useful for debuging')
+ parser.add_argument('-p', '--project', default='openSUSE:Factory',
help='project from which to clone')
+
+ args = parser.parse_args()
+
+ osc.conf.get_config(override_apiurl=args.apiurl_target)
+ apiurl_target = osc.conf.config['apiurl']
+ osc.conf.get_config(override_apiurl=args.apiurl_source)
+ apiurl_source = osc.conf.config['apiurl']
+
+ if apiurl_target == apiurl_source:
+ print('target APIURL must not be the same as source APIURL')
+ sys.exit(1)
+
+ if args.cache:
+ from osclib.cache import Cache
+ Cache.CACHE_DIR = Cache.CACHE_DIR + '-clone'
+ Cache.PATTERNS = {}
+ # Prevent caching source information from local clone.
+ Cache.PATTERNS['/source/[^/]+/[^/]+/[^/]+?rev'] = 0
+ Cache.PATTERNS['.*'] = Cache.TTL_LONG * 2
+ Cache.init()
+
+ osc.conf.config['debug'] = args.debug
+ project_fence.project = args.project
+ sys.exit(args.func(apiurl_source, apiurl_target, args.project))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/openSUSE-release-tools-20171024.737d39a/osclib/cache.py
new/openSUSE-release-tools-20171024.32d1a97/osclib/cache.py
--- old/openSUSE-release-tools-20171024.737d39a/osclib/cache.py 2017-10-24
06:32:14.000000000 +0200
+++ new/openSUSE-release-tools-20171024.32d1a97/osclib/cache.py 2017-10-25
01:17:25.000000000 +0200
@@ -167,6 +167,9 @@
match, project = Cache.match(url)
if match:
path = Cache.path(url, project, include_file=True, makedirs=True)
+ ttl = Cache.PATTERNS[match]
+ if ttl == 0:
+ return data
# Since urlopen does not return a seekable stream it cannot be
reset
# after writing to cache. As such a wrapper must be used. This
could
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/openSUSE-release-tools-20171024.737d39a/osclib/conf.py
new/openSUSE-release-tools-20171024.32d1a97/osclib/conf.py
--- old/openSUSE-release-tools-20171024.737d39a/osclib/conf.py 2017-10-24
06:32:14.000000000 +0200
+++ new/openSUSE-release-tools-20171024.32d1a97/osclib/conf.py 2017-10-25
01:17:25.000000000 +0200
@@ -125,7 +125,7 @@
def __init__(self, project):
self.project = project
- conf_file = os.environ.get('OSC_CONFIG', '~/.oscrc')
+ conf_file = conf.config.get('conffile', os.environ.get('OSC_CONFIG',
'~/.oscrc'))
self.conf_file = os.path.expanduser(conf_file)
self.remote_values = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/openSUSE-release-tools-20171024.737d39a/tests/OBSLocal.py
new/openSUSE-release-tools-20171024.32d1a97/tests/OBSLocal.py
--- old/openSUSE-release-tools-20171024.737d39a/tests/OBSLocal.py
1970-01-01 01:00:00.000000000 +0100
+++ new/openSUSE-release-tools-20171024.32d1a97/tests/OBSLocal.py
2017-10-25 01:17:25.000000000 +0200
@@ -0,0 +1,96 @@
+import os
+from lxml import etree as ET
+from osc import conf
+from osc.core import get_request
+from osc.core import http_GET
+from osc.core import makeurl
+import subprocess
+import unittest
+
+OSCRC = os.path.expanduser('~/.oscrc-test')
+APIURL = 'local-test'
+
+class OBSLocalTestCase(unittest.TestCase):
+ script = None
+ script_apiurl = True
+ script_debug = True
+ script_debug_osc = True
+
+ @classmethod
+ def setUpClass(cls):
+ # TODO #1214: Workaround for tests/obs.py's lack of cleanup.
+ import httpretty
+ httpretty.disable()
+
+ def setUp(self):
+ self.oscrc('Admin')
+ conf.get_config(override_conffile=OSCRC,
+ override_no_keyring=True,
+ override_no_gnome_keyring=True)
+ self.apiurl = conf.config['apiurl']
+ self.assertOBS()
+
+ def assertOBS(self):
+ url = makeurl(self.apiurl, ['about'])
+ root = ET.parse(http_GET(url)).getroot()
+ self.assertEqual(root.tag, 'about')
+
+ @staticmethod
+ def oscrc(userid):
+ with open(OSCRC, 'w+') as f:
+ f.write('\n'.join([
+ '[general]',
+ 'apiurl = http://0.0.0.0:3000',
+ '[http://0.0.0.0:3000]',
+ 'user = {}'.format(userid),
+ 'pass = opensuse',
+ 'email = {}@example.com'.format(userid),
+ 'aliases = {}'.format(APIURL),
+ '',
+ ]))
+
+ def osc_user(self, userid):
+ conf.config['api_host_options'][self.apiurl]['user'] = userid
+ self.oscrc(userid)
+
+ def execute_script(self, args):
+ if self.script:
+ args.insert(0, self.script)
+ if self.script_debug:
+ args.insert(1, '--debug')
+ if self.script_debug_osc:
+ args.insert(1, '--osc-debug')
+ args.insert(0, '-p')
+ args.insert(0, 'run')
+ args.insert(0, 'coverage')
+
+ self.execute(args)
+
+ def execute_osc(self, args):
+ # The wrapper allows this to work properly when osc installed via pip.
+ args.insert(0, 'osc-wrapper.py')
+ self.execute(args)
+
+ def execute(self, args):
+ print('$ ' + ' '.join(args)) # Print command for debugging.
+ try:
+ env = os.environ
+ env['OSC_CONFIG'] = OSCRC
+ self.output = subprocess.check_output(args,
stderr=subprocess.STDOUT, env=env)
+ except subprocess.CalledProcessError as e:
+ print(e.output)
+ raise e
+ print(self.output) # For debugging assertion failures.
+
+ def assertOutput(self, string):
+ self.assertTrue(string in self.output, '[MISSING] ' + string)
+
+ def assertReview(self, rid, **kwargs):
+ request = get_request(self.apiurl, rid)
+ for review in request.reviews:
+ for key, value in kwargs.items():
+ if hasattr(review, key) and getattr(review, key) == value[0]:
+ self.assertEqual(review.state, value[1], '{}={} not
{}'.format(key, value[0], value[1]))
+ return
+
+ self.fail('{} not found'.format(kwargs))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/openSUSE-release-tools-20171024.737d39a/tests/devel_project_tests.py
new/openSUSE-release-tools-20171024.32d1a97/tests/devel_project_tests.py
--- old/openSUSE-release-tools-20171024.737d39a/tests/devel_project_tests.py
1970-01-01 01:00:00.000000000 +0100
+++ new/openSUSE-release-tools-20171024.32d1a97/tests/devel_project_tests.py
2017-10-25 01:17:25.000000000 +0200
@@ -0,0 +1,21 @@
+from OBSLocal import OBSLocalTestCase
+import unittest
+
+
+class TestDevelProject(OBSLocalTestCase):
+ script = './devel-project.py'
+ script_debug_osc = False
+
+ def test_list(self):
+ self.osc_user('staging-bot')
+ self.execute_script(['list', '--write'])
+ self.assertOutput('server:php:applications')
+ # TODO Assert --write worked and in file.
+
+ def test_reviews(self):
+ self.osc_user('staging-bot')
+ self.execute_script(['reviews'])
+
+ def test_requests(self):
+ self.osc_user('staging-bot')
+ self.execute_script(['requests'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/openSUSE-release-tools-20171024.737d39a/tests/obs.py
new/openSUSE-release-tools-20171024.32d1a97/tests/obs.py
--- old/openSUSE-release-tools-20171024.737d39a/tests/obs.py 2017-10-24
06:32:14.000000000 +0200
+++ new/openSUSE-release-tools-20171024.32d1a97/tests/obs.py 2017-10-25
01:17:25.000000000 +0200
@@ -111,7 +111,6 @@
if not OBS._self:
OBS._self = super(OBS, cls).__new__(cls, *args, **kwargs)
- Cache.delete_all()
httpretty.reset()
httpretty.enable()
@@ -129,13 +128,13 @@
if not hasattr(Cache, '_CACHE_DIR'):
Cache._CACHE_DIR = True
Cache.CACHE_DIR += '-test'
+ Cache.delete_all()
httpretty.enable()
oscrc = os.path.join(fixtures, 'oscrc')
osc.core.conf.get_config(override_conffile=oscrc,
override_no_keyring=True,
override_no_gnome_keyring=True)
- os.environ['OSC_CONFIG'] = oscrc
# Internal status of OBS. The mockup will use this data to
# build the responses. We will try to put responses as XML
++++++ openSUSE-release-tools.obsinfo ++++++
--- /var/tmp/diff_new_pack.jDl7un/_old 2017-10-25 17:47:57.370190612 +0200
+++ /var/tmp/diff_new_pack.jDl7un/_new 2017-10-25 17:47:57.370190612 +0200
@@ -1,5 +1,5 @@
name: openSUSE-release-tools
-version: 20171024.737d39a
-mtime: 1508819534
-commit: 737d39a1db0a2718b4d50d34d6e7d0cbd2cb08f6
+version: 20171024.32d1a97
+mtime: 1508887045
+commit: 32d1a97241a6437d1233cdc7584bd8d508082581