Table of Contents
- Preliminary steps
- Install plugins
- Import project
- Setting up build configurations
- While working on Protobuf stuff
- Dropbox integration testing
The project is developed using Intelliji Idea. Community Edition should work fine. All further steps assume you have it already installed.
- Make sure you have Java 11 installed (the JDK version is as an example, Oracle JDK will do either), for some of the tests
kotlinc
should be also available:
> java -version
openjdk version "11.0.16.1" 2022-08-12
OpenJDK Runtime Environment Homebrew (build 11.0.16.1+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.16.1+0, mixed mode)
> kotlinc -version
info: kotlinc-jvm 1.7.10 (JRE 19)
- Clone repository
git clone [email protected]:WaveBeans/wavebeans.git
- Make your first build and wait test to pass. No special requirements here.
./gradlew build
A few extra plugins you need to make sure you have installed.
- To run tests using IDE: Kotest plugin
- For older non-migrated tests: Spek Framework plugin.
- For protobuf support: Protobuf support plugin
To import the project just open via File > Open
in IDE the build.gradle.kts
file in the root directory of the project, select Open as project
. Select to use gradle wrapper.
A few basic configurations are handy to create. Especially for running tests. As by the time of writing this there was no way found to run all tests at once, as well as using Spek plugin. So you need to cre JUnit runner and repeat steps for all projects (lib
, exe
, cli
, http
).
- Create configuration, then select
JUnit
. - Name configuration, for example
LIB tests
. - Select
Test kind: All in package
. - Select
Search for tests: In single module
. - Select
Use classpath or module: io.wavebeans.lib.test
(or corresponding to the project). - Add additional VM option
-DSPEK_TIMEOUT=0
as some tests are taking more than default 10 seconds timeout and failing weirdly.
IDE doesn't currently build automatically proto-files, but all source folders are configured correctly. Every time you change them (or cleaned the project) regenerate them by running gradle command:
./gradlew clean generateProto
When running all tests or testing DropBox related stuff, you may need to specify dropbox integration parameters. They are specified via environment variables DBX_TEST_CLIENT_ID
and DBX_TEST_ACCESS_TOKEN
. On GitHub they are stored in project secrets and are being provided during build time, though on your local environment you may create your own.
First of all follow the docs to fetch required values. And then:
- To run via gradle, use
export
if you're on zsh-like shell or store commands directly into you.zshrc
:export DBX_TEST_CLIENT_ID=test-client-id export DBX_TEST_ACCESS_TOKEN=access-token
- To conveniently run in Intelliji IDEA and a default parameter into and Spek runners:
Run/Debug configurations > Templates > Spek 2 - JVM
- Add both values under environment variables.