Skip to content

Latest commit

 

History

History
95 lines (62 loc) · 3.82 KB

development-environment.md

File metadata and controls

95 lines (62 loc) · 3.82 KB

Development environment

To set up a development environment, we designed a Visual Studio Code Dev Container that includes all the necessary tooling and Visual Studio Code (VS Code) extensions that you need to work on this project. We use this dev container to build the project from both VS Code and the command-line.

Dev container configuration

To inspect the development environment container image configuration and build descriptors, refer to the contents of the .devcontainer directory:

For more information about creating containerized development environments, refer to Create a development container.

Develop inside a container running on a remote host

If you don't have a container runtime engine on your local host, but you have one available on a remote host, you can connect to the remote host and use that container runtime. For more information, refer to Develop on a remote Docker host.

Requirements

To setup a development environment you need:

  • A POSIX-compliant shell
  • An OCI-compatible container runtime. Tested with Docker for Linux 20.10.21
  • Visual Studio Code, if you need to modify any part of this set of software components. Other editors and IDEs might work fine.

Run the test suite

To ensure that things work as expected, we developed a comprehensive integration test suite that uses containerized instances of Mosquitto (an open-source MQTT broker) and the Cloud Pub/Sub emulator to simulate a runtime environment.

You can run the test suite either from Visual Studio Code, or from the command-line, after cloning this repository.

Run Java unit and integration tests from Visual Studio Code

To run tests from Visual Studio Code:

  1. Open the root directory of this repository with Visual Studio Code as a workspace. Visual Studio should prompt you to start the Dev Container.
  2. Open the Java Projects panel or open the JUnit test file from src/test/java.
  3. Click on the play icon near the test or the test suite that you want to run.

Build the project and run the test suite from the command-line

To run tests from the command-line, do the following:

  1. Open a POSIX-compliant shell.

  2. Change your working directory to the root directory of this repository.

  3. Run the build process:

    scripts/build.sh

Code linting

This project runs two code linters:

Both run as part of the build process.

Automatically fix linting errors with Spotless

To automatically fix linting errors that Spotless finds, do the following:

  1. Open a POSIX-compliant shell.

  2. Change your working directory to the root directory of this repository.

  3. Run the build process:

    scripts/build.sh --fix-linting-errors

super-linter doesn't support automatically fixing errors.

Lint configuration

All the linters have their configuration stored in the config/lint directory. Additionally, some linters shipped within super-linter also take the EditorConfig configuration file into account.

Details about the build process

For more information about the build process, refer to Build and release processes