From 74cf6509a0ed35b42f8e1d513524200047a7a5a8 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 12 Oct 2022 14:45:10 -0700 Subject: [PATCH 2/3] Update the schema for facts and migration-results in integration tests for the recent changes to breadcrumb format. --- .../artifacts/c2r_facts_schema.json | 137 ++++++++++-------- .../c2r_migration_results_schema.json | 86 +++++++++-- 2 files changed, 150 insertions(+), 73 deletions(-) diff --git a/tests/integration/tier1/checks-after-conversion/artifacts/c2r_facts_schema.json b/tests/integration/tier1/checks-after-conversion/artifacts/c2r_facts_schema.json index d9333c3..c2530a8 100644 --- a/tests/integration/tier1/checks-after-conversion/artifacts/c2r_facts_schema.json +++ b/tests/integration/tier1/checks-after-conversion/artifacts/c2r_facts_schema.json @@ -1,68 +1,79 @@ { - "$schema": "http://json-schema.org/draft-06/schema#", - "$ref": "#/definitions/Welcome1", - "title": "RHSM custom facts migrations file schema v1", + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://github.com/oamg/convert2rhel/c2r-facts-schema-1.0.json", + "title": "RHSM custom facts migrations file schema v1.0", "type": "object", - "definitions": { - "root": { - "type": "object", - "additionalProperties": false, - "properties": { - "convert2rhel.version": { - "type": "string", - "format": "integer" - }, - "convert2rhel.activity": { - "type": "string" - }, - "convert2rhel.packages.0.nevra": { - "type": "string" - }, - "convert2rhel.packages.0.signature": { - "type": "string" - }, - "convert2rhel.executed": { - "type": "string" - }, - "convert2rhel.success": { - "type": "boolean" - }, - "convert2rhel.activity_started": { - "type": "string", - "format": "date-time" - }, - "convert2rhel.activity_ended": { - "type": "string", - "format": "date-time" - }, - "convert2rhel.source_os": { - "type": "string" - }, - "convert2rhel.target_os": { - "type": "string" - }, - "convert2rhel.env": { - "type": "string" - }, - "convert2rhel.run_id": { - "type": "string" - } - }, - "required": [ - "convert2rhel.activity", - "convert2rhel.activity_ended", - "convert2rhel.activity_started", - "convert2rhel.env", - "convert2rhel.executed", - "convert2rhel.packages.0.nevra", - "convert2rhel.packages.0.signature", - "convert2rhel.run_id", - "convert2rhel.source_os", - "convert2rhel.success", - "convert2rhel.target_os", - "convert2rhel.version" - ], - "title": "root" + "required": [ + "conversions.activity", + "conversions.activity_ended", + "conversions.activity_started", + "conversions.env", + "conversions.executed", + "conversions.packages.0.nevra", + "conversions.packages.0.signature", + "conversions.run_id", + "conversions.source_os.id", + "conversions.source_os.name", + "conversions.source_os.version", + "conversions.success", + "conversions.target_os.id", + "conversions.target_os.name", + "conversions.target_os.version", + "conversions.version" + ], + "additionalProperties": false, + "properties": { + "conversions.version": { + "type": "string", + "format": "integer" + }, + "conversions.activity": { + "type": "string" + }, + "conversions.packages.0.nevra": { + "type": "string" + }, + "conversions.packages.0.signature": { + "type": "string" + }, + "conversions.executed": { + "type": "string" + }, + "conversions.success": { + "type": "boolean" + }, + "conversions.activity_started": { + "type": "string", + "format": "date-time" + }, + "conversions.activity_ended": { + "type": "string", + "format": "date-time" + }, + "conversions.source_os.id": { + "type": "string" + }, + "conversions.source_os.name": { + "type": "string" + }, + "conversions.source_os.version": { + "type": "string" + }, + "conversions.target_os.id": { + "type": "string" + }, + "conversions.target_os.name": { + "type": "string" + }, + "conversions.target_os.version": { + "type": "string" + }, + "conversions.env": { + "type": "string" + }, + "conversions.run_id": { + "type": "string" } } } diff --git a/tests/integration/tier1/checks-after-conversion/artifacts/c2r_migration_results_schema.json b/tests/integration/tier1/checks-after-conversion/artifacts/c2r_migration_results_schema.json index a77bc8b..75ac174 100644 --- a/tests/integration/tier1/checks-after-conversion/artifacts/c2r_migration_results_schema.json +++ b/tests/integration/tier1/checks-after-conversion/artifacts/c2r_migration_results_schema.json @@ -1,7 +1,7 @@ { "definitions": {}, "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://example.com/object1628676489.json", + "$id": "https://github.com/oamg/convert2rhel/c2r-migration-results-schema-1.json", "title": "Migrations file schema v1", "type": "object", "required": [ @@ -113,18 +113,84 @@ "source_os": { "$id": "#root/activities/items/source_os", "description": "Source operating system where the activity was started", - "type": "string", - "examples": [ - "Red Hat Enterprise Linux 7.9" - ] + "type": "object", + "required": [ + "id", + "name", + "version" + ], + "properties": { + "id": { + "$id": "#/root/activities/items/source_os/id", + "description": "Id of the source operating system release. It will be the string 'null' if no id is present.", + "type": "string", + "examples": [ + "Final", + "Core", + "null" + ] + }, + "name": { + "$id": "#/root/activities/items/source_os/name", + "description": "Name of the source operating system.", + "type": "string", + "examples": [ + "Oracle Linux Server", + "CentOS Linux" + ] + }, + "version": { + "$id": "#/root/activities/items/source_os/version", + "description": "Version of the source operating system release. Only the Major and, if provided, minor. CentOS build number is not included.", + "type": "string", + "examples": [ + "7.8", + "8.1" + ] + } + } }, "target_os": { "$id": "#root/activities/items/target_os", - "description": "Target operating system where the migration ended", - "type": "string", - "examples": [ - "Red Hat Enterprise Linux 8.3" - ] + "description": "Target operating system that the activity converts to.", + "type": [ + "object", + "string" + ], + "pattern": "null", + "required": [ + "id", + "name", + "version" + ], + "properties": { + "id": { + "$id": "#/root/activities/items/target_os/id", + "description": "Id of the target operating system release. It will be the string 'null' if no id is present.", + "type": "string", + "examples": [ + "Ootpa", + "null" + ] + }, + "name": { + "$id": "#/root/activities/items/target_os/name", + "description": "Name of the target operating system.", + "type": "string", + "examples": [ + "Red Hat Enterprise Linux" + ] + }, + "version": { + "$id": "#/root/activities/items/target_os/version", + "description": "Version of the target operating system release.", + "type": "string", + "examples": [ + "7.8", + "8.1" + ] + } + } }, "env": { "$id": "#root/activities/items/env", -- 2.37.3