Skip to content

Commit 2352bc6

Browse files
Added end-to-end tests to CI
Signed-off-by: Norman Jordan <norman.jordan@improving.com>
1 parent 9925289 commit 2352bc6

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.github/workflows/test-and-build-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: echo "SBT_OPTS=-Xmx2G" >> $GITHUB_ENV
3434

3535
- name: Integ Test
36-
run: sbt integtest/integration
36+
run: sbt integtest/integration e2etest/test
3737

3838
- name: Upload test report
3939
if: always() # Ensures the artifact is saved even if tests fail

e2e-test/src/test/scala/org/opensearch/spark/e2e/EndToEndITSuite.scala

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,22 @@ class EndToEndITSuite extends AnyFlatSpec with TableDrivenPropertyChecks with Be
7575
val dockerProcess = new ProcessBuilder("docker", "compose", "up", "-d")
7676
.directory(new File(DOCKER_INTEG_DIR))
7777
.start()
78-
dockerProcess.waitFor(5, TimeUnit.MINUTES)
78+
var stopReading = false
79+
new Thread() {
80+
override def run(): Unit = {
81+
val reader = new BufferedReader(new InputStreamReader(dockerProcess.getInputStream))
82+
var line = reader.readLine()
83+
while (!stopReading && line != null) {
84+
logInfo("*** " + line)
85+
line = reader.readLine()
86+
}
87+
}
88+
}.start()
89+
val completed = dockerProcess.waitFor(30, TimeUnit.MINUTES)
90+
stopReading = true
91+
if (!completed) {
92+
throw new IllegalStateException("Unable to start docker cluster")
93+
}
7994

8095
if (dockerProcess.exitValue() != 0) {
8196
logError("Unable to start docker cluster")
@@ -97,7 +112,7 @@ class EndToEndITSuite extends AnyFlatSpec with TableDrivenPropertyChecks with Be
97112
val dockerProcess = new ProcessBuilder("docker", "compose", "down")
98113
.directory(new File(DOCKER_INTEG_DIR))
99114
.start()
100-
dockerProcess.waitFor(2, TimeUnit.MINUTES)
115+
dockerProcess.waitFor(10, TimeUnit.MINUTES)
101116

102117
if (dockerProcess.exitValue() != 0) {
103118
logError("Unable to stop docker cluster")

0 commit comments

Comments
 (0)