alpha-wallet-ios icon indicating copy to clipboard operation
alpha-wallet-ios copied to clipboard

Make test suite run reliably locally

Open hboon opened this issue 2 years ago • 13 comments

It used to be that it runs (more?) reliably locally, but not on Travis, but not anymore. Let's get it to work properly, locally first.

Not product priority, but it puts a dent on development (we can't rely on it for merge queues)

  • [ ] Remove PublisherToAsyncTests.testCancellation
  • [ ] more

hboon avatar Apr 11 '23 04:04 hboon

Normally, I would not put in tests which access servers in the test suite. I would mock all network traffic.

eviltofu avatar Apr 12 '23 00:04 eviltofu

mock all network traffic.

I don't think that's possible for us. It could be a good practice to mock some and reduce dependency. But ultimately we need to ensure the web APIs we call work as we expect.

Are the failures related to web APIs that we call though?

hboon avatar Apr 12 '23 00:04 hboon

This morning's test failures: First run

Failing tests:
	EnsResolverTests.testEnsIp10WildcardAndEip3668CcipRead()
	EnsResolverTests.testEnsIp10WildcardAndEip3668CcipRead()
	EnsResolverTests.testResolution()
	EnsResolverTests.testResolution()
	EnsResolverTests.testResolutionThatHasDifferentOwnerAndResolver()
	EnsResolverTests.testResolutionThatHasDifferentOwnerAndResolver()

Second run

Failing tests:
	PublisherToAsyncTests.testCancellation()

eviltofu avatar Apr 12 '23 01:04 eviltofu

mock all network traffic.

I don't think that's possible for us. It could be a good practice to mock some and reduce dependency. But ultimately we need to ensure the web APIs we call work as we expect.

Are the failures related to web APIs that we call though?

We can mock all the tests for logic. Then add just one test per network endpoint to make sure we have the correct data format to minimise the network traffic.

eviltofu avatar Apr 12 '23 01:04 eviltofu

PublisherToAsyncTests.testCancellation

Thing is, this doesn't involve the network. The ENS ones, I suggest you look into why it's failing. They seem to work more reliably when they run standalone. It could still be due to network connectivity, but that would be horrible because our app should hit the networks much more aggresively than the tests.

hboon avatar Apr 12 '23 01:04 hboon

What are we testing in testCancellation? @oa-s

eviltofu avatar Apr 12 '23 03:04 eviltofu

Today's failures:

Failing tests:
	RetryPublisherTests.testRetryWithRandomDelay()
	RetryPublisherTests.testRetryWithRandomDelay()

eviltofu avatar Apr 13 '23 00:04 eviltofu

@oa-s in case you missed this:

What are we testing in testCancellation? @oa-s

hboon avatar Apr 14 '23 01:04 hboon

What are we testing in testCancellation? @oa-s

that looks unfinished, should be apropriate handling cancellation for migration from publisher to async await functions

oa-s avatar Apr 14 '23 05:04 oa-s

What are we testing in testCancellation? @oa-s

that looks unfinished, should be apropriate handling cancellation for migration from publisher to async await functions

@hboon should I remove this test?

eviltofu avatar Apr 17 '23 05:04 eviltofu

Sure. I think there's a few others that might have timing issues though.

hboon avatar Apr 17 '23 05:04 hboon

Can this be closed? The current tests on have failures in EtherKeystoreTests. @hboon

eviltofu avatar May 31 '23 01:05 eviltofu

Hmm.. Let's keep it open since we should fix it ultimately, but you can unassign yourself.

hboon avatar May 31 '23 02:05 hboon