Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit e130004

Browse files
authored
Remove unnecessary confidence level waiting (#18)
* Remove unnecessary confidence level waiting
1 parent 648b9c5 commit e130004

File tree

6 files changed

+5
-79
lines changed

6 files changed

+5
-79
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ halo==0.0.26
2020
requests==2.24.0
2121
gql==0.1.0
2222
packageurl-python==0.9.1
23-
etos_lib==1.23.0
23+
etos_lib==1.24.0

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ install_requires =
3434
requests==2.24.0
3535
gql==0.1.0
3636
packageurl-python==0.9.1
37-
etos_lib==1.23.0
37+
etos_lib==1.24.0
3838

3939
# Require a specific Python version, e.g. Python 2.7 or >= 3.4
4040
python_requires = >=3.4

src/etos_client/lib/graphql.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 Axis Communications AB.
1+
# Copyright 2020-2021 Axis Communications AB.
22
#
33
# For a full list of individual contributors, please see the commit history.
44
#
@@ -18,7 +18,6 @@
1818
ARTIFACTS,
1919
ACTIVITY_TRIGGERED,
2020
ACTIVITY_CANCELED,
21-
CONFIDENCE_LEVEL,
2221
TEST_SUITE_STARTED,
2322
TEST_SUITE_FINISHED,
2423
TEST_SUITE,
@@ -157,34 +156,6 @@ def request_test_suite_finished(etos, test_suite_ids):
157156
return None # StopIteration
158157

159158

160-
def request_confidence_level(etos, test_suite_ids):
161-
"""Request confidence levels from graphql.
162-
163-
:param etos: Etos Library instance for communicating with ETOS.
164-
:type etos: :obj:`etos_lib.etos.ETOS`
165-
:param test_suite_ids: list of test suite started IDs of which confidences to search for.
166-
:type test_suite_ids: list
167-
:return: Iterator of confidence level modified graphql responses.
168-
:rtype: iterator
169-
"""
170-
or_query = "{'$or': ["
171-
or_query += ", ".join(
172-
[
173-
"{'links.type': 'CAUSE', 'links.target': '%s'}" % test_suite_id
174-
for test_suite_id in test_suite_ids
175-
]
176-
)
177-
or_query += "]}"
178-
for response in request(etos, CONFIDENCE_LEVEL % or_query):
179-
if response:
180-
for _, confidence_level in etos.graphql.search_for_nodes(
181-
response, "confidenceLevelModified"
182-
):
183-
yield confidence_level
184-
return None # StopIteration
185-
return None # StopIteration
186-
187-
188159
def request_announcements(etos, ids):
189160
"""Request announcements from graphql.
190161

src/etos_client/lib/graphql_queries.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 Axis Communications AB.
1+
# Copyright 2020-2021 Axis Communications AB.
22
#
33
# For a full list of individual contributors, please see the commit history.
44
#
@@ -108,35 +108,6 @@
108108
}
109109
"""
110110

111-
CONFIDENCE_LEVEL = """
112-
{
113-
confidenceLevelModified(search: "%s") {
114-
edges {
115-
node {
116-
data {
117-
name
118-
value
119-
}
120-
meta {
121-
id
122-
}
123-
links {
124-
... on Cause {
125-
links {
126-
... on TestSuiteStarted {
127-
meta {
128-
id
129-
}
130-
}
131-
}
132-
}
133-
}
134-
}
135-
}
136-
}
137-
}
138-
"""
139-
140111

141112
ANNOUNCEMENTS = """
142113
{

src/etos_client/lib/log_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 Axis Communications AB.
1+
# Copyright 2020-2021 Axis Communications AB.
22
#
33
# For a full list of individual contributors, please see the commit history.
44
#

src/etos_client/lib/test_result_handler.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from .graphql import (
2121
request_activity,
2222
request_activity_canceled,
23-
request_confidence_level,
2423
request_test_suite_finished,
2524
request_test_suite_started,
2625
request_suite,
@@ -235,21 +234,6 @@ def get_events(self, suite_id):
235234
for main_suite in finished
236235
if main_suite_link in main_suite["links"]
237236
]
238-
239-
main_suite_link = {"links": {"meta": {"id": main_suite["meta"]["id"]}}}
240-
confidence = list(request_confidence_level(self.etos, started_ids))
241-
if not confidence:
242-
return results
243-
results["confidenceLevelModified"] = [
244-
sub_confidence
245-
for sub_confidence in confidence
246-
if main_suite_link not in sub_confidence["links"]
247-
]
248-
results["mainConfidenceLevelModified"] = [
249-
main_confidence
250-
for main_confidence in confidence
251-
if main_suite_link in main_confidence["links"]
252-
]
253237
return results
254238

255239
def print_suite(self, spinner):

0 commit comments

Comments
 (0)