Compare commits

...

5 Commits

Author SHA1 Message Date
f5daf72598 fix: fix update_zuul_project_config script
Some checks failed
gl/check check status: failure (f5daf72598bf21c778b82cd454f8790cfbcb6839)
Some of the previous changes broken update_zuul_project_config part of
the script responsible for verifying required zuul template is present.
It is verifying that, but mistankengly not raising a flag that update is
required.
2023-04-04 12:02:53 +02:00
82d841953a Setting the visibility on new services to be only visible on PREPROD
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-03-28 07:37:51 +00:00
30851dd5df Enterprise router addon
Reviewed-by: vladimirhasko <vladimirhasko@gmail.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-03-26 18:01:24 +00:00
4989570371 Add some basic unittests for metadata sanity
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
2023-03-26 17:51:23 +00:00
a7a4f676e0 adding new dbss service metadata
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-03-26 17:31:00 +00:00
6 changed files with 126 additions and 6 deletions

File diff suppressed because it is too large Load Diff

View File

@ -21,8 +21,45 @@ Tests for `otc-metadata` module.
from unittest import TestCase from unittest import TestCase
from otc_metadata import services
class TestOtcMetadata(TestCase): class TestOtcMetadata(TestCase):
def setUp(self):
self.data = services.Services()
def test_something(self): def test_data_is_sorted(self):
pass curr = self.data
new = services.Services()
new._sort_data()
self.assertEqual(
curr._service_data, new._service_data, "Data is sorted properly"
)
def test_service_categories(self):
category = dict()
for cat in self.data._service_data["service_categories"]:
category[cat["name"]] = cat["title"]
for srv in self.data.all_services:
self.assertTrue(
srv["service_category"] in category,
f"Category {srv['service_category']} is present",
)
def test_doc_contains_required_data(self):
srv_types = dict()
for srv in self.data.all_services:
srv_types[srv["service_type"]] = srv
for doc in self.data.all_docs:
for attr in [
"rst_location",
"service_type",
"title",
"type",
]:
self.assertIn(attr, doc, f"Document {doc} contains {attr}")
self.assertIn(
doc["service_type"],
srv_types,
f"Document {doc} contains valid service_type",
)

View File

@ -4,4 +4,4 @@
stestr>=2.0.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
flake8 flake8>=6.0

View File

@ -149,8 +149,9 @@ def process_repositories(args, service):
"-hc-int-jobs" if args.environment == "internal" else "-hc-jobs" "-hc-int-jobs" if args.environment == "internal" else "-hc-jobs"
) )
for doc in data.docs_by_service_type(service["service_type"]): for doc in data.docs_by_service_type(service["service_type"]):
logging.debug(f"Analyzing document {doc}") logging.info("Analyzing document %s" % doc)
if not doc.get("type"): if not doc.get("type"):
logging.debug("Skipping unsupported type")
continue continue
if doc["type"] == "dev": if doc["type"] == "dev":
doc_type = "dev-guide" doc_type = "dev-guide"
@ -158,7 +159,11 @@ def process_repositories(args, service):
doc_type = doc["type"] doc_type = doc["type"]
template_name = f"{doc_type}{job_suffix}" template_name = f"{doc_type}{job_suffix}"
if doc_type in ["api-ref", "umn", "dev-guide"]: if doc_type in ["api-ref", "umn", "dev-guide"]:
logging.debug(
"Ensuring required zuul template %s is present" % template_name)
if template_name not in zuul_templates: if template_name not in zuul_templates:
logging.debug("Adding template %s" % template_name)
zuul_config_updated = True
zuul_templates.append(template_name) zuul_templates.append(template_name)
else: else:
job_name = f"build-otc-{doc['service_type']}-{doc_type}" job_name = f"build-otc-{doc['service_type']}-{doc_type}"
@ -245,6 +250,8 @@ def process_repositories(args, service):
head=branch_name, head=branch_name,
), ),
) )
else:
logging.info("No update is necessary")
def main(): def main():

View File

@ -19,7 +19,6 @@ commands = {posargs}
[flake8] [flake8]
# E123, E125 skipped as they are invalid PEP-8. # E123, E125 skipped as they are invalid PEP-8.
show-source = True show-source = True
ignore = E123,E125,W503 ignore = E123,E125,W503
builtins = _ builtins = _

View File

@ -1,3 +1,4 @@
---
- project: - project:
merge-mode: squash-merge merge-mode: squash-merge
default-branch: main default-branch: main
@ -8,4 +9,4 @@
gate: gate:
jobs: jobs:
- otc-tox-pep8 - otc-tox-pep8
- otc-tox-py39 - otc-tox-py39