Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix]: bug while keploy test in user app #1585

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,17 +397,17 @@ func (t *Test) GetCmd() *cobra.Command {

if generateTestReport {
testReportPath = path + "/testReports"

testReportPath, err = pkg.GetNextTestReportDir(testReportPath, models.TestRunTemplateName)
t.logger.Info("", zap.Any("keploy testReport path", testReportPath))
if err != nil {
t.logger.Error("failed to get the next test report directory", zap.Error(err))
return err
}
t.logger.Info("", zap.Any("keploy testReport path", testReportPath))
if err != nil {
t.logger.Error("failed to get the next test report directory", zap.Error(err))
return err
}
} else {
t.logger.Info("Test Reports are not being generated since generateTestReport flag is set false")
}

var hasContainerName bool
if isDockerCmd {
if strings.Contains(appCmd, "--name") {
Expand Down Expand Up @@ -449,11 +449,14 @@ func (t *Test) GetCmd() *cobra.Command {
PassthroughHosts: passThroughHosts,
}, enableTele)

cmd := exec.Command("sudo", "chmod", "-R", "777", path)
err = cmd.Run()
if err != nil {
t.logger.Error("failed to set the permission of keploy directory", zap.Error(err))
return err
fileExist := utils.CheckFileExists(path)
if fileExist {
cmd := exec.Command("sudo", "chmod", "-R", "777", path)
err = cmd.Run()
if err != nil {
t.logger.Error("failed to run command", zap.Error(err))
return err
}
}

}
Expand Down Expand Up @@ -511,4 +514,4 @@ func (t *Test) GetCmd() *cobra.Command {
testCmd.SilenceErrors = true

return testCmd
}
}
Loading