Git Product home page Git Product logo

hmrc.sbt-service-manager's Introduction

sbt-service-manager

Build Status Download

An SBT plugin to start and stop service manager dependencies for integration test

Configuration

It requires to have configured service-manager in order to be able to use this plugin. You can find it how here

In your project/plugins.sbt file:

resolvers += Resolver.url("hmrc-sbt-plugin-releases",
  url("https://dl.bintray.com/hmrc/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

addSbtPlugin("uk.gov.hmrc" % "sbt-service-manager" % "x.x.x")

where 'x.x.x' is the latest release as advertised above.

In your project/FrontendBuild.scala or project/MicroserviceBuild.scala after the line .settings(inConfig(TemplateItTest)(Defaults.itSettings): _*)

  1. Add list of services that are required to be started.
lazy val externalServices = List(
    ExternalService(name = "SERVICE1", enableTestOnlyEndpoints = true, extraConfig = Map("key" -> "value"), runFrom = Source),
    ExternalService(name = "SERVICE2", enableTestOnlyEndpoints = false, runFrom = Jar)
)
  1. Add the line .settings(ServiceManagerPlugin.serviceManagerSettings)
  2. Add the line .settings(itDependenciesList := externalServices)

The attributes of ExternalService are:

  • name: Name of the service defined in the service-manager configuration.
  • enableTestOnlyEndpoints: To enable the test only endpoints. Default value is false.
  • extraConfig: Extra configuration required for the service. Default value is Map().
  • runFrom: Whether to run the service from 'Jar' or 'Source'. Default value is Jar.

Usage

Running sbt it:test will start the dependencies configured before running the tests and stop them at then end. Run sbt startItDependencies will start the dependencies configured. Run sbt stopItDependencies will stop the dependencies configured. Run sbt itDependenciesList will show the dependencies configured.

License

This code is open source software licensed under the Apache 2.0 License.

hmrc.sbt-service-manager's People

Contributors

carlosgarciapuerta avatar hmrc-web-operations avatar aadilakhtar avatar davidrymer97 avatar tonytw1 avatar adwelly avatar cjwebb avatar cellis-ee avatar richard-dennehy avatar tomasz-rosiek avatar calinursaciuc avatar rameshuk avatar

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.