InditexTech Karate Tools

Code

The code modules that implement Karate Tools.

The following sections will describe the code structure, to be able to find easily the location of the code to be added or modified.

The tests to be executed for the code modules are:

  • Unit & Mutation Tests:

    • Unit tests are used to test the classes and methods of the code modules.

    • Mutation tests are used to verify that the unit tests are effective.

  • Integration tests:

    • Integration tests are used to test the code modules together with external dependencies.

    • These tests are supported by a set of docker containers located in code/src/test/resources/compose

Unit, mutation and integration tests are required as status checks in the CI/CD pipeline pull request approval process. The level of coverage for each type of test must reach at least the defined threshold.
Karate tests are defined in the e2e/karate folder and are executed in the karatetools-oss-karate-test module.
Table 1. Tests Execution (Locally)
test command report verification

unit

cd code

mvn clean verify -DskipITs -DfailIfNoTests=false -Dmaven.test.failure.ignore=false

code/jacoco-report-aggregate/target/site/jacoco-aggregate/index.html

all tests pass and the code coverage generated by unit tests is at least 90%

mutation

cd code

mvn clean verify pitest:mutationCoverage pitest:report-aggregate-module -DskipITs

code/target/pit-reports/index.html

all tests pass and the mutation coverage is at least 90%

integration

cd code

mvn clean verify -DskipUTs -DfailIfNoTests=false -Dmaven.test.failure.ignore=false

code/jacoco-report-aggregate/target/site/jacoco-aggregate-it/index.html

all tests pass and the code coverage generated by integration tests is at least 80%

Table 2. Tests Execution (Github)
test command report verification

unit

  • workflow dispatch

  • automatically on PR

workflow execution reports

automatically on workflow execution

mutation

  • workflow dispatch

  • automatically on PR

workflow execution reports

automatically on workflow execution

integration

  • workflow dispatch

  • automatically on PR

workflow execution reports

automatically on workflow execution

compatibility

  • workflow dispatch

  • automatically on PR

workflow execution reports

automatically on workflow execution