Skip to content
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
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ allprojects {
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0"
resolutionStrategy.force "net.bytebuddy:byte-buddy:1.14.9"
resolutionStrategy.force "org.apache.commons:commons-lang3:3.18.0"
resolutionStrategy.force "com.google.errorprone:error_prone_annotations:2.45.0"
}
}

Expand Down
2 changes: 1 addition & 1 deletion doctest/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ fi

$DIR/.venv/bin/pip install -U pip setuptools wheel
$DIR/.venv/bin/pip install -r $DIR/requirements.txt
$DIR/.venv/bin/pip install -e ./sql-cli
$DIR/.venv/bin/pip install -e $DIR/sql-cli
11 changes: 5 additions & 6 deletions doctest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ def plugin_path = project(':doctest').projectDir

task cloneSqlCli(type: Exec) {
def repoDir = new File("${project.projectDir}/sql-cli")

if (repoDir.exists()) {
// Repository already exists, fetch and checkout latest
commandLine 'git', '-C', repoDir.absolutePath, 'fetch', 'origin', 'main'
commandLine 'git', '-C', repoDir.absolutePath, 'checkout', 'origin/main'
// Repository already exists, fetch and checkout stable branch
commandLine 'git', '-C', repoDir.absolutePath, 'fetch', 'origin', '1.0-legacy'
} else {
// Repository doesn't exist, clone it
commandLine 'git', 'clone', 'https://github.com/opensearch-project/sql-cli.git', repoDir.absolutePath
// Repository doesn't exist, clone the stable branch
commandLine 'git', 'clone', '-b', '1.0-legacy', 'https://github.com/opensearch-project/sql-cli.git', repoDir.absolutePath
}
}

Expand Down
13 changes: 13 additions & 0 deletions integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,20 @@ testClusters {
}
}

def isPrometheusRunning() {
try {
def process = "pgrep -f prometheus".execute()
def result = !process.text.trim().isEmpty()
return result
} catch (Exception e) {
return false
}
}

task startPrometheus(type: SpawnProcessTask) {
mustRunAfter ':doctest:doctest'
pidLockFileName ".prom.pid.lock"
onlyIf { !isPrometheusRunning() }

doFirst {
download.run {
Expand All @@ -275,6 +287,7 @@ task startPrometheus(type: SpawnProcessTask) {
}

task stopPrometheus(type: KillProcessTask) {
pidLockFileName ".prom.pid.lock"
doLast {
file("$projectDir/bin/prometheus").deleteDir()
file("$projectDir/bin/prometheus.tar.gz").delete()
Expand Down
1 change: 1 addition & 0 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ configurations.all {
resolutionStrategy.force "org.apache.httpcomponents:httpcore:4.4.15"
resolutionStrategy.force "org.apache.httpcomponents:httpclient:4.5.14"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-common:1.6.0"
resolutionStrategy.force "com.google.errorprone:error_prone_annotations:2.45.0"
}

configurations {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void testGetStorageEngineWithWrongAuthType() {
.thenReturn(Collections.emptyList());
PrometheusStorageFactory prometheusStorageFactory = new PrometheusStorageFactory(settings);
HashMap<String, String> properties = new HashMap<>();
properties.put("prometheus.uri", "https://test.com");
properties.put("prometheus.uri", "http://localhost:9090");
properties.put("prometheus.auth.type", "random");
properties.put("prometheus.auth.region", "us-east-1");
properties.put("prometheus.auth.secret_key", "accessKey");
Expand All @@ -150,7 +150,7 @@ void testGetStorageEngineWithNONEAuthType() {
.thenReturn(Collections.emptyList());
PrometheusStorageFactory prometheusStorageFactory = new PrometheusStorageFactory(settings);
HashMap<String, String> properties = new HashMap<>();
properties.put("prometheus.uri", "https://test.com");
properties.put("prometheus.uri", "http://localhost:9090");
StorageEngine storageEngine = prometheusStorageFactory.getStorageEngine(properties);
Assertions.assertTrue(storageEngine instanceof PrometheusStorageEngine);
}
Expand Down
Loading