Skip to content

This repository contains the sample code used during the "Running Docker-Based Integration Tests in Scala: A Case Study" presentation at ScalaDays 2023

License

Notifications You must be signed in to change notification settings

mdipirro/docker-tests-scaladays2023

Repository files navigation

Running Docker-Based Integration Tests in Scala: A Case Study

This repository contains the code used in the Running Docker-Based Integration Tests in Scala: A Case Study talk at ScalaDays Madrid 2023.

In particular, it defines three SBT projects:

  • The main project contains the code of a simple HTTP application. Such an application simply opens a socket on the 8080 port, waiting for incoming connections. The webpage it returns is quite simple and only shows the message "Hello, Madrid";
  • The sbt-docker-compose subproject contains the integration tests written using SBT-docker-compose;
  • The test-containers subproject contains the integration tests written using TestContainers-scala.

SBT-docker-compose

To run the tests in the sbt-docker-compose subproject, open an SBT shell and use the following commands:

project sbtDockerCompose
dockerComposeTest

SBT will build a new Docker image named scala-days-2023 and tagged with latest. It will then use it to run the tests implemented in SampleSbtDockerComposeSpec.

Test Containers

To run the tests in the test-containers subproject, open an SBT shell and use the following command:

testContainers / test

SBT will build a new Docker image named scala-days-2023 and tagged with 1.0.0. It will then use it to run the tests implemented in SampleTestContainersSpec.

About

This repository contains the sample code used during the "Running Docker-Based Integration Tests in Scala: A Case Study" presentation at ScalaDays 2023

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages