Skip to content

Increase testability by using Testcontainers #8250

@poikilotherm

Description

@poikilotherm

Overview of the Feature Request

This request is about refactoring API tests in a way it makes OPTIONAL reuse of containers.

  • Introduce container building via Maven into upstream (currently being maintained in https://github.com/gdcc/dataverse only)
  • Merge existing Maven profile "tc" (TestContainers) with the introduced profile "ct" (ConTainers)
  • Make use of www.testcontainers.org within this profile, so API tests need an installation of Docker and a single mvn -Pct verify to run in an ephemeral environment. (No more shell scripts, more intuitive control over tests by using Maven plugins)
  • Run API tests right from your IDE, using an ephemeral container setup in the background (mvn -Pct package docker:run -Dct.run.it) - may be extended with hot reload mechanisms
  • Extensible usage of Testcontainers will allow more indepth testing for things like mail, auth, storage, PIDs, etc. Also stuff like UI testing would become more achievable.
  • Running API tests (and more?) within Github Actions (or other CI) without complicated AWS setups (from @donsizemore|s wishlist)
  • Completely control all testing aspects from within the same tool: JUnit
  • Add indepth documentation about usage for developers, maybe add some nice screencasts. Usage means 1. how to run tests and 2. how to control stuff from JUnit
  • Optional complete replacement to docker-aio

Did I mention this is entirly optional? It still will be possible to use your classic testing setups!

What kind of user is the feature intended for?
(Example users roles: API User, Curator, Depositor, Guest, Superuser, Sysadmin)

  • Developers
  • Sysadmin

What inspired the request?

Being able to fire up a ready-to-go demo or integration testing environment with a single command, using only tools you already have on your harddrive (with the exception of needing Docker somewhere).

What existing behavior do you want changed?

Currently, doing integration tests is hard. I want that to become more easy.

Any brand new behavior do you want to add to Dataverse?

Not in a sense of an application behaviour.

It introduces usable production containers into upstream, removing them from https://github.com/gdcc/dataverse-kubernetes.
To make it perfectly clear this is NOT SUPPORTED BY UPSTREAM, container images will NOT be published from this upstream repo (or at least not to a registry where it says "IQSS", but "GDCC" instead).

Any related open or closed issues to this feature request?

#5292 #4665

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions