Skip to content

Commit f1fa2c8

Browse files
Gaurav Gandhigandhi-21
authored andcommitted
manually restore readme after each test run
1 parent fa120b2 commit f1fa2c8

File tree

5 files changed

+75
-0
lines changed

5 files changed

+75
-0
lines changed

ui-tests-starter/tst-243+/software/aws/toolkits/jetbrains/uitests/docTests/updateReadmeTests/UpdateReadmeLatestChanges/MakeChangesFlowTest.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,21 @@ class MakeChangesFlowTest {
9292
fun clearAwsXml() {
9393
clearAwsXmlFile()
9494
}
95+
96+
@JvmStatic
97+
@AfterAll
98+
fun tearDown() {
99+
val path = Paths.get("tstData", "qdoc", "updateFlow", "README.md").toUri()
100+
101+
val process = ProcessBuilder("git", "restore", path.path).start()
102+
val exitCode = process.waitFor()
103+
if (exitCode != 0) {
104+
println("Warning: git stash command failed with exit code $exitCode")
105+
process.errorStream.bufferedReader().use { reader ->
106+
println("Error: ${reader.readText()}")
107+
}
108+
}
109+
}
95110
}
96111
}
97112

ui-tests-starter/tst-243+/software/aws/toolkits/jetbrains/uitests/docTests/updateReadmeTests/UpdateReadmeLatestChanges/PromptedToConfirmFolderTest.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ class PromptedToConfirmFolderTest {
9393
fun clearAwsXml() {
9494
clearAwsXmlFile()
9595
}
96+
97+
@JvmStatic
98+
@AfterAll
99+
fun tearDown() {
100+
val path = Paths.get("tstData", "qdoc", "updateFlow", "README.md").toUri()
101+
102+
val process = ProcessBuilder("git", "restore", path.path).start()
103+
val exitCode = process.waitFor()
104+
if (exitCode != 0) {
105+
println("Warning: git stash command failed with exit code $exitCode")
106+
process.errorStream.bufferedReader().use { reader ->
107+
println("Error: ${reader.readText()}")
108+
}
109+
}
110+
}
96111
}
97112
}
98113

ui-tests-starter/tst-243+/software/aws/toolkits/jetbrains/uitests/docTests/updateReadmeTests/UpdateReadmeLatestChanges/UpdateReadmeLatestChangesTest.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,20 @@ class UpdateReadmeLatestChangesTest {
9595
fun clearAwsXml() {
9696
clearAwsXmlFile()
9797
}
98+
99+
@JvmStatic
100+
@AfterAll
101+
fun tearDown() {
102+
val path = Paths.get("tstData", "qdoc", "updateFlow", "README.md").toUri()
103+
104+
val process = ProcessBuilder("git", "restore", path.path).start()
105+
val exitCode = process.waitFor()
106+
if (exitCode != 0) {
107+
println("Warning: git stash command failed with exit code $exitCode")
108+
process.errorStream.bufferedReader().use { reader ->
109+
println("Error: ${reader.readText()}")
110+
}
111+
}
112+
}
98113
}
99114
}

ui-tests-starter/tst-243+/software/aws/toolkits/jetbrains/uitests/docTests/updateReadmeTests/UpdateReadmeSpecificChanges/MakeChangesFlowTest.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,20 @@ class MakeChangesFlowTest {
9292
fun clearAwsXml() {
9393
clearAwsXmlFile()
9494
}
95+
96+
@JvmStatic
97+
@AfterAll
98+
fun tearDown() {
99+
val path = Paths.get("tstData", "qdoc", "updateFlow", "README.md").toUri()
100+
101+
val process = ProcessBuilder("git", "restore", path.path).start()
102+
val exitCode = process.waitFor()
103+
if (exitCode != 0) {
104+
println("Warning: git stash command failed with exit code $exitCode")
105+
process.errorStream.bufferedReader().use { reader ->
106+
println("Error: ${reader.readText()}")
107+
}
108+
}
109+
}
95110
}
96111
}

ui-tests-starter/tst-243+/software/aws/toolkits/jetbrains/uitests/docTests/updateReadmeTests/UpdateReadmeSpecificChanges/UpdateReadmeSpecificChangesTest.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,20 @@ class UpdateReadmeSpecificChangesTest {
9494
fun clearAwsXml() {
9595
clearAwsXmlFile()
9696
}
97+
98+
@JvmStatic
99+
@AfterAll
100+
fun tearDown() {
101+
val path = Paths.get("tstData", "qdoc", "updateFlow", "README.md").toUri()
102+
103+
val process = ProcessBuilder("git", "restore", path.path).start()
104+
val exitCode = process.waitFor()
105+
if (exitCode != 0) {
106+
println("Warning: git stash command failed with exit code $exitCode")
107+
process.errorStream.bufferedReader().use { reader ->
108+
println("Error: ${reader.readText()}")
109+
}
110+
}
111+
}
97112
}
98113
}

0 commit comments

Comments
 (0)