Skip to content

Commit

Permalink
Renaming 'tests' to 'runs' in the schema (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbazzan committed Nov 4, 2021
1 parent 30d145e commit 11c9b35
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions kcidb_io/schema/test_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_origin(self):
dict(revision_id="origin1:5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
id="origin3:2"),
],
tests=[
runs=[
dict(build_id="origin2:1", id="origin4:1-1"),
dict(build_id="origin2:1", id="origin5:1-2"),
dict(build_id="origin3:2", id="origin6:2-1"),
Expand All @@ -52,7 +52,7 @@ def test_origin(self):
id="origin3:2",
origin="origin3"),
],
tests=[
runs=[
dict(build_id="origin2:1", id="origin4:1-1", origin="origin4"),
dict(build_id="origin2:1", id="origin5:1-2", origin="origin5"),
dict(build_id="origin3:2", id="origin6:2-1", origin="origin6"),
Expand Down
8 changes: 4 additions & 4 deletions kcidb_io/schema/test_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_upgrade(self):
id="origin2:2",
origin="origin2"),
],
tests=[
runs=[
dict(build_id="origin1:1", id="origin4:1-1", origin="origin4"),
dict(build_id="origin1:1", id="origin5:1-2", origin="origin5"),
dict(build_id="origin2:2", id="origin6:2-1", origin="origin6"),
Expand Down Expand Up @@ -72,7 +72,7 @@ def test_upgrade(self):
id="origin2:2",
origin="origin2"),
],
tests=[
runs=[
dict(build_id="origin1:1", id="origin4:1-1", origin="origin4"),
dict(build_id="origin1:1", id="origin5:1-2", origin="origin5"),
dict(build_id="origin2:2", id="origin6:2-1", origin="origin6"),
Expand Down Expand Up @@ -238,7 +238,7 @@ def test_description_to_comment_rename(self):
id="origin3:2",
origin="origin3"),
],
tests=[
runs=[
dict(build_id="origin2:1", id="origin4:1-1", origin="origin4",
description="A test with a comment"),
dict(build_id="origin2:1", id="origin5:1-2", origin="origin5"),
Expand Down Expand Up @@ -270,7 +270,7 @@ def test_description_to_comment_rename(self):
id="origin3:2",
origin="origin3"),
],
tests=[
runs=[
dict(build_id="origin2:1", id="origin4:1-1", origin="origin4",
comment="A test with a comment"),
dict(build_id="origin2:1", id="origin5:1-2", origin="origin5"),
Expand Down
10 changes: 5 additions & 5 deletions kcidb_io/schema/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@
},

# A test run on a build
"test": {
"title": "test",
"run": {
"title": "test run",
"description":
"A test run against a build.\n"
"\n"
Expand Down Expand Up @@ -545,10 +545,10 @@
"type": "array",
"items": {"$ref": "#/$defs/build"},
},
"tests": {
"runs": {
"description": "List of test runs",
"type": "array",
"items": {"$ref": "#/$defs/test"},
"items": {"$ref": "#/$defs/run"},
},
},
"additionalProperties": False,
Expand Down Expand Up @@ -594,7 +594,7 @@ def get_version(data):
"": ["revisions"],
"revisions": ["builds"],
"builds": ["tests"],
"tests": []
"runs": []
}

VERSION = Version(JSON_VERSION_MAJOR, JSON_VERSION_MINOR, JSON, TREE,
Expand Down
8 changes: 4 additions & 4 deletions kcidb_io/schema/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@
},

# A test run on a build
"test": {
"title": "test",
"run": {
"title": "test run",
"description":
"A test run against a build.\n"
"\n"
Expand Down Expand Up @@ -516,10 +516,10 @@
"type": "array",
"items": {"$ref": "#/$defs/build"},
},
"tests": {
"runs": {
"description": "List of test runs",
"type": "array",
"items": {"$ref": "#/$defs/test"}
"items": {"$ref": "#/$defs/run"}
},
},
"additionalProperties": False,
Expand Down
8 changes: 4 additions & 4 deletions kcidb_io/schema/v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@
},

# A test run on a build
"test": {
"title": "test",
"run": {
"title": "test run",
"description":
"A test run against a build.\n"
"\n"
Expand Down Expand Up @@ -602,10 +602,10 @@
"type": "array",
"items": {"$ref": "#/$defs/build"},
},
"tests": {
"runs": {
"description": "List of test runs",
"type": "array",
"items": {"$ref": "#/$defs/test"},
"items": {"$ref": "#/$defs/run"},
},
},
"additionalProperties": False,
Expand Down
12 changes: 6 additions & 6 deletions kcidb_io/schema/v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@
},

# A test run on a build
"test": {
"title": "test",
"run": {
"title": "test run",
"description":
"A test run against a build.\n"
"\n"
Expand Down Expand Up @@ -670,10 +670,10 @@
"type": "array",
"items": {"$ref": "#/$defs/build"},
},
"tests": {
"runs": {
"description": "List of test runs",
"type": "array",
"items": {"$ref": "#/$defs/test"},
"items": {"$ref": "#/$defs/run"},
},
},
"additionalProperties": False,
Expand Down Expand Up @@ -735,7 +735,7 @@ def inherit(data):
build['comment'] = build.pop('description')

# Inherit tests
for test in data.get('tests', []):
for test in data.get('runs', []):
# Rename 'description' to 'comment'
if 'description' in test:
test['comment'] = test.pop('description')
Expand All @@ -757,7 +757,7 @@ def inherit(data):
"": ["checkouts"],
"checkouts": ["builds"],
"builds": ["tests"],
"tests": []
"runs": []
}

VERSION = Version(JSON_VERSION_MAJOR, JSON_VERSION_MINOR, JSON,
Expand Down

0 comments on commit 11c9b35

Please sign in to comment.