Skip to content

Isolate e2e tests

Santiago Gil requested to merge santigl/docker-test-fixture into master

Before raising this MR, consider whether the following are required, and complete if so:

  • Unit tests
  • Metrics
  • Documentation update(s)

If not required, please explain in brief why not.

Description

Currently the end-to-end tests consist of a single script, end-to-end-test.sh, that fetches the sources, builds them, and runs test cases sequentially.

This MR seeks to split that into 3 steps: fetching/building sources, setting up the test environment, and running the tests themselves. The goal is to also make the tests run in isolation, each inside its own clean environment.

For that it uses two Docker images:

  • e2e-environment.dockerfile: fetches the sources and builds all buildbox components at build time.

  • e2e-runner.dockerfile: starts all the components and executes the script given as an argument on runtime. (Analogous to a test fixture.)

Validation

Running manually

  1. Build the image that contains all the required binaries:

docker build -t e2e-environment -f e2e-environment.dockerfile .

  1. Build the runner image:

docker build -t e2e-runner -f e2e-runner.dockerfile .

  1. Execute some of the test scripts:

docker run -ti e2e-runner /tests/test-recc-output.sh

docker run -ti e2e-runner /tests/test-casdownload-casupload.sh

The test scripts are stored in bin/tests/, and only need to implement the logic for the test case itself.

TO-DO

  • Improve parameterization: allow running the tests for different combinations of runners, using FUSE/hardlinks, LocalCAS on/off, etc.
  • Re-add support for flags that enable unit tests + skip running the tests for buildbox-common.

Issues addressed

Closes / Resolves / Addresses (delete as appropriate) issue <e.g. repo-name#x>

Edited by Santiago Gil

Merge request reports

Loading