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

Improve structure and fixture obtention for unit tests #3856

Open
2opremio opened this issue Aug 26, 2021 · 0 comments
Open

Improve structure and fixture obtention for unit tests #3856

2opremio opened this issue Aug 26, 2021 · 0 comments
Labels

Comments

@2opremio
Copy link
Contributor

Since we moved away from the DB scenarios, the legibility and structure of unit tests has considerably degraded. This is particularly obvious in the db2/history/, actions and ingest/processors packages.

Some of the problems are:

  • We are mixing suites and normal tests
  • Fixtures are generated in a custom manner. Many tests have different approaches to generating them and there seem to be duplicated efforts across the tests. Good examples of this are effects_processor_test.go and transaction_operation_wrapper_test.go
  • There isn't a good alternative to the DB scenarios. There are are no libraries/helpers to easily inject fixture data into the database. This has led to a decrement of coverage in db2/history (see the history_claimable_balance* and history_liquidity_pool* code, for instance.

@bartekn suggests going through the test structure and designing a helper library, like we have for integration tests (e.g. for integration tests we have common functions to create accounts etc ... )

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

No branches or pull requests

1 participant