-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into extension-handshake
- Loading branch information
Showing
314 changed files
with
9,670 additions
and
1,868 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ BWC_VERSION: | |
- "2.6.0" | ||
- "2.6.1" | ||
- "2.7.0" | ||
- "2.8.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
buildSrc/src/main/java/org/opensearch/gradle/jvm/JvmTestSuiteHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.gradle.jvm; | ||
|
||
import org.gradle.api.Project; | ||
import org.gradle.api.plugins.JvmTestSuitePlugin; | ||
import org.gradle.api.plugins.jvm.JvmTestSuite; | ||
import org.gradle.testing.base.TestSuite; | ||
import org.gradle.testing.base.TestingExtension; | ||
|
||
import java.util.Optional; | ||
|
||
public final class JvmTestSuiteHelper { | ||
private JvmTestSuiteHelper() {} | ||
|
||
/** | ||
* Gets the default test suite. This method assumes the Java plugin is applied, | ||
* adapted from {@link org.gradle.api.plugins.internal.JavaPluginHelper} since it is not | ||
* available in Gradle releases predated 8.1. | ||
*/ | ||
public static Optional<JvmTestSuite> getDefaultTestSuite(Project project) { | ||
TestingExtension testing = project.getExtensions().findByType(TestingExtension.class); | ||
if (testing == null) { | ||
return Optional.empty(); | ||
} | ||
|
||
TestSuite defaultTestSuite = testing.getSuites().findByName(JvmTestSuitePlugin.DEFAULT_TEST_SUITE_NAME); | ||
if (!(defaultTestSuite instanceof JvmTestSuite)) { | ||
return Optional.empty(); | ||
} | ||
|
||
return Optional.of((JvmTestSuite) defaultTestSuite); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.