Skip to content

LLC:integration Tests

elbywan edited this page Oct 25, 2022 · 1 revision

The concept of "integration test" was introduced by PR https://github.com/LedgerHQ/ledger-live/pull/414 and is the idea to split any test that requires network away from the usual unit tests. Typically, synchronising an account requires network and therefore test more than just the logic of the synchronisation but also will verify the explorers API are still up and running. (NB: this is the continuation of what we called "dataset tests" in the past)

An integration test is a regular Jest test file, defined in libs/ledger-live-common project, that ends with .integration.test.ts.

Integration tests by definition can be flawky and it is our regular job to fix them so they can keep passing the CI. They can also be quite resource consuming and long to run. For these two reasons, they only run "on demand" and not "on commit push".

Run locally

You can either run all the integration tests (not recommended)

pnpm common ci-test-integration

OR run the integration tests that are relevant to your changes, for instance of family tezos:

pnpm common ci-test-integration tezos

this works like a regular Jest match filter.

Run on CI

It is expected that PRs comes with an integration test as soon as an important part of live-common is modified. You can trigger it on CI and it helps covering on all platforms (Windows, Mac, Linux – but soon we plan to have mobile).

If you are in Ledger org, you can trigger it from here: https://github.com/LedgerHQ/ledger-live/actions/workflows/test-integration.yml

Screenshot 2022-07-22 at 11 56 58

In future, we will simplify the trigger with a command that you can write inside the PR.

Clone this wiki locally