Skip to content

Commit

Permalink
Merge pull request opensearch-project#170 from Bit-Quill/testing-muta…
Browse files Browse the repository at this point in the history
…tionTesting

Adding mutation testing to build gradle with PiTest
  • Loading branch information
MitchellGale authored Dec 21, 2022
2 parents 0504c71 + 4a59426 commit 717ee28
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ jobs:
- name: Build with Gradle
run: ./gradlew --continue build ${{ matrix.entry.os_build_args }}

- name: PiTest with Gradle
run: |
./gradlew :core:pitest
./gradlew :opensearch:pitest

- name: Run backward compatibility tests
if: ${{ matrix.entry.os == 'ubuntu-latest' }}
run: ./scripts/bwctest.sh
Expand Down
11 changes: 11 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ plugins {
id 'java-library'
id "io.freefair.lombok"
id 'jacoco'
id 'info.solidsoft.pitest' version '1.9.0'
}

repositories {
Expand All @@ -38,6 +39,16 @@ repositories {
// }
//}

pitest {
targetClasses = ['org.opensearch.sql.*']
pitestVersion = '1.9.0'
threads = 4
outputFormats = ['HTML', 'XML']
timestampedReports = false
junit5PluginVersion = '1.0.0'
mutationThreshold = 85
}

dependencies {
api group: 'com.google.guava', name: 'guava', version: '31.0.1-jre'
api group: 'org.springframework', name: 'spring-context', version: "${spring_version}"
Expand Down
11 changes: 11 additions & 0 deletions opensearch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ plugins {
id 'java-library'
id "io.freefair.lombok"
id 'jacoco'
id 'info.solidsoft.pitest' version '1.9.0'
}

dependencies {
Expand All @@ -47,6 +48,16 @@ dependencies {
testImplementation group: 'org.opensearch.test', name: 'framework', version: "${opensearch_version}"
}

pitest {
targetClasses = ['org.opensearch.sql.*']
pitestVersion = '1.9.0'
threads = 4
outputFormats = ['HTML', 'XML']
timestampedReports = false
junit5PluginVersion = '1.0.0'
mutationThreshold = 70
}

test {
useJUnitPlatform()
testLogging {
Expand Down

0 comments on commit 717ee28

Please sign in to comment.