Skip to content

.Net MEVD: Consider de-prioritizing/removing unit testing for MEVD connectors #10464

@roji

Description

@roji

MEVD connectors currently have unit test projects in addition to integration testing. I'd propose shifting our focus to having a strong, reliable and shared suite of integration tests, and de-prioritize (and possibly even remove) the majority of unit tests.

  • Database connectors are generally a place where integration tests seem much more useful than unit tests - they're relatively thin layers above the database, and generally have few complex internal components
  • The coverage provided by unit tests is very partial. For example, the test can check that a connector generates some SQL string given a search, but that test doesn't verify that the SQL actually works, or returns the expected results.
  • Integration tests (against the actual database) can be very reliable, with no flakiness - EF relies on integration tests for the vast majority of its testing (against multiple database types). Testcontainers take away the responsibility of waiting until a database is actually up, and some minimal logic (e.g. ensuring test data is actually visible after seeding) can ensure tests are fully reliable (see #10194 for more). Simply put, the time spent on unit tests is generally better spent on removing flakiness in integration tests (when flakiness occurs).
  • Unit tests of internal connector components rely on internal API shapes, meaning that internal refactoring of a connector breaks them and causes more work. As an example, the work on LINQ-based filtering (#10273) needed to change some internal signatures, causing additional work to adapt the unit tests.
  • Because integration tests work against the public surface APIs of MEVD, we can have general test suites that are used by all connectors (#10194). In contrast, unit tests must be written again and again for each connector, since the internal types being tested are different each time.
  • Some connectors (e.g. Qdrant) even have a mock implementation in the connector itself - not the test project (MockableQdrantClient); this complicates the connector implementation and adds maintenance burden.
  • One place where unit tests and mocking are important, is when testing various failure scenarios that can't be simulated in integration tests (e.g. network failure). However, these are generally more the concern of the low-level SDK/driver, whereas MEVD is a higher-level intermediate layer.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions