sbt-docker-compose icon indicating copy to clipboard operation
sbt-docker-compose copied to clipboard

Support arbitrary SBT test configurations

Open gordon-rennie opened this issue 4 years ago • 0 comments

I would like to create a new test configuration I consider distinct from integration tests, say ServiceTest:

# build.sbt
val ServiceTest = Configuration.of("ServiceTest", "servicetest").extend(IntegrationTest)

lazy val root = (project in file("."))
  .enablePlugins(DockerCompose)
  .configs(
    Configurations.IntegrationTest,
    ServiceTest
  )
  ...

However, when I try to run my custom task ServiceTest/test with dockerComposeTest I receive error:

sbt:my-project > dockerComposeTest ServiceTest/test
[error] Expected whitespace character
[error] Expected '/'
[error] Expected '-f'
[error] Expected '--file'
... redacted...
[error] Expected 'test'
[error] Expected 'testQuick'
[error] Expected 'testOnly'
[error] Expected 'it:test'
[error] Expected 'it:testQuick'
[error] Expected 'it:testOnly'
[error] dockerComposeTest ServiceTest/test

In other words, the only currently allowed test commands are test, testQuick, testOnly, it:test, it:testQuick, it:testOnly. This constrains the plugin's use cases and flexibility. It would be great to open this up to any test configurations and commands.

(as a secondary problem, It also hard-codes in the deprecated SBT 0.13 syntax - it:test should now be IntegrationTest/test.)

gordon-rennie avatar Oct 08 '21 13:10 gordon-rennie