Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add itest oracle harness #1395

Open
wants to merge 5 commits into
base: rfq-negotiation-groupkey
Choose a base branch
from

Conversation

GeorgeTsagk
Copy link
Member

Description

This PR adds the oracle harness that is used in the LitD itests to our tapd repo. This will allow us to run an actual dummy grpc oracle server that the tapd instances of our itests can use. This will offer a slightly bigger code coverage in itests plus enable more complex scenarios with moving prices.

This branch is based on rfq-negotiation-groupkey, which is also set as the base of this GH pull request in order to not see duplicate commits.

  • Fix bug: The SubscribeRfqEventNtfns RPC endpoint will crash if it tries to marshal the rfq message sent by our peer if they consider our price unacceptable.

The public oracle server RPC endpoints for querying prices would only
accept a specifier that sets only the asset ID. We may now accept group
keys as well, so we consider any specifier to be valid. This is needed
as we're later going to create a oracle rpc server harness to test out
this code path.
In order for the oracle server harness to have a native way of providing
us with logs in the itests we need to set up an itest logger, which is
also initiated during test harness setup.
Adds a simple oracle server harness, this is a copy of the oracle
harness implementation in LitD. We need this to have greatest code
coverage in our tapd itests and also to have moving prices during the
itest execution, allowing the creation of more complex scenarios.
Not all itests need to use an oracle server harness, so we introduce a
functional option that may be defined when setting up a harness. This
will reduce the overall diff as previous callers of the harness setup
functions won't need to change their arguments.
In order to test the new harness and the previous changes, we introduce
the oracle server harness in one of our rfq related tests. The 2 peers
in this test will now query a real oracle price server instead of
defaulting to their mock.
@GeorgeTsagk GeorgeTsagk self-assigned this Feb 17, 2025
@GeorgeTsagk GeorgeTsagk added this to the v0.6 milestone Feb 17, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13377535608

Details

  • 40 of 262 (15.27%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall first build on itest-oracle-harness at 40.88%

Changes Missing Coverage Covered Lines Changed/Added Lines %
itest/test_harness.go 0 8 0.0%
itest/tapd_harness.go 0 16 0.0%
itest/oracle_harness.go 0 198 0.0%
Totals Coverage Status
Change from base Build 13290786789: 40.9%
Covered Lines: 27348
Relevant Lines: 66898

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

2 participants