Skip to content

Automatic test including unit-test/e2e-test #1754

@klesh

Description

@klesh

Description

We are lacking automatic testing mechanism due to many historical reasons, especially for the very essential functionalities of our system, that is subtasks and helper, up till this point, we have been always testing them manually, which is time consuming and unreliable. it's important for us to build up a automatic testing mechansim to make sure they do what we expect them to do.

Describe the solution you'd like

Testing mechanisms

  1. unit test: white box testing, focus on functional verification, modules/classes/functions are tested separately, employe mocking/injection technique if subject had dependencies. Able to simulate some hard to reproduce scenarios
  2. e2e test: black box testing, in contrast to unit test, e2e-test is more about how subject interacts with other parts of the system as whole, e2e-test focus on the correctness of the output rather than logical correctness.

Strategy for Devlake

  1. All subtasks should have e2e-test, given records from input table, we expect a certain set of reccords from output table, CI would execute these test-cases automactically. Except for collection subtasks, because they depend on 3rd API to function. And most problems we ran into in the past were defects from api_collector which can be covered by follwoing unit-test plan
  2. All helpers (api_collector/api_extractor/data_converter) and other complex modules/classes/functions should have unit-test. Unit test should at least cover following situations:
    1. Positive Cases: in a normal condition, subject must be able to execute and return expected result
    2. Recoverable Cases: when tolerable errors occured, subject should be able to function correctly (i.e. retry mechanism)
    3. Unrecoverable Cases: subject should be able to break out when things go really really wrong.
    4. Race condition: carefully create some race condition if subject would be executed in a parallel context.

Plan of attack

  1. Unit test for api_async_client #1665
  2. Unit test for api_collector #1656
  3. issue related e2e test implementation for gitlab plugin #1765

Has the Feature been Requested Before?

Maybe

Metadata

Metadata

Assignees

Labels

type/epicThis is an epic issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions