Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming 'tests' to 'runs' in the schema (#30) #40

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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', []):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inherit function has a couple of test variable. Should that be changed to run?

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