Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase testability by using Testcontainers #8250

Closed
poikilotherm opened this issue Nov 22, 2021 · 1 comment
Closed

Increase testability by using Testcontainers #8250

poikilotherm opened this issue Nov 22, 2021 · 1 comment

Comments

@poikilotherm
Copy link
Contributor

poikilotherm commented Nov 22, 2021

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

@poikilotherm
Copy link
Contributor Author

This is adressed these days with #9273 #8934 #9796 and others. Closing here. Obviously needs more tests to actually use it. Probably next used with #6783

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant