Skip to content

Commit 1662952

Browse files
chore(deps): update third_party/ni-apis digest to 252a63f (#197)
* chore(deps): update third_party/ni-apis digest to 252a63f * Run generate-stubs on new ni-apis commit Signed-off-by: Michael Johansen <[email protected]> * Fix unit tests for TestAdapter Signed-off-by: Michael Johansen <[email protected]> --------- Signed-off-by: Michael Johansen <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Johansen <[email protected]>
1 parent 633784e commit 1662952

File tree

8 files changed

+348
-178
lines changed

8 files changed

+348
-178
lines changed

packages/ni.measurements.data.v1.proto/src/ni/measurements/data/v1/data_store_service_pb2/__init__.py

Lines changed: 43 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ni.measurements.data.v1.proto/src/ni/measurements/data/v1/data_store_service_pb2/__init__.pyi

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,44 @@ class GetTestResultResponse(google.protobuf.message.Message):
9090

9191
global___GetTestResultResponse = GetTestResultResponse
9292

93+
@typing.final
94+
class QueryTestResultsRequest(google.protobuf.message.Message):
95+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
96+
97+
ODATA_QUERY_FIELD_NUMBER: builtins.int
98+
odata_query: builtins.str
99+
"""an OData query string. example "$filter=name eq 'Value'"
100+
An empty string will return all test results.
101+
$expand, $count, and $select are not supported. For more information,
102+
see https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview.
103+
"""
104+
def __init__(
105+
self,
106+
*,
107+
odata_query: builtins.str = ...,
108+
) -> None: ...
109+
def ClearField(self, field_name: typing.Literal["odata_query", b"odata_query"]) -> None: ...
110+
111+
global___QueryTestResultsRequest = QueryTestResultsRequest
112+
113+
@typing.final
114+
class QueryTestResultsResponse(google.protobuf.message.Message):
115+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
116+
117+
TEST_RESULTS_FIELD_NUMBER: builtins.int
118+
@property
119+
def test_results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[ni.measurements.data.v1.data_store_pb2.TestResult]:
120+
"""The list of test results that match the query."""
121+
122+
def __init__(
123+
self,
124+
*,
125+
test_results: collections.abc.Iterable[ni.measurements.data.v1.data_store_pb2.TestResult] | None = ...,
126+
) -> None: ...
127+
def ClearField(self, field_name: typing.Literal["test_results", b"test_results"]) -> None: ...
128+
129+
global___QueryTestResultsResponse = QueryTestResultsResponse
130+
93131
@typing.final
94132
class CreateStepRequest(google.protobuf.message.Message):
95133
DESCRIPTOR: google.protobuf.descriptor.Descriptor

packages/ni.measurements.data.v1.proto/src/ni/measurements/data/v1/data_store_service_pb2_grpc/__init__.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ def __init__(self, channel):
2727
request_serializer=ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.GetTestResultRequest.SerializeToString,
2828
response_deserializer=ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.GetTestResultResponse.FromString,
2929
)
30+
self.QueryTestResults = channel.unary_unary(
31+
'/ni.measurements.data.v1.DataStoreService/QueryTestResults',
32+
request_serializer=ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.QueryTestResultsRequest.SerializeToString,
33+
response_deserializer=ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.QueryTestResultsResponse.FromString,
34+
)
3035
self.CreateStep = channel.unary_unary(
3136
'/ni.measurements.data.v1.DataStoreService/CreateStep',
3237
request_serializer=ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.CreateStepRequest.SerializeToString,
@@ -100,6 +105,14 @@ def GetTestResult(self, request, context):
100105
context.set_details('Method not implemented!')
101106
raise NotImplementedError('Method not implemented!')
102107

108+
def QueryTestResults(self, request, context):
109+
"""Query for test results matching the given OData query. For information about the OData query syntax,
110+
see https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview.
111+
"""
112+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
113+
context.set_details('Method not implemented!')
114+
raise NotImplementedError('Method not implemented!')
115+
103116
def CreateStep(self, request, context):
104117
"""Creates a new step in the data store. A step is owned by a test result,
105118
and is a logical grouping of published measurements. All published measurements must be associated
@@ -182,6 +195,11 @@ def add_DataStoreServiceServicer_to_server(servicer, server):
182195
request_deserializer=ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.GetTestResultRequest.FromString,
183196
response_serializer=ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.GetTestResultResponse.SerializeToString,
184197
),
198+
'QueryTestResults': grpc.unary_unary_rpc_method_handler(
199+
servicer.QueryTestResults,
200+
request_deserializer=ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.QueryTestResultsRequest.FromString,
201+
response_serializer=ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.QueryTestResultsResponse.SerializeToString,
202+
),
185203
'CreateStep': grpc.unary_unary_rpc_method_handler(
186204
servicer.CreateStep,
187205
request_deserializer=ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.CreateStepRequest.FromString,
@@ -274,6 +292,23 @@ def GetTestResult(request,
274292
options, channel_credentials,
275293
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
276294

295+
@staticmethod
296+
def QueryTestResults(request,
297+
target,
298+
options=(),
299+
channel_credentials=None,
300+
call_credentials=None,
301+
insecure=False,
302+
compression=None,
303+
wait_for_ready=None,
304+
timeout=None,
305+
metadata=None):
306+
return grpc.experimental.unary_unary(request, target, '/ni.measurements.data.v1.DataStoreService/QueryTestResults',
307+
ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.QueryTestResultsRequest.SerializeToString,
308+
ni_dot_measurements_dot_data_dot_v1_dot_data__store__service__pb2.QueryTestResultsResponse.FromString,
309+
options, channel_credentials,
310+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
311+
277312
@staticmethod
278313
def CreateStep(request,
279314
target,

packages/ni.measurements.data.v1.proto/src/ni/measurements/data/v1/data_store_service_pb2_grpc/__init__.pyi

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ class DataStoreServiceStub:
4343
]
4444
"""Gets the test result associated with the identifier given in the request."""
4545

46+
QueryTestResults: grpc.UnaryUnaryMultiCallable[
47+
ni.measurements.data.v1.data_store_service_pb2.QueryTestResultsRequest,
48+
ni.measurements.data.v1.data_store_service_pb2.QueryTestResultsResponse,
49+
]
50+
"""Query for test results matching the given OData query. For information about the OData query syntax,
51+
see https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview.
52+
"""
53+
4654
CreateStep: grpc.UnaryUnaryMultiCallable[
4755
ni.measurements.data.v1.data_store_service_pb2.CreateStepRequest,
4856
ni.measurements.data.v1.data_store_service_pb2.CreateStepResponse,
@@ -133,6 +141,14 @@ class DataStoreServiceAsyncStub:
133141
]
134142
"""Gets the test result associated with the identifier given in the request."""
135143

144+
QueryTestResults: grpc.aio.UnaryUnaryMultiCallable[
145+
ni.measurements.data.v1.data_store_service_pb2.QueryTestResultsRequest,
146+
ni.measurements.data.v1.data_store_service_pb2.QueryTestResultsResponse,
147+
]
148+
"""Query for test results matching the given OData query. For information about the OData query syntax,
149+
see https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview.
150+
"""
151+
136152
CreateStep: grpc.aio.UnaryUnaryMultiCallable[
137153
ni.measurements.data.v1.data_store_service_pb2.CreateStepRequest,
138154
ni.measurements.data.v1.data_store_service_pb2.CreateStepResponse,
@@ -227,6 +243,16 @@ class DataStoreServiceServicer(metaclass=abc.ABCMeta):
227243
) -> typing.Union[ni.measurements.data.v1.data_store_service_pb2.GetTestResultResponse, collections.abc.Awaitable[ni.measurements.data.v1.data_store_service_pb2.GetTestResultResponse]]:
228244
"""Gets the test result associated with the identifier given in the request."""
229245

246+
@abc.abstractmethod
247+
def QueryTestResults(
248+
self,
249+
request: ni.measurements.data.v1.data_store_service_pb2.QueryTestResultsRequest,
250+
context: _ServicerContext,
251+
) -> typing.Union[ni.measurements.data.v1.data_store_service_pb2.QueryTestResultsResponse, collections.abc.Awaitable[ni.measurements.data.v1.data_store_service_pb2.QueryTestResultsResponse]]:
252+
"""Query for test results matching the given OData query. For information about the OData query syntax,
253+
see https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview.
254+
"""
255+
230256
@abc.abstractmethod
231257
def CreateStep(
232258
self,

packages/ni.measurements.metadata.v1.client/tests/unit/test_metadata_store_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ def test__get_test_adapter__request_and_response_pass_through(
433433
client_request = metadata_store_service_types.GetTestAdapterRequest()
434434
client_request.test_adapter_id = "6118CBCE-74A1-4DE8-9B3A-98DE34A3B837"
435435
stub_response = metadata_store_service_types.GetTestAdapterResponse()
436-
stub_response.test_adapter.test_adapter_name = "Test Adapter"
436+
stub_response.test_adapter.name = "Test Adapter"
437437
metadata_store_stub.GetTestAdapter.return_value = stub_response
438438

439439
client_response = metadata_store_client.get_test_adapter(client_request)
@@ -451,7 +451,7 @@ def test__query_test_adapters__request_and_response_pass_through(
451451
client_request.odata_query = "OData Query"
452452
stub_response = metadata_store_service_types.QueryTestAdaptersResponse()
453453
test_adapter1 = stub_response.test_adapters.add()
454-
test_adapter1.test_adapter_name = "Test Adapter"
454+
test_adapter1.name = "Test Adapter"
455455
metadata_store_stub.QueryTestAdapters.return_value = stub_response
456456

457457
client_response = metadata_store_client.query_test_adapters(client_request)
@@ -466,7 +466,7 @@ def test__create_test_adapter__request_and_response_pass_through(
466466
metadata_store_client: MetadataStoreClient, metadata_store_stub: Mock
467467
) -> None:
468468
client_request = metadata_store_service_types.CreateTestAdapterRequest()
469-
client_request.test_adapter.test_adapter_name = "Test Adapter"
469+
client_request.test_adapter.name = "Test Adapter"
470470
stub_response = metadata_store_service_types.CreateTestAdapterResponse()
471471
stub_response.test_adapter_id = "6118CBCE-74A1-4DE8-9B3A-98DE34A3B837"
472472
metadata_store_stub.CreateTestAdapter.return_value = stub_response

0 commit comments

Comments
 (0)