Skip to content

0012 unit test elasticsearch content with integration tests

Bruno Thomas edited this page Nov 23, 2021 · 1 revision

12. Unit Test Elasticsearch content with integration tests

Date: 2018-03-14

Status

Accepted

Context

When doing TDD with datashare front, we can

  • mock elasticsearch and assert actual queries are equals to expected ones
  • use a real elasticsearch server and provision small datasets for each test context

Decision

We will create a DSL to ingest data into elasticsearch in order to avoid coupling with Elasticseach JSON API. The small library will provide a simple API to create small and testable datasets (Documnents, NamedEntities, Tags...). It will also allow the developers to create index, reset the state for tests tear down.

Consequences

For datashare tests involving elasticsearch, developers will use this small DSL (if ES API change tests will fail).

Datashare

Customize (Legacy)

Translations

This project is currently available in English, French, Spanish and Japanese. You can help us to improve and complete translations on Crowdin.

About ICIJ

Datashare is a project by ICIJ, a collective of investigative journalists.

ICIJ Logo

Clone this wiki locally