Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 2.74 KB

CONTRIBUTING.md

File metadata and controls

50 lines (33 loc) · 2.74 KB

Local builds

Preconditions

  • Java 8 or newer

Running local builds

To run local builds, execute ./gradlew build which will download all dependencies and then will compile and test the project.

The project uses Dokka for documentation generation (analogue of Javadoc on Kotlin world). This process might take some time, however if you'd like to disable it please specify the following property in your user gradle.properties file: com.citi.gradle.helm.plugin.dokka.disabled=true.

Tests

Project has tests, based on two frameworks:

  • gradle-plugin-test-utils, which use Spek framework inside. Please note, that both projects aren't supported well (for example, see this)
  • JUnit + KoTest, which is used for new tests. JUnit 5 is used to run tests, KoTest is used for assertions only (because they are much more convenient via achieving Kotlin language advantages; however KoTest requires IntelliJ plugin to run single test, which might be inconvenient for developers).

Both frameworks use JUnit test runner, therefore ./gradlew test covers all unit tests.

See also #6

Functional tests

Please read Gradle advices first about the test writing. One of recommendations is to use separate source set and task to run functional tests, because unit tests inherit classpath from plugin, which might be risky for functional tests.

Therefore, tests covering entire plugin (plus potential different gradle versions verification) are separated to different source set and to different task. Please run ./gradlew functionalTest task for that purpose.

Functional tests download distribution archives from https://services.gradle.org/distributions. If you'd like to use another web server (for example, corporate artifacts provider) - please configure gradle property com.citi.gradle.helm.plugin.distribution.url.prefix in ~/.gradle/gradle.properties

Helm executable replacement

We don't need to use Helm executable to validate some parts of the plugin. For example, helm-publish plugin doesn't need to build any chart.

To simulate helm, tests use .bat and .sh files (for example, helm-create-tgz.sh). They don't build charts. Instead, they only put some files into the destination folder (e.g. simulate chart building).