File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ function log {
67
67
}
68
68
69
69
function cleanup {
70
- $status = $?
70
+ param (
71
+ $RunExitCode
72
+ )
71
73
72
74
$runParams = @ {
73
75
NODE_NAME = $NODE_NAME
@@ -78,12 +80,12 @@ function cleanup {
78
80
./ .ci/ run- elasticsearch.ps1 @runParams
79
81
80
82
# Report status and exit
81
- if ($status -eq 0 ) {
83
+ if ($RunExitCode -eq 0 ) {
82
84
log " run-tests" - Level Success
83
85
exit 0
84
86
} else {
85
87
log " failure during run-tests" - Level Error
86
- exit $status
88
+ exit $RunExitCode
87
89
}
88
90
}
89
91
@@ -126,8 +128,10 @@ docker run `
126
128
elastic/ elasticsearch- rs `
127
129
cargo test $CARGO_TEST_FLAGS
128
130
129
- if ($LASTEXITCODE ) {
131
+ $runExitCode = $LASTEXITCODE
132
+
133
+ if ($runExitCode -ne 0 ) {
130
134
docker rm elasticsearch- rs
131
135
}
132
136
133
- cleanup
137
+ cleanup $runExitCode
You can’t perform that action at this time.
0 commit comments