⚡ Waypoint start time #2666
GitHub Actions / JUnit Test Report
failed
Oct 24, 2024 in 0s
835 tests run, 827 passed, 6 skipped, 2 failed.
Annotations
Check failure on line 60 in waypoint/tests/services/test_nats_service.py
github-actions / JUnit Test Report
test_nats_service.test_nats_events_processor_subscribe
AssertionError: expected call not found.
Expected: pull_subscribe(subject='cloudapi.aries.events.group_id.wallet_id', stream='cloudapi_aries_events')
Actual: pull_subscribe(config=ConsumerConfig(name=None, durable_name=None, description=None, deliver_policy=<DeliverPolicy.BY_START_TIME: 'by_start_time'>, opt_start_seq=None, opt_start_time='2024-10-24T09:50:38.133Z', ack_policy=<AckPolicy.EXPLICIT: 'explicit'>, ack_wait=None, max_deliver=None, backoff=None, filter_subject=None, filter_subjects=None, replay_policy=<ReplayPolicy.INSTANT: 'instant'>, rate_limit_bps=None, sample_freq=None, max_waiting=None, max_ack_pending=None, flow_control=None, idle_heartbeat=None, headers_only=None, deliver_subject=None, deliver_group=None, inactive_threshold=None, num_replicas=None, mem_storage=None, metadata=None), subject='cloudapi.aries.events.group_id.wallet_id', stream='cloudapi_aries_events')
pytest introspection follows:
Kwargs:
assert {'config': Co...id.wallet_id'} == {'stream': 'c...id.wallet_id'}
Omitting 2 identical items, use -vv to show
Left contains 1 more item:
{'config': ConsumerConfig(name=None,
durable_name=None,
description=None,
deliver_policy=<DeliverPolicy.BY_START_TIME: 'by_start_time'>,...
...Full output truncated (23 lines hidden), use '-vv' to show
Raw output
self = <AsyncMock name='connect().jetstream().pull_subscribe' id='140345537617728'>
args = ()
kwargs = {'stream': 'cloudapi_aries_events', 'subject': 'cloudapi.aries.events.group_id.wallet_id'}
expected = call(subject='cloudapi.aries.events.group_id.wallet_id', stream='cloudapi_aries_events')
actual = call(config=ConsumerConfig(name=None, durable_name=None, description=None, deliver_policy=<DeliverPolicy.BY_START_TIME..., mem_storage=None, metadata=None), subject='cloudapi.aries.events.group_id.wallet_id', stream='cloudapi_aries_events')
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7fa4bc9f2fc0>
cause = None
def assert_called_with(self, /, *args, **kwargs):
"""assert that the last call was made with the specified arguments.
Raises an AssertionError if the args and keyword args passed in are
different to the last call to the mock."""
if self.call_args is None:
expected = self._format_mock_call_signature(args, kwargs)
actual = 'not called.'
error_message = ('expected call not found.\nExpected: %s\n Actual: %s'
% (expected, actual))
raise AssertionError(error_message)
def _error_message():
msg = self._format_mock_failure_message(args, kwargs)
return msg
expected = self._call_matcher(_Call((args, kwargs), two=True))
actual = self._call_matcher(self.call_args)
if actual != expected:
cause = expected if isinstance(expected, Exception) else None
> raise AssertionError(_error_message()) from cause
E AssertionError: expected call not found.
E Expected: pull_subscribe(subject='cloudapi.aries.events.group_id.wallet_id', stream='cloudapi_aries_events')
E Actual: pull_subscribe(config=ConsumerConfig(name=None, durable_name=None, description=None, deliver_policy=<DeliverPolicy.BY_START_TIME: 'by_start_time'>, opt_start_seq=None, opt_start_time='2024-10-24T09:50:38.133Z', ack_policy=<AckPolicy.EXPLICIT: 'explicit'>, ack_wait=None, max_deliver=None, backoff=None, filter_subject=None, filter_subjects=None, replay_policy=<ReplayPolicy.INSTANT: 'instant'>, rate_limit_bps=None, sample_freq=None, max_waiting=None, max_ack_pending=None, flow_control=None, idle_heartbeat=None, headers_only=None, deliver_subject=None, deliver_group=None, inactive_threshold=None, num_replicas=None, mem_storage=None, metadata=None), subject='cloudapi.aries.events.group_id.wallet_id', stream='cloudapi_aries_events')
/usr/local/lib/python3.12/unittest/mock.py:949: AssertionError
During handling of the above exception, another exception occurred:
self = <AsyncMock name='connect().jetstream().pull_subscribe' id='140345537617728'>
args = ()
kwargs = {'stream': 'cloudapi_aries_events', 'subject': 'cloudapi.aries.events.group_id.wallet_id'}
def assert_called_once_with(self, /, *args, **kwargs):
"""assert that the mock was called exactly once and that that call was
with the specified arguments."""
if not self.call_count == 1:
msg = ("Expected '%s' to be called once. Called %s times.%s"
% (self._mock_name or 'mock',
self.call_count,
self._calls_repr()))
raise AssertionError(msg)
> return self.assert_called_with(*args, **kwargs)
E AssertionError: expected call not found.
E Expected: pull_subscribe(subject='cloudapi.aries.events.group_id.wallet_id', stream='cloudapi_aries_events')
E Actual: pull_subscribe(config=ConsumerConfig(name=None, durable_name=None, description=None, deliver_policy=<DeliverPolicy.BY_START_TIME: 'by_start_time'>, opt_start_seq=None, opt_start_time='2024-10-24T09:50:38.133Z', ack_policy=<AckPolicy.EXPLICIT: 'explicit'>, ack_wait=None, max_deliver=None, backoff=None, filter_subject=None, filter_subjects=None, replay_policy=<ReplayPolicy.INSTANT: 'instant'>, rate_limit_bps=None, sample_freq=None, max_waiting=None, max_ack_pending=None, flow_control=None, idle_heartbeat=None, headers_only=None, deliver_subject=None, deliver_group=None, inactive_threshold=None, num_replicas=None, mem_storage=None, metadata=None), subject='cloudapi.aries.events.group_id.wallet_id', stream='cloudapi_aries_events')
E
E pytest introspection follows:
E
E Kwargs:
E assert {'config': Co...id.wallet_id'} == {'stream': 'c...id.wallet_id'}
E
E Omitting 2 identical items, use -vv to show
E Left contains 1 more item:
E {'config': ConsumerConfig(name=None,
E durable_name=None,
E description=None,
E deliver_policy=<DeliverPolicy.BY_START_TIME: 'by_start_time'>,...
E
E ...Full output truncated (23 lines hidden), use '-vv' to show
/usr/local/lib/python3.12/unittest/mock.py:961: AssertionError
During handling of the above exception, another exception occurred:
mock_nats_client = <AsyncMock name='connect().jetstream()' spec='JetStreamContext' id='140345519979312'>
@pytest.mark.anyio
async def test_nats_events_processor_subscribe(
mock_nats_client, # pylint: disable=redefined-outer-name
):
processor = NatsEventsProcessor(mock_nats_client)
mock_nats_client.pull_subscribe.return_value = AsyncMock(
spec=JetStreamContext.PullSubscription
)
subscription = await processor._subscribe( # pylint: disable=protected-access
"group_id", "wallet_id"
)
> mock_nats_client.pull_subscribe.assert_called_once_with(
subject=f"{NATS_SUBJECT}.group_id.wallet_id", stream=NATS_STREAM
)
E AssertionError: expected call not found.
E Expected: pull_subscribe(subject='cloudapi.aries.events.group_id.wallet_id', stream='cloudapi_aries_events')
E Actual: pull_subscribe(config=ConsumerConfig(name=None, durable_name=None, description=None, deliver_policy=<DeliverPolicy.BY_START_TIME: 'by_start_time'>, opt_start_seq=None, opt_start_time='2024-10-24T09:50:38.133Z', ack_policy=<AckPolicy.EXPLICIT: 'explicit'>, ack_wait=None, max_deliver=None, backoff=None, filter_subject=None, filter_subjects=None, replay_policy=<ReplayPolicy.INSTANT: 'instant'>, rate_limit_bps=None, sample_freq=None, max_waiting=None, max_ack_pending=None, flow_control=None, idle_heartbeat=None, headers_only=None, deliver_subject=None, deliver_group=None, inactive_threshold=None, num_replicas=None, mem_storage=None, metadata=None), subject='cloudapi.aries.events.group_id.wallet_id', stream='cloudapi_aries_events')
E
E pytest introspection follows:
E
E Kwargs:
E assert {'config': Co...id.wallet_id'} == {'stream': 'c...id.wallet_id'}
E
E Omitting 2 identical items, use -vv to show
E Left contains 1 more item:
E {'config': ConsumerConfig(name=None,
E durable_name=None,
E description=None,
E deliver_policy=<DeliverPolicy.BY_START_TIME: 'by_start_time'>,...
E
E ...Full output truncated (23 lines hidden), use '-vv' to show
waypoint/tests/services/test_nats_service.py:60: AssertionError
Check failure on line 105 in app/tests/e2e/test_did_exchange.py
github-actions / JUnit Test Report
test_did_exchange.test_create_did_exchange_request[clean-clean-None-did:peer:4-False]
fastapi.exceptions.HTTPException: 500: {"detail":"Internal Server Error"}
Raw output
self = <shared.util.rich_async_client.RichAsyncClient object at 0x7fdf91763c80>
url = '/v1/connections/d04862a4-b16e-40b8-9bb9-4fed12718fec', kwargs = {}
response = <Response [500 Internal Server Error]>, code = 500
message = '{"detail":"Internal Server Error"}'
log_message = 'Tenant alice_DANCV - HTTP DELETE `/v1/connections/d04862a4-b16e-40b8-9bb9-4fed12718fec` failed. Status code: 500. Response: `{"detail":"Internal Server Error"}`.'
async def delete(self, url: str, **kwargs) -> Response:
try:
response = await super().delete(url, **kwargs)
if self.raise_status_error:
> response.raise_for_status()
shared/util/rich_async_client.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Response [500 Internal Server Error]>
def raise_for_status(self) -> Response:
"""
Raise the `HTTPStatusError` if one occurred.
"""
request = self._request
if request is None:
raise RuntimeError(
"Cannot call `raise_for_status` as the request "
"instance has not been set on this response."
)
if self.is_success:
return self
if self.has_redirect_location:
message = (
"{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
"Redirect location: '{0.headers[location]}'\n"
"For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
)
else:
message = (
"{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
"For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
)
status_class = self.status_code // 100
error_types = {
1: "Informational response",
3: "Redirect response",
4: "Client error",
5: "Server error",
}
error_type = error_types.get(status_class, "Invalid status code")
message = message.format(self, error_type=error_type)
> raise HTTPStatusError(message, request=request, response=self)
E httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://governance-tenant-web.cloudapi.dev.didxtech.com/tenant/v1/connections/d04862a4-b16e-40b8-9bb9-4fed12718fec'
E For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
/usr/local/lib/python3.12/site-packages/httpx/_models.py:763: HTTPStatusError
The above exception was the direct cause of the following exception:
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fdf91763c80>
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fdf91758b60>
alice_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7fdf917625a0>
faber_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7fdf90bc0410>
use_did = None, use_did_method = 'did:peer:4', use_public_did = False
@pytest.mark.anyio
@pytest.mark.parametrize(
"use_did,use_did_method,use_public_did",
[
(None, None, False),
(True, None, False),
(None, "did:peer:2", False),
(None, "did:peer:4", False),
(True, "did:peer:4", False),
(None, None, True),
],
)
async def test_create_did_exchange_request(
alice_member_client: RichAsyncClient,
faber_client: RichAsyncClient,
alice_acapy_client: AcaPyClient,
faber_acapy_client: AcaPyClient,
use_did: Optional[str],
use_did_method: Optional[str],
use_public_did: bool,
):
faber_public_did = await acapy_wallet.get_public_did(controller=faber_acapy_client)
request_data = {"their_public_did": qualified_did_sov(faber_public_did.did)}
if use_did:
new_did = await acapy_wallet.create_did(controller=alice_acapy_client)
request_data["use_did"] = new_did.did
if use_did_method:
request_data["use_did_method"] = use_did_method
if use_public_did:
request_data["use_public_did"] = use_public_did
if use_public_did: # Alice doesn't have a public DID
with pytest.raises(HTTPException) as exc_info:
response = await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
params=request_data,
)
assert exc_info.value.status_code == 400
assert exc_info.value.detail == """{"detail":"No public DID configured."}"""
elif use_did and use_did_method:
with pytest.raises(HTTPException) as exc_info:
await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
params=request_data,
)
assert exc_info.value.status_code == 400
assert (
exc_info.value.detail
== """{"detail":"Cannot specify both use_did and use_did_method."}"""
)
else:
response = await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request", params=request_data
)
assert response.status_code == 200
connection_record = response.json()
assert_that(connection_record).contains("connection_id", "state")
assert_that(connection_record["state"]).is_equal_to("request-sent")
alice_connection_id = connection_record["connection_id"]
alice_did = connection_record["my_did"]
try:
# Due to auto-accepts, Alice's connection is complete
assert await check_webhook_state(
alice_member_client,
topic="connections",
state="completed",
filter_map={"connection_id": alice_connection_id},
)
# Faber now has a complete connection too
assert await check_webhook_state(
faber_client,
topic="connections",
state="completed",
filter_map={"their_did": alice_did},
)
finally:
await asyncio.sleep(1) # Short sleep assists in avoiding 500 error
# Delete connection records:
> await alice_member_client.delete(
f"{CONNECTIONS_BASE_PATH}/{alice_connection_id}"
)
app/tests/e2e/test_did_exchange.py:105:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <shared.util.rich_async_client.RichAsyncClient object at 0x7fdf91763c80>
url = '/v1/connections/d04862a4-b16e-40b8-9bb9-4fed12718fec', kwargs = {}
response = <Response [500 Internal Server Error]>, code = 500
message = '{"detail":"Internal Server Error"}'
log_message = 'Tenant alice_DANCV - HTTP DELETE `/v1/connections/d04862a4-b16e-40b8-9bb9-4fed12718fec` failed. Status code: 500. Response: `{"detail":"Internal Server Error"}`.'
async def delete(self, url: str, **kwargs) -> Response:
try:
response = await super().delete(url, **kwargs)
if self.raise_status_error:
response.raise_for_status()
except HTTPStatusError as e:
code = e.response.status_code
message = e.response.text
log_message = f"{self.name} DELETE `{url}` failed. Status code: {code}. Response: `{message}`."
logger.error(log_message)
> raise HTTPException(status_code=code, detail=message) from e
E fastapi.exceptions.HTTPException: 500: {"detail":"Internal Server Error"}
shared/util/rich_async_client.py:68: HTTPException
Loading