bisakhmondal commented on a change in pull request #1755:
URL: https://github.com/apache/apisix-dashboard/pull/1755#discussion_r611442945
##########
File path: api/test/e2enew/base/base.go
##########
@@ -248,8 +248,9 @@ func CleanAPISIXErrorLog() {
pwd := string(pwdByte)
pwd = strings.Replace(pwd, "\n", "", 1)
pwd = pwd[:strings.Index(pwd, "/e2e")]
- cmd = exec.Command("sudo", "echo", " > ",
pwd+"/docker/apisix_logs/error.log")
- _, err = cmd.CombinedOutput()
+ cmdStr := "echo | sudo tee " + pwd+"/docker/apisix_logs/error.log"
+ cmd = exec.Command("bash", "-c", cmdStr)
+ _, err = cmd.Output()
Review comment:
FYI, earlier the cleanup was not taking place and it got clear during
the execution of [this
line](https://github.com/apache/apisix-dashboard/pull/1755/files#diff-fda12d792401cbe1075880088e985ad29db054f11c5cec63b0dd68da1298b454R198),
as for this substring not to be present the cleanup must be done.
Reference: [stackoverflow](https://stackoverflow.com/a/30329351)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]