application-services/testing/sync-test
Edouard Oger 76d108d55a
Cargo update
2020-05-05 13:12:59 -04:00
..
helper Type FxA confirmation code in integration tests 2019-12-10 18:50:53 -05:00
src 2334 - Add ttl to get_access_token. 2020-04-08 16:36:24 +01:00
Cargo.toml Cargo update 2020-05-05 13:12:59 -04:00
README.md WIP Add explicit documentation for our testing strategy. 2020-01-17 14:19:24 +11:00

README.md

End-to-End Tests for Sync

This package implements "end-to-end" integration tests for syncing various data types - two clients using a real live account and a real live sync server, exchanging data and asserting that the exchange works as intended.

Running the tests

Run the tests using cargo run.

Use cargo run -- --help to see the available options.

Running the tests currently requires nodejs, in order to drive a headless browser. There is an open issue to investigate how to remove this dependency.

Adding tests

For each datatype managed by sync, there should be a suite of corresponding tests. To add some:

  1. In auth.rs, add support your sync engine to the TestClient struct.
  2. Create a file ./src/<datatype>.rs to hold the tests; logins.rs may provide a useful example.
  3. Create a test_<name> function for each scenario you want to exercise. The function should take two TestClient instances as arguments, and use them to drive a simulated sync between two clients.
  4. Define a get_test_group() function that returns your test scenarios in a TestGroup struct.
  5. Add your test group to the main function defined in main.rs for execution.