Coder Social home page Coder Social logo

Comments (4)

kurtkopchik avatar kurtkopchik commented on September 25, 2024

Hi @fommil - Have you taken a look at the basic-with-tests-integration example?

#38

from sbt-docker-compose.

fommil avatar fommil commented on September 25, 2024

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.

kurtkopchik avatar kurtkopchik commented on September 25, 2024

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 separate performance 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 the core 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 the performance 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.

fommil avatar fommil commented on September 25, 2024

thanks Kurt, there was no need to do that 😄 once I realised that you intended for Commands 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.