This repository contains the take-home test exercises for Swarm developer interviews.
The exercises involve making changes to the HTTP API in the src
folder.
This readme file details how to get set up for development and build the project.
The exercises can be found here.
We've tried to make sure that it's as easy as possible to set up this repository.
For the best IDE experience, we strongly recommend that you use IntelliJ IDEA Community Edition while editing this project.
This is because Kotlin support in other editors is much less reliable and comprehensive.
The built-in plugins should be sufficient to use the workspace, but we recommend that you install the Kotest plugin as this will enable you to easily run tests from your IDE.
We'd suggest using one of the following setup options, from easiest to most difficult:
This option requires the least setup, as it opens a remote workspace with all of the required dependencies already configured.
First, install JetBrains Gateway, and connect to Gitpod.
Next, use this workspace link to connect to the workspace.
The workspace should open in IntelliJ. You will need to give IntelliJ some time to index dependencies - the downside of remote workspaces is that they can be a little slow!
This option requires that you have Docker Desktop installed for the best experience. We have had mixed results with other container runtimes like Colima and Podman.
If you're using IntelliJ you can start a Development Container using the devcontainer.json file in the repository.
Please see the IntelliJ documentation, which describes their Dev Container support.
To set up manually, you'll need to install the following things:
This project is a Spring Boot project built with Gradle.
You will need a Java 17 JDK installed in order to build this project.
You can install a JDK manually, via an installer like Homebrew or use a tool like SDKMAN! to manage the installation for you.
The project uses Docker Compose to run the project locally and Testcontainers for integration testing.
As a result, you'll need to install a Docker-compatible container runtime, such as Docker Desktop, Colima or Podman.
Please see the Testcontainers documentation for advice on configuring Testcontainers to work with Colima and Podman. Testcontainers should work out of the box with Docker Desktop.
gradle/libs.versions.toml
- a Gradle version catalog declaring the project dependenciessrc
- the source folder for the interview exercise app, a Spring Boot microservice written in Kotlin
The Gradle wrapper script ./gradlew
can be used to run Gradle tasks.
Note
The --info
flag is not necessary in the command examples below, but enables extra logging which may make it easier to understand what has happened when builds or tests fail.
To build and run all tests:
$ ./gradlew build --info
To run all tests:
$ ./gradlew check --info
To run only unit tests:
$ ./gradlew test --info
To run only integration tests:
$ ./gradlew integrationTest --info
To run the app:
$ ./gradlew bootRun --info
Tests are written using a Kotlin test framework called Kotest.
Quick start documentation for Kotest can be found here.
If you are using IntelliJ as your IDE, we recommend that you install the Kotest plugin.