Skip to content

Commit 845367e

Browse files
committed
fixed all failing CIs from previous commits
Signed-off-by: Eric Wei <mengwei.eric@gmail.com>
1 parent c7dc675 commit 845367e

4 files changed

Lines changed: 21 additions & 9 deletions

File tree

doctest/bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ fi
2121

2222
$DIR/.venv/bin/pip install -U pip setuptools wheel
2323
$DIR/.venv/bin/pip install -r $DIR/requirements.txt
24-
$DIR/.venv/bin/pip install -e ./sql-cli
24+
$DIR/.venv/bin/pip install -e $DIR/sql-cli

doctest/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ def plugin_path = project(':doctest').projectDir
2222

2323
task cloneSqlCli(type: Exec) {
2424
def repoDir = new File("${project.projectDir}/sql-cli")
25-
25+
2626
if (repoDir.exists()) {
27-
// Repository already exists, fetch and checkout latest
28-
commandLine 'git', '-C', repoDir.absolutePath, 'fetch', 'origin', 'main'
29-
commandLine 'git', '-C', repoDir.absolutePath, 'checkout', 'origin/main'
27+
// Repository already exists, fetch and checkout stable branch
28+
commandLine 'git', '-C', repoDir.absolutePath, 'fetch', 'origin', '1.0-legacy'
3029
} else {
31-
// Repository doesn't exist, clone it
32-
commandLine 'git', 'clone', 'https://github.com/opensearch-project/sql-cli.git', repoDir.absolutePath
30+
// Repository doesn't exist, clone the stable branch
31+
commandLine 'git', 'clone', '-b', '1.0-legacy', 'https://github.com/opensearch-project/sql-cli.git', repoDir.absolutePath
3332
}
3433
}
3534

integ-test/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,20 @@ testClusters {
251251
}
252252
}
253253

254+
def isPrometheusRunning() {
255+
try {
256+
def process = "pgrep -f prometheus".execute()
257+
def result = !process.text.trim().isEmpty()
258+
return result
259+
} catch (Exception e) {
260+
return false
261+
}
262+
}
263+
254264
task startPrometheus(type: SpawnProcessTask) {
255265
mustRunAfter ':doctest:doctest'
266+
pidLockFileName ".prom.pid.lock"
267+
onlyIf { !isPrometheusRunning() }
256268

257269
doFirst {
258270
download.run {
@@ -275,6 +287,7 @@ task startPrometheus(type: SpawnProcessTask) {
275287
}
276288

277289
task stopPrometheus(type: KillProcessTask) {
290+
pidLockFileName ".prom.pid.lock"
278291
doLast {
279292
file("$projectDir/bin/prometheus").deleteDir()
280293
file("$projectDir/bin/prometheus.tar.gz").delete()

prometheus/src/test/java/org/opensearch/sql/prometheus/storage/PrometheusStorageFactoryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void testGetStorageEngineWithWrongAuthType() {
130130
.thenReturn(Collections.emptyList());
131131
PrometheusStorageFactory prometheusStorageFactory = new PrometheusStorageFactory(settings);
132132
HashMap<String, String> properties = new HashMap<>();
133-
properties.put("prometheus.uri", "https://test.com");
133+
properties.put("prometheus.uri", "http://localhost:9090");
134134
properties.put("prometheus.auth.type", "random");
135135
properties.put("prometheus.auth.region", "us-east-1");
136136
properties.put("prometheus.auth.secret_key", "accessKey");
@@ -150,7 +150,7 @@ void testGetStorageEngineWithNONEAuthType() {
150150
.thenReturn(Collections.emptyList());
151151
PrometheusStorageFactory prometheusStorageFactory = new PrometheusStorageFactory(settings);
152152
HashMap<String, String> properties = new HashMap<>();
153-
properties.put("prometheus.uri", "https://test.com");
153+
properties.put("prometheus.uri", "http://localhost:9090");
154154
StorageEngine storageEngine = prometheusStorageFactory.getStorageEngine(properties);
155155
Assertions.assertTrue(storageEngine instanceof PrometheusStorageEngine);
156156
}

0 commit comments

Comments
 (0)