singnet / snet-daemon

Service Daemon exposes an AI application as an API that is accessible through the SingularityNET Network. It handles all interaction with the blockchain for authorization and payment using AGI tokens and passes through API calls to the AI application.
MIT License
46 stars 49 forks source link

Unit tests are broken in the master build #518

Closed vsbogd closed 3 years ago

vsbogd commented 3 years ago

master build is broken, CircleCI build results

vsbogd commented 3 years ago

Unit tests are broken, looks like the reason is usage of real metrics service which is unavailable:

time="2020-12-12T09:13:49Z" level=warning msg="Service call failed with status code : 404 "
time="2020-12-12T09:13:49Z" level=warning msg="Unable to publish metrics" payload="{\"OrganizationID\":\"ExampleOrganizationId\",\"ServiceID\":\"ExampleServiceId\",\"GroupID\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"AuthorizedAmount\":10,\"FullAmount\":10,\"ChannelId\":6,\"Nonce\":null}" url="http://demo8325345.mockable.io/contract-api/channel/6/balance"
=== RUN   Test_paymentChannelPaymentHandler_PublishChannelStats/#02
time="2020-12-12T09:13:49Z" level=warning msg="Unable to publish metrics" payload="{\"OrganizationID\":\"ExampleOrganizationId\",\"ServiceID\":\"ExampleServiceId\",\"GroupID\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"AuthorizedAmount\":10,\"FullAmount\":10,\"ChannelId\":6,\"Nonce\":null}" url=badurl/contract-api/channel/6/balance
--- FAIL: Test_paymentChannelPaymentHandler_PublishChannelStats (0.20s)
    --- PASS: Test_paymentChannelPaymentHandler_PublishChannelStats/#00 (0.00s)
    --- FAIL: Test_paymentChannelPaymentHandler_PublishChannelStats/#01 (0.19s)
        payment_handler_test.go:174: paymentChannelPaymentHandler.PublishChannelStats() = {Status: &{0xc4206ba370}}, want <nil>
    --- PASS: Test_paymentChannelPaymentHandler_PublishChannelStats/#02 (0.01s)
vsbogd commented 3 years ago

@anandrgitnirman , could you please take a look

anandrgitnirman commented 3 years ago

@anandrgitnirman , could you please take a look

will close this out by tomorrow first thing , issue is with mockables used