chenyulin0719 commented on code in PR #758:
URL: https://github.com/apache/yunikorn-k8shim/pull/758#discussion_r1446964805
##########
test/e2e/framework/helpers/common/utils.go:
##########
@@ -254,3 +240,53 @@ func RunShellCmdForeground(cmdStr string) (string, error) {
return stdOutStream.String(), nil
}
+
+func CreateLogFile(suiteName string, specName string, logType string,
extention string) (*os.File, error) {
+ filePath, err := getLogFilePath(suiteName, specName, logType, extention)
+ if err != nil {
+ return nil, err
+ }
+
+ dir := filepath.Dir(filePath)
+ if _, err = os.Stat(dir); os.IsNotExist(err) {
+ err = os.MkdirAll(dir, 0755)
+ if err != nil {
+ return nil, err
+ }
+ }
+
+ file, err := os.Create(filePath)
+ if err != nil {
+ return nil, err
+ }
+ fmt.Fprintf(ginkgo.GinkgoWriter, "Created log file: %s\n", filePath)
+ return file, nil
+}
+
+func getLogFilePath(suiteName string, specName string, logType string,
extention string) (string, error) {
Review Comment:
Typo fixed
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]