Comments (4)
Hi @fommil - Have you taken a look at the basic-with-tests-integration example?
from sbt-docker-compose.
I have now, thanks. But that's not doing what I'm looking for (I don't think... at least I am not confused about how to set up against a specific test scope).
Let's say I have a multiple project build, with core
(which has integration tests) and performance
which is a performance test benchmark. I have a docker compose file that I want to run before I run my core/it:test
task and I have a different docker compose file that I want to run for my performance
benchmarks.
from sbt-docker-compose.
Hi @fommil - To do this you would define a separate docker-compose.yml
file and set of tests within both the performance
and core
projects. The docker-compose.yml
file in the performance
project can be defined to reference the image built within the core
project using the <localBuild>
tag on the image:
definition.
I pushed a sample project multi-project-2 on a branch to show you how:
-
In
build.sbt
a separateperformance
project created. -
This project has it's own docker-compose definition file. You can put whatever you would like in this compose file for your
performance
configuration but I set it to use the same image built by thecore
project. This is done with the<localBuild>
defined on the image:
image: core:latest<localBuild>
-
This project also defines it's own set of performance test cases that are run against this docker-compose config when
dockerCompseTest
is executed within the scope of this project. -
Executing both the
core
set tests theperformance
suite of tests, each with there own compose file definitions, would look like the following:
> projects
[info] core
[info] * multi-project-2
[info] performance
> project core
> dockerComposeTest
Starting Test Pass against a new local Docker Compose instance.
...
CoreSpec:
Map(core:5005 -> localhost:32843, core:8080 -> localhost:32842, core:containerId -> f8d761ede773)
Attempting to connect to: localhost:32842, container id is f8d761ede773
- Core Test: Validate that the Docker Compose endpoint returns a success code and the string 'Hello, World!'
Run completed in 240 milliseconds.
Total number of tests run: 1
...
> project performance
> dockerComposeTest
Starting Test Pass against a new local Docker Compose instance.
...
PerformanceSpec:
Add performance testing code here...
- Peformance Test: Template'
Run completed in 116 milliseconds.
Total number of tests run: 1
...
>
from sbt-docker-compose.
thanks Kurt, there was no need to do that 😄 once I realised that you intended for Command
s to be used this way it made sense... I think it would be a lot easier to understand if everything was a Task
instead of a Command
. Is there any particular reason why you did it this way?
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.