Page MenuHomeSoftware Heritage

tests: Add integration tests for the Software Heritage stack
ClosedPublic

Authored by anlambert on Fri, Apr 26, 5:33 PM.

Details

Summary

First draft of integration tests for the Software Heritage stack using the
docker-compose environment and a couple of bash scripts.

Their purpose is to:

  • ensure the docker-compose environment is up to date and running
  • check there is no regression in high level Software Heritage features (loading origins, querying web api, vault cooking, ...)

The tests will fail if:

  • any of the swh service dies unexpectedly
  • any of the command in the test scripts exits with error

First written tests are about the loading of git origins and vault cooking.

To execute the tests, simply execute the run_tests.sh script.

Related T1618

Diff Detail

Repository
rCDFD Dockerfiles for developers
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

anlambert created this revision.Fri, Apr 26, 5:33 PM
anlambert edited the summary of this revision. (Show Details)Fri, Apr 26, 5:34 PM
anlambert updated this revision to Diff 4666.Fri, Apr 26, 7:00 PM

Update: Remove the use of docker-compose.override.yml file in the tests

anlambert updated this revision to Diff 4667.Fri, Apr 26, 7:38 PM

Update: Ensure all swh services are up before running the tests

lgtm, but why bash instead of python?

Because I think that bash is more adequate when one only wants to run a couple of shell commands sequentially
and process their output / return code. The main idea here is "run a specific swh processing, exit with error
if something went wrong".

This tests implementation already enables me to find issues in our stack (see D1435 for instance).

douardda accepted this revision.Thu, May 9, 9:28 AM
This revision is now accepted and ready to land.Thu, May 9, 9:28 AM
anlambert updated this revision to Diff 4761.Thu, May 9, 6:08 PM

Update:

  • improve wait_for_service_output implementation
  • dump logs to a file on error
This revision was automatically updated to reflect the committed changes.