fetchai/uAgents

Restructure Almanac tests in uAgents

Closed this issue · 2 comments

Current situation:

  • agent_registration.py has 4 tests (2 sync, 2 async)
  • the tests in general take around 6 seconds each, most of the times ~20 seconds
  • since we apply a GitHub Actions matrix these tests will be executed 7 times on different systems/versions
  • sometimes they fail due to issues with the ledger/network or timeouts
  • these tests take a lot of time / costing a lot of money compared to the rest of the CI workflow

We should rethink how to effectively test the registration functionality as that is not completely part of the uAgents framework but rather includes or represents an interface to the Almanac.
Maybe we can mock the smart contract responses or just take these test to a separate worker.

Proposal from @ejfitzgerald:

  1. Move the current tests into an integration test set and run them periodically. Let's say every day at midnight. The test results for this should be monitored and reported back to the team
  2. The test / code should be refactored so that we can isolate the network from the unit test

Proposal from @jrriehl:
We already have Almanac registration tests running every hour or so on our continuous testing service, so I'd say it's safe to drop these tests. Ideally, I would suggest that we update these tests to simulate or mock the txs for validation purposes.