Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a custom task integTest to trigger integration tests. #114

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Build LTR Plugin
- name: Build and Run Tests
run: |
chown -R 1000:1000 `pwd`
su `id -un 1000` -c 'whoami && java -version &&
Expand Down
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import java.nio.file.Files
import org.opensearch.gradle.test.RestIntegTestTask

buildscript {
ext {
Expand Down Expand Up @@ -173,6 +174,19 @@ validateNebulaPom.enabled = false
// https://github.com/elastic/opensearch/issues/65247
loggerUsageCheck.enabled = false

// Custom task for running integration tests
task integTest(type: RestIntegTestTask) {
description = "Run integration tests from src/javaRestTest"
// Specify the classpath for integration tests
testClassesDirs = sourceSets.javaRestTest.output.classesDirs
classpath = sourceSets.javaRestTest.runtimeClasspath
}

testClusters.integTest {
// adds LTR as a plugin to the OS build
plugin(project.tasks.bundlePlugin.archiveFile)
}

tasks.withType(Test).configureEach { task ->
if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) > 0 && JavaVersion.current().compareTo(JavaVersion.VERSION_21) < 0) {
def policyFile = file("${projectDir}/src/main/plugin-metadata/plugin-security.policy").absolutePath
Expand Down
Loading