Skip to content

opencastsoftware/swarm-interview

Repository files navigation

swarm-interview

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.

Prerequisites

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:

1. Set up via Gitpod

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!

2. Set up via Development Containers (IntelliJ Ultimate only)

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.

3. Set up manually

To set up manually, you'll need to install the following things:

Java JDK

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.

Container runtime

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.

Project structure

  • gradle/libs.versions.toml - a Gradle version catalog declaring the project dependencies
  • src - the source folder for the interview exercise app, a Spring Boot microservice written in Kotlin

Common build tasks

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.

Build the project

To build and run all tests:

$ ./gradlew build --info

Run tests

To run all tests:

$ ./gradlew check --info

Run only unit tests

To run only unit tests:

$ ./gradlew test --info

Run only integration tests

To run only integration tests:

$ ./gradlew integrationTest --info

Run the application

To run the app:

$ ./gradlew bootRun --info

Unit testing

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.

About

Interview exercises for Swarm interviews

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages