From 2001f86a6932dc062215aa566162dd45facef56f Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Tue, 15 Nov 2022 09:51:35 -0800 Subject: [PATCH 01/14] Adding pitest to build.gradle Signed-off-by: MitchellGale-BitQuill --- build.gradle | 1 + .../test/java/org/opensearch/sql/sql/IdentifierIT.java | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index a9a171da01..3f1afe7ebb 100644 --- a/build.gradle +++ b/build.gradle @@ -67,6 +67,7 @@ plugins { id 'checkstyle' id "io.freefair.lombok" version "6.4.0" id 'jacoco' + id 'info.solidsoft.pitest' version '1.9.0' } // Repository on root level is for dependencies that project code depends on. And this block must be placed after plugins{} diff --git a/integ-test/src/test/java/org/opensearch/sql/sql/IdentifierIT.java b/integ-test/src/test/java/org/opensearch/sql/sql/IdentifierIT.java index 591364ea19..f7537c26b2 100644 --- a/integ-test/src/test/java/org/opensearch/sql/sql/IdentifierIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/sql/IdentifierIT.java @@ -38,11 +38,11 @@ public void testSpecialIndexNames() throws IOException { queryAndAssertTheDoc("SELECT * FROM logs-2020-01"); } - @Test - public void testQuotedIndexNames() throws IOException { - createIndexWithOneDoc("logs+2020+01", "logs.2020.01"); - queryAndAssertTheDoc("SELECT * FROM `logs+2020+01`"); - } +// @Test +// public void testQuotedIndexNames() throws IOException { +// createIndexWithOneDoc("logs+2020+01", "logs.2020.01"); +// queryAndAssertTheDoc("SELECT * FROM `logs+2020+01`"); +// } @Test public void testSpecialFieldName() throws IOException { From dc5a36013142da1ecef11fae220687b37360cea9 Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Wed, 16 Nov 2022 08:34:12 -0800 Subject: [PATCH 02/14] updated build gradle. Signed-off-by: MitchellGale-BitQuill --- build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index 3f1afe7ebb..d48a7929e0 100644 --- a/build.gradle +++ b/build.gradle @@ -67,9 +67,20 @@ plugins { id 'checkstyle' id "io.freefair.lombok" version "6.4.0" id 'jacoco' + id 'java' id 'info.solidsoft.pitest' version '1.9.0' } +pitest { + targetClasses = ['org.opensearch.sql.expression.*'] //by default "${project.group}.*"'testPlugin = "junit + targetTests = ['org.opensearch.sql.expression.*'] +// testPlugin = "junit5" +// pitestVersion = '1.9.0' //not needed when a default PIT version should be used +// threads = 4 +// outputFormats = ['XML', 'HTML'] +// timestampedReports = false +} + // Repository on root level is for dependencies that project code depends on. And this block must be placed after plugins{} repositories { mavenLocal() From 492839d3457705f99e876357197c462b8d756a65 Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Wed, 16 Nov 2022 15:06:21 -0800 Subject: [PATCH 03/14] updated build gradle. Signed-off-by: MitchellGale-BitQuill --- core/build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/build.gradle b/core/build.gradle index eb70f110d1..7f2da52c78 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -26,6 +26,7 @@ plugins { id 'java-library' id "io.freefair.lombok" id 'jacoco' + id 'info.solidsoft.pitest' version '1.9.0' } repositories { @@ -38,6 +39,15 @@ repositories { // } //} +pitest { + targetClasses = ['org.opensearch.sql.*'] + pitestVersion = '1.9.0' + threads = 4 + outputFormats = ['XML', 'HTML'] + timestampedReports = false + junit5PluginVersion = '1.0.0' +} + dependencies { api group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' api group: 'org.springframework', name: 'spring-context', version: "${spring_version}" From bade153f0c8bb57c6a7b9b9d07db4f041bb396cd Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill <104795536+MitchellGale-BitQuill@users.noreply.github.com> Date: Fri, 18 Nov 2022 10:48:46 -0800 Subject: [PATCH 04/14] Removed changes to non-core gradle and test. Signed-off-by: MitchellGale-BitQuill --- build.gradle | 12 ------------ .../java/org/opensearch/sql/sql/IdentifierIT.java | 10 +++++----- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index d48a7929e0..a9a171da01 100644 --- a/build.gradle +++ b/build.gradle @@ -67,18 +67,6 @@ plugins { id 'checkstyle' id "io.freefair.lombok" version "6.4.0" id 'jacoco' - id 'java' - id 'info.solidsoft.pitest' version '1.9.0' -} - -pitest { - targetClasses = ['org.opensearch.sql.expression.*'] //by default "${project.group}.*"'testPlugin = "junit - targetTests = ['org.opensearch.sql.expression.*'] -// testPlugin = "junit5" -// pitestVersion = '1.9.0' //not needed when a default PIT version should be used -// threads = 4 -// outputFormats = ['XML', 'HTML'] -// timestampedReports = false } // Repository on root level is for dependencies that project code depends on. And this block must be placed after plugins{} diff --git a/integ-test/src/test/java/org/opensearch/sql/sql/IdentifierIT.java b/integ-test/src/test/java/org/opensearch/sql/sql/IdentifierIT.java index f7537c26b2..591364ea19 100644 --- a/integ-test/src/test/java/org/opensearch/sql/sql/IdentifierIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/sql/IdentifierIT.java @@ -38,11 +38,11 @@ public void testSpecialIndexNames() throws IOException { queryAndAssertTheDoc("SELECT * FROM logs-2020-01"); } -// @Test -// public void testQuotedIndexNames() throws IOException { -// createIndexWithOneDoc("logs+2020+01", "logs.2020.01"); -// queryAndAssertTheDoc("SELECT * FROM `logs+2020+01`"); -// } + @Test + public void testQuotedIndexNames() throws IOException { + createIndexWithOneDoc("logs+2020+01", "logs.2020.01"); + queryAndAssertTheDoc("SELECT * FROM `logs+2020+01`"); + } @Test public void testSpecialFieldName() throws IOException { From 8e37d1674c52030430228ebd7d47fe40f77d3dd0 Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Mon, 19 Dec 2022 13:34:51 -0800 Subject: [PATCH 05/14] Updating yml for pitest. Signed-off-by: MitchellGale-BitQuill --- .github/workflows/sql-test-and-build-workflow.yml | 4 ++++ core/build.gradle | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sql-test-and-build-workflow.yml b/.github/workflows/sql-test-and-build-workflow.yml index 3d063a2bfc..c7fed6b1d1 100644 --- a/.github/workflows/sql-test-and-build-workflow.yml +++ b/.github/workflows/sql-test-and-build-workflow.yml @@ -44,6 +44,9 @@ jobs: - name: Build with Gradle run: ./gradlew --continue build ${{ matrix.entry.os_build_args }} + - name: PiTest with Gradle + run: ./gradlew pitest + - name: Run backward compatibility tests if: ${{ matrix.entry.os == 'ubuntu-latest' }} run: ./scripts/bwctest.sh @@ -82,3 +85,4 @@ jobs: protocol/build/reports/** legacy/build/reports/** plugin/build/reports/** + pitest/build/reports/** diff --git a/core/build.gradle b/core/build.gradle index 7f2da52c78..072ab66078 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -43,9 +43,11 @@ pitest { targetClasses = ['org.opensearch.sql.*'] pitestVersion = '1.9.0' threads = 4 - outputFormats = ['XML', 'HTML'] + outputFormats = ['XML'] timestampedReports = false junit5PluginVersion = '1.0.0' + historyInputLocation = + historyOutputLocation = } dependencies { From cefe052930d48efb71446319de7e2a82fc759a33 Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Mon, 19 Dec 2022 13:38:14 -0800 Subject: [PATCH 06/14] Commented out history input/output for pitest Signed-off-by: MitchellGale-BitQuill --- core/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/build.gradle b/core/build.gradle index 072ab66078..11d71fce93 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -46,8 +46,8 @@ pitest { outputFormats = ['XML'] timestampedReports = false junit5PluginVersion = '1.0.0' - historyInputLocation = - historyOutputLocation = +// historyInputLocation = +// historyOutputLocation = } dependencies { From 065b9cf1c7264e9306eeb38b8bfb325f49c615b9 Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Tue, 20 Dec 2022 15:29:10 -0800 Subject: [PATCH 07/14] Added pitest debug Signed-off-by: MitchellGale-BitQuill --- .github/workflows/sql-test-and-build-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sql-test-and-build-workflow.yml b/.github/workflows/sql-test-and-build-workflow.yml index c7fed6b1d1..b981acc45a 100644 --- a/.github/workflows/sql-test-and-build-workflow.yml +++ b/.github/workflows/sql-test-and-build-workflow.yml @@ -45,7 +45,7 @@ jobs: run: ./gradlew --continue build ${{ matrix.entry.os_build_args }} - name: PiTest with Gradle - run: ./gradlew pitest + run: ./gradlew pitest --debug - name: Run backward compatibility tests if: ${{ matrix.entry.os == 'ubuntu-latest' }} From 900a5fca827d16d1f34ee3dd9a3b086d1a83eb45 Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Tue, 20 Dec 2022 18:31:38 -0800 Subject: [PATCH 08/14] fixed pitest Signed-off-by: MitchellGale-BitQuill --- .github/workflows/sql-test-and-build-workflow.yml | 2 +- core/build.gradle | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sql-test-and-build-workflow.yml b/.github/workflows/sql-test-and-build-workflow.yml index b981acc45a..e03ca0f442 100644 --- a/.github/workflows/sql-test-and-build-workflow.yml +++ b/.github/workflows/sql-test-and-build-workflow.yml @@ -45,7 +45,7 @@ jobs: run: ./gradlew --continue build ${{ matrix.entry.os_build_args }} - name: PiTest with Gradle - run: ./gradlew pitest --debug + run: ./gradlew core:pitest - name: Run backward compatibility tests if: ${{ matrix.entry.os == 'ubuntu-latest' }} diff --git a/core/build.gradle b/core/build.gradle index 11d71fce93..e2eab88f74 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -42,9 +42,9 @@ repositories { pitest { targetClasses = ['org.opensearch.sql.*'] pitestVersion = '1.9.0' - threads = 4 - outputFormats = ['XML'] - timestampedReports = false +// threads = 4 + outputFormats = ['XML', 'HTML'] +// timestampedReports = false junit5PluginVersion = '1.0.0' // historyInputLocation = // historyOutputLocation = From 7fe527744755c77f39ac6ec681f0a075d039455d Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Tue, 20 Dec 2022 21:28:52 -0800 Subject: [PATCH 09/14] fixed pitest 2... Signed-off-by: MitchellGale-BitQuill --- .github/workflows/sql-test-and-build-workflow.yml | 2 +- core/build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sql-test-and-build-workflow.yml b/.github/workflows/sql-test-and-build-workflow.yml index e03ca0f442..00606d1a83 100644 --- a/.github/workflows/sql-test-and-build-workflow.yml +++ b/.github/workflows/sql-test-and-build-workflow.yml @@ -45,7 +45,7 @@ jobs: run: ./gradlew --continue build ${{ matrix.entry.os_build_args }} - name: PiTest with Gradle - run: ./gradlew core:pitest + run: ./gradlew :core:pitest - name: Run backward compatibility tests if: ${{ matrix.entry.os == 'ubuntu-latest' }} diff --git a/core/build.gradle b/core/build.gradle index e2eab88f74..5d41dcf296 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -43,8 +43,8 @@ pitest { targetClasses = ['org.opensearch.sql.*'] pitestVersion = '1.9.0' // threads = 4 - outputFormats = ['XML', 'HTML'] -// timestampedReports = false + outputFormats = ['HTML'] + timestampedReports = false junit5PluginVersion = '1.0.0' // historyInputLocation = // historyOutputLocation = From 3d6fa05a7a7a87570990e1e8727a871ba98aef75 Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Tue, 20 Dec 2022 23:30:47 -0800 Subject: [PATCH 10/14] Added mutationThreshold AS INT Signed-off-by: MitchellGale-BitQuill --- .github/workflows/sql-test-and-build-workflow.yml | 1 - core/build.gradle | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sql-test-and-build-workflow.yml b/.github/workflows/sql-test-and-build-workflow.yml index 00606d1a83..95a70d44ab 100644 --- a/.github/workflows/sql-test-and-build-workflow.yml +++ b/.github/workflows/sql-test-and-build-workflow.yml @@ -85,4 +85,3 @@ jobs: protocol/build/reports/** legacy/build/reports/** plugin/build/reports/** - pitest/build/reports/** diff --git a/core/build.gradle b/core/build.gradle index 5d41dcf296..b6053d55c8 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -46,6 +46,7 @@ pitest { outputFormats = ['HTML'] timestampedReports = false junit5PluginVersion = '1.0.0' + mutationThreshold = 80 // historyInputLocation = // historyOutputLocation = } From a8b33515017fdef93e1ef2f4c5180176dbb668e9 Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Tue, 20 Dec 2022 23:31:09 -0800 Subject: [PATCH 11/14] Added mutationThreshold AS string Signed-off-by: MitchellGale-BitQuill --- core/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/build.gradle b/core/build.gradle index b6053d55c8..513a0553e0 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -46,7 +46,7 @@ pitest { outputFormats = ['HTML'] timestampedReports = false junit5PluginVersion = '1.0.0' - mutationThreshold = 80 + mutationThreshold = '80' // historyInputLocation = // historyOutputLocation = } From 3cce92e99e715a248ccba6a46a55beef4334fd89 Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Tue, 20 Dec 2022 23:36:36 -0800 Subject: [PATCH 12/14] Added mutationThreshold AS 85% Signed-off-by: MitchellGale-BitQuill --- core/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/build.gradle b/core/build.gradle index 513a0553e0..37d38b8ad2 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -46,7 +46,7 @@ pitest { outputFormats = ['HTML'] timestampedReports = false junit5PluginVersion = '1.0.0' - mutationThreshold = '80' + mutationThreshold = 85 // historyInputLocation = // historyOutputLocation = } From 78d5a7ba4397f0458ba3f7ddcb4c537e97988669 Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Tue, 20 Dec 2022 23:46:04 -0800 Subject: [PATCH 13/14] Added mutationThreshold AS 85% Signed-off-by: MitchellGale-BitQuill --- core/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/build.gradle b/core/build.gradle index 37d38b8ad2..6e9b92a77f 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -42,8 +42,8 @@ repositories { pitest { targetClasses = ['org.opensearch.sql.*'] pitestVersion = '1.9.0' -// threads = 4 - outputFormats = ['HTML'] + threads = 4 + outputFormats = ['HTML', 'XML'] timestampedReports = false junit5PluginVersion = '1.0.0' mutationThreshold = 85 From 4a594264aed2037729cb710be76c58687bb0b94d Mon Sep 17 00:00:00 2001 From: MitchellGale-BitQuill Date: Wed, 21 Dec 2022 10:37:43 -0800 Subject: [PATCH 14/14] Added common to pitest Signed-off-by: MitchellGale-BitQuill --- .github/workflows/sql-test-and-build-workflow.yml | 5 ++++- core/build.gradle | 2 -- opensearch/build.gradle | 11 +++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sql-test-and-build-workflow.yml b/.github/workflows/sql-test-and-build-workflow.yml index 95a70d44ab..d5a3ab9b26 100644 --- a/.github/workflows/sql-test-and-build-workflow.yml +++ b/.github/workflows/sql-test-and-build-workflow.yml @@ -45,7 +45,10 @@ jobs: run: ./gradlew --continue build ${{ matrix.entry.os_build_args }} - name: PiTest with Gradle - run: ./gradlew :core:pitest + run: | + ./gradlew :core:pitest + ./gradlew :opensearch:pitest + - name: Run backward compatibility tests if: ${{ matrix.entry.os == 'ubuntu-latest' }} diff --git a/core/build.gradle b/core/build.gradle index 6e9b92a77f..a2b476a749 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -47,8 +47,6 @@ pitest { timestampedReports = false junit5PluginVersion = '1.0.0' mutationThreshold = 85 -// historyInputLocation = -// historyOutputLocation = } dependencies { diff --git a/opensearch/build.gradle b/opensearch/build.gradle index 7ad7d63546..cf5b5465c2 100644 --- a/opensearch/build.gradle +++ b/opensearch/build.gradle @@ -26,6 +26,7 @@ plugins { id 'java-library' id "io.freefair.lombok" id 'jacoco' + id 'info.solidsoft.pitest' version '1.9.0' } dependencies { @@ -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 {