Comments (2)
Hi @mb720!
The first thing to do would be to upgrade to the latest version of sbt-docker-compose
as I see you are on version 17
instead of version 22
. There were a number of enhancements made since the version that you are using.
addSbtPlugin("com.tapad" % "sbt-docker-compose" % "1.0.22")
With this latest release, I'm not 100% certain, but you can probably now remove the following line from your build.sbt file as there is enhanced support for network removal:
dockerMachineName := s"${BuildConfig.appName}-network"
Additionally, you are going to need to define the following setting to provide the proper test
configuration file for when your tests are run via dockerComposeTest
:
testExecutionExtraConfigTask := Map("config.file" -> s"${sourceDirectory.value}/test/resources/application.test.conf")
With those changes I was able to successfully execute dockerComoseTest
from within the appJVM
project. If you are still seeing an issue please send the full output from and we can dig into it further.
scala-js-example kurtkopchik$ sbt
[info] Loading global plugins from /Users/kurtkopchik/.sbt/0.13/plugins
[info] Loading project definition from /Users/kurtkopchik/Source/scala-js-example/project
[info] Set current project to scala-js-example root (in build file:/Users/kurtkopchik/Source/scala-js-example/)
> project appJVM
[info] Set current project to scala-js-example (in build file:/Users/kurtkopchik/Source/scala-js-example/)
> dockerComposeTest skipPull
Starting Test Pass against a new local Docker Compose instance.
Building a new Docker image.
[info] Wrote /Users/kurtkopchik/Source/scala-js-example/app/jvm/target/scala-2.12/scala-js-example_2.12-0.0.1.pom
[info] Sending build context to Docker daemon 38.17 MB
[info]
[info] Step 1/4 : FROM java:8-jre
[info] ---> e44d62cf8862
[info] Step 2/4 : ENTRYPOINT /app/bin/scala-js-example
[info] ---> Using cache
[info] ---> 7e7ea3319c32
[info] Step 3/4 : COPY 0/stage /app
[info] ---> Using cache
[info] ---> 303fec02d4a2
[info] Step 4/4 : RUN mkdir -p /logs
[info] ---> Using cache
[info] ---> 9528cad186e5
[info] Successfully built 9528cad186e5
[info] Tagging image 9528cad186e5 with name: registry.gitlab.com/bullbytes/scala-js-example:latest
Creating Local Docker Compose Environment.
Reading Compose File: /Users/kurtkopchik/Source/scala-js-example/app/jvm/../../docker-compose.yml
Created Compose File with Processed Custom Tags: /var/folders/gy/swztjnld0cz0dm9s_45j_x0h0000gp/T/compose-updated6384060063410476934.yml
'skipPull' argument supplied. Skipping Docker Repository Pull for all images. Using locally cached version of images.
Creating network "161905_scala-js-example-network" with driver "bridge"
Creating volume "161905_postgresVolume" with default driver
Creating 161905_db_1
Creating 161905_web_1
Waiting for container Id to be available for service 'web' time remaining: 499
web Container Id: 529cf9489088
Inspecting container 529cf9489088 to get the port mappings
Docker for Mac environment detected. Using the localhost for the container.
Waiting for container Id to be available for service 'db' time remaining: 499
db Container Id: fcd7bbf09acc
Inspecting container fcd7bbf09acc to get the port mappings
Docker for Mac environment detected. Using the localhost for the container.
The following endpoints are available for your local instance: 161905
+---------+------------------+-------------+--------------+----------------+--------------+---------+
| Service | Host:Port | Tag Version | Image Source | Container Port | Container Id | IsDebug |
+=========+==================+=============+==============+================+==============+=========+
| db | localhost:<none> | 9.6.1 | cache | <none> | fcd7bbf09acc | |
| web | localhost:5005 | latest | cache | 5005 | 529cf9489088 | |
| web | localhost:80 | latest | cache | 8080 | 529cf9489088 | |
+---------+------------------+-------------+--------------+----------------+--------------+---------+
Instance commands:
1) To stop instance from sbt run:
dockerComposeStop 161905
2) To open a command shell from bash run:
docker exec -it <Container Id> bash
3) To view log files from bash run:
docker-compose -p 161905 -f /var/folders/gy/swztjnld0cz0dm9s_45j_x0h0000gp/T/compose-updated6384060063410476934.yml logs -f
4) To execute test cases against instance from sbt run:
dockerComposeTest 161905
Compiling and Packaging test cases...
Discovery starting.
Discovery completed in 1 second, 163 milliseconds.
Run starting. Expected test count is: 4
PeopleSpec:
The people service
- should return OK if requesting the people form page
- should return non-empty content when requesting the people form page
- should return the expected content when requesting the people form page
- should leave GET requests to other paths unhandled
Run completed in 2 seconds, 945 milliseconds.
Total number of tests run: 4
Suites: completed 2, aborted 0
Tests: succeeded 4, failed 0, canceled 0, ignored 0, pending 0
All tests passed.
Stopping and removing local Docker instance: 161905
Stopping 161905_web_1 ... done
Stopping 161905_db_1 ... done
Removing 161905_web_1 ... done
Removing 161905_db_1 ... done
Going to remove 161905_web_1, 161905_db_1
161905_scala-js-example-network
>
from sbt-docker-compose.
Hi Kurt!
Thanks a ton for your quick and helpful reply!
Indeed, upgrading to the plugin's current version fixed the Could not find or load main class org.scalatest.tools.Runner
problem.
You were also right with the other two fixes.
from sbt-docker-compose.
Related Issues (20)
- Plugin starts tests even if not all containers are ready. HOT 4
- useStaticPorts does not seems to take effect HOT 2
- -debug doesn't work with specs2 HOT 2
- How to link my scala app's container, created by sbt-native-packager, to the dependency containers? HOT 1
- dockerComposeTest does not remove Docker instances when the compliation fails HOT 7
- multi project build with sbt-native-packager HOT 2
- DockerComposeTest does not pick up FeatureSpecs HOT 3
- Specs2 tests that have a different constructor don't run
- dockerComposeTest returns success on compilation error
- Provide dockerComposeTestOnly HOT 1
- Question - where does sbt-docker-compose plugin live? HOT 2
- Exception for invalid volume definition
- Configurable 'instanceName' (-p project-name)
- Forthcoming Deprecation / Transfer of Ownership Notice HOT 2
- SBT 1.3.3 breaks sbt-docker-compose
- dockerComposeTest doesn't include parent test scope in dependency classpath
- "Could not parse image id" HOT 1
- Support docker-compose 2.x HOT 3
- Run specs2 tests in multi-project code? HOT 4
- SBT 1.1.0-M1 compatibility issues HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-docker-compose.