Page MenuHomeSoftware Heritage

maven-index-exporter: Update tests to check the image behavior
ClosedPublic

Authored by ardumont on Apr 5 2022, 6:55 PM.

Details

Summary

This splits the current test image script in 2:

  • one to (locally) build and test the image
  • one to only test the image

This introduces a Makefile to trigger simple test targets intended to be used by the ci.

As an implementation (and gory) detail, this opens a conditional within the python
script to not do anything during the download phase when the base url starts with
test://. While i'm not a fan, it's simple enough to allow this make test to work
without too much complication.

Related to T3746
Depends on D7508

Test Plan
$ time make test  # or from top-level, make -C tests test
./test_image.sh
PASS: file [/home/tony/work/inria/repo/swh/maven-index-exporter/tests/repository_test/export/_1.fld] has been created.
PASS: file [/home/tony/work/inria/repo/swh/maven-index-exporter/tests/repository_test/export/_1.fld] has 10 docs.
PASS: file [/home/tony/work/inria/repo/swh/maven-index-exporter/tests/repository_test/export/_1.fld] has 35 fields.
PASS: file [/home/tony/work/inria/repo/swh/maven-index-exporter/tests/repository_test/export/_1.fld] has sprova4j-0.1.0-sources.jar.
PASS: file [/home/tony/work/inria/repo/swh/maven-index-exporter/tests/repository_test/export/_1.fld] has sprova4j-0.1.0.pom.
PASS: file [/home/tony/work/inria/repo/swh/maven-index-exporter/tests/repository_test/export/_1.fld] has sprova4j-0.1.1-sources.jar.
PASS: file [/home/tony/work/inria/repo/swh/maven-index-exporter/tests/repository_test/export/_1.fld] has sprova4j-0.1.1.pom.
PASS: file [/home/tony/work/inria/repo/swh/maven-index-exporter/tests/publish/export.fld] exists.
make test  0.04s user 0.02s system 4% cpu 1.236 total

Diff Detail

Repository
rDLSMAVEXP maven-index-exporter
Branch
main
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 28146
Build 44084: arc lint + arc unit

Event Timeline

ardumont edited the test plan for this revision. (Show Details)

Make tests actually noop the download index part

Add check on the actual output the /publish/export.fld (that's the file that should be
served once all is said and done)

ardumont edited the test plan for this revision. (Show Details)
ardumont retitled this revision from tests: Rework test to allow running tests without building the image to maven-index-exporter: Update tests to check the image behavior.Apr 6 2022, 9:40 AM
ardumont edited the summary of this revision. (Show Details)
ardumont edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Apr 6 2022, 10:54 AM