SpineEventEngine / gcloud-java

Support for Spine-based Java apps running under Google Cloud
https://spine.io
Apache License 2.0
3 stars 0 forks source link

Use Docker-based Datastore emulator via Testcontainers #185

Closed armiol closed 1 year ago

armiol commented 1 year ago

Previously, most of the tests were targeting a local Datastore emulator, started via Gradle's ExecFork plugin. It was a decent solution, but it had its downsides:

  1. ExecFork plugin was not too configurable in terms of wiring it with our execution flow — Gradle complained on its implicit dependencies.

  2. Once tests failed for some reason, or, in some cases, if all of them pass, the emulator was not stopped. Such a behaviour is still observed even with the most recent version of ExecFork plugin.

  3. Apparently, partly due to p.2 we were maintaining an ExecFork fork (so to speak), which took time to manage. As of now, our fork is really outdated, comparing to ExecFork's master branch.

This changeset migrates the repository tests to using a Docker-based Datastore emulator via testcontainers/GCloud module.

Now, to launch a build, one should have a local Docker up and running.

As to GH Actions, its environment provides some container-related functionality, which is apparently sufficient for Testcontainers to work.

Also, some slow tests on catch-up functionality were disabled, as they were is the past. It helps to reduce the build time.

codecov[bot] commented 1 year ago

Codecov Report

Merging #185 (2907499) into master (7c7c265) will increase coverage by 0.18%. Report is 1 commits behind head on master. The diff coverage is 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #185 +/- ## ============================================ + Coverage 86.91% 87.09% +0.18% - Complexity 463 472 +9 ============================================ Files 73 75 +2 Lines 1773 1798 +25 Branches 89 90 +1 ============================================ + Hits 1541 1566 +25 Misses 200 200 Partials 32 32 ```
armiol commented 1 year ago

@alexander-yevsyukov PTAL.