Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Allow running arbitrary sbt tasks/commands with docker-compose #44

Open
stela opened this issue Feb 22, 2017 · 6 comments
Open

Allow running arbitrary sbt tasks/commands with docker-compose #44

stela opened this issue Feb 22, 2017 · 6 comments

Comments

@stela
Copy link

stela commented Feb 22, 2017

Please support running arbitrary sbt tasks/commands while the docker-compose containers are up, not just ScalaTest.

I'm attempting to write my integration/acceptance-tests using cucumber-scala instead of ScalaTest. Currently I'm forced to do this via a ScalaTest wrapper-test-case which "manually" invokes cucumber.runtime.Runtime.run() and fail the test in case Runtime.exitstatus != 0, since the sbt cucumber plugin cannot be invoked from sbt-docker-compose it appears.

I understand that you'd then miss out on the possibility to use the ScalaTest specific ConfigMap, however environment variables (system properties) still work fine in those cases.

However, the application I'd like to test better uses Akka Cluster Sharding, so I think it would be more straightforward to use Akka's multi-jvm or maybe even multi-node support which are implemented as sbt plugins plus test libraries. Would be awesome if sbt-docker-compose could support that as well. Those are however based on ScalaTest, so think I might better give in and switch from cucumber to ScalaTest's FeatureSpec instead.

If you want to look into it, a similar sample project with multi-jvm tests (but no sbt-docker-compose usage yet) is available at https://github.com/typesafehub/activator-akka-cluster-sharding-scala

@aaronp
Copy link
Contributor

aaronp commented Oct 10, 2017

I've just cloned this project with the intent of having a go at this one. I too fancy using this with cucumber, so worth having a shot

aaronp added a commit to aaronp/sbt-docker-compose that referenced this issue Oct 16, 2017
aaronp added a commit to aaronp/sbt-docker-compose that referenced this issue Oct 18, 2017
aaronp added a commit to aaronp/sbt-docker-compose that referenced this issue Oct 18, 2017
kurtkopchik added a commit that referenced this issue Oct 18, 2017
Partial fix for issue #44 — added cucumber support
@kurtkopchik
Copy link
Contributor

Hi @aaronp & @stela - The update for Cucumber support has now been included in an official release:

addSbtPlugin("com.tapad" % "sbt-docker-compose" % "1.0.29")

Thanks again!

@stela
Copy link
Author

stela commented Oct 19, 2017

Thanks! 👍

@eugenemiretsky
Copy link

@kurtkopchik: I have a similar use case with the gatling sbt plugin (I want to run some simple functional tests using gatling as well as regular ScalaTests). Any advice how to go about it?

@kurtkopchik
Copy link
Contributor

Hi @eugenemiretsky - I would start by looking at pull request (0fdfa13) that added support for Cucumber (0fdfa13#diff-d97efb1099d050d6a60fbf8c9cf6447eR96) and see how you can add support in a similar fashion for Gatling via io.gatling.app.Gatling

@EmilDafinov
Copy link

It would be really nice if there was a way to run an arbitrary task when docker compose is up. For example, if I wanted to run a code coverage on the tests executed by dockerComposeTest, is there a way to do it?

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

No branches or pull requests

5 participants