Fix CI failures
This change fixes a few CI failures in the zuul-operator * nox docs: the regex expression wasn't accepted * version.py was broken because pkg_resources is removed from newer pythons * the /api/tenants endpoint no longer appears to return projects or queue items so the functional test was failing Change-Id: Ia492fa48ff682454553d9c1b04d4e83b40a276cf
This commit is contained in:
parent
3cff35ce48
commit
c1febff1ea
@ -85,7 +85,7 @@ except subprocess.CalledProcessError:
|
|||||||
|
|
||||||
interesting_tags = []
|
interesting_tags = []
|
||||||
for tag in output.splitlines():
|
for tag in output.splitlines():
|
||||||
if re.match('^\d+\.\d+\.\d+$', tag):
|
if re.match(r'^\d+\.\d+\.\d+$', tag):
|
||||||
parts = tuple(map(int, tag.split('.')))
|
parts = tuple(map(int, tag.split('.')))
|
||||||
if parts < min_version:
|
if parts < min_version:
|
||||||
continue
|
continue
|
||||||
|
@ -44,8 +44,6 @@
|
|||||||
endpoint: "/api/tenants"
|
endpoint: "/api/tenants"
|
||||||
expected:
|
expected:
|
||||||
- name: local
|
- name: local
|
||||||
projects: 1
|
|
||||||
queue: 0
|
|
||||||
|
|
||||||
- name: setup git service
|
- name: setup git service
|
||||||
include_tasks: tasks/git_setup.yaml
|
include_tasks: tasks/git_setup.yaml
|
||||||
@ -124,17 +122,6 @@
|
|||||||
path: /run/dbus
|
path: /run/dbus
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
|
|
||||||
- name: ensure a job is running
|
|
||||||
when: skip_check is not defined
|
|
||||||
include_tasks: tasks/zuul_web_check.yaml
|
|
||||||
vars:
|
|
||||||
endpoint: "/api/tenants"
|
|
||||||
expected:
|
|
||||||
- name: local
|
|
||||||
projects: 1
|
|
||||||
# 1 queue means a job is running
|
|
||||||
queue: 1
|
|
||||||
|
|
||||||
- name: get build results
|
- name: get build results
|
||||||
uri:
|
uri:
|
||||||
url: "{{ zuul_web_url }}/api/tenant/local/builds?complete=true"
|
url: "{{ zuul_web_url }}/api/tenant/local/builds?complete=true"
|
||||||
|
@ -24,8 +24,8 @@ class ZuulOperatorCommand:
|
|||||||
self.op = ZuulOperator()
|
self.op = ZuulOperator()
|
||||||
|
|
||||||
def _get_version(self):
|
def _get_version(self):
|
||||||
from zuul_operator.version import version_info as version_info
|
from zuul_operator.version import release_string
|
||||||
return "Zuul Operator version: %s" % version_info.release_string()
|
return "Zuul Operator version: %s" % release_string
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
|
@ -15,18 +15,15 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import pbr.version
|
from importlib import metadata as importlib_metadata
|
||||||
import pkg_resources
|
|
||||||
|
|
||||||
version_info = pbr.version.VersionInfo('zuul-operator')
|
zuul_operator_distribution = importlib_metadata.distribution('zuul-operator')
|
||||||
release_string = version_info.release_string()
|
release_string = zuul_operator_distribution.version
|
||||||
|
|
||||||
is_release = None
|
is_release = None
|
||||||
git_version = None
|
git_version = None
|
||||||
try:
|
try:
|
||||||
_metadata = json.loads(
|
_metadata = json.loads(zuul_operator_distribution.read_text('pbr.json'))
|
||||||
pkg_resources.get_distribution(
|
|
||||||
'zuul-operator').get_metadata('pbr.json'))
|
|
||||||
if _metadata:
|
if _metadata:
|
||||||
is_release = _metadata['is_release']
|
is_release = _metadata['is_release']
|
||||||
git_version = _metadata['git_version']
|
git_version = _metadata['git_version']
|
||||||
|
Loading…
Reference in New Issue
Block a user