Skip to content

Commit

Permalink
Merge pull request #568 from moosq/k3s-exec-beautification
Browse files Browse the repository at this point in the history
k3s execution beautification
  • Loading branch information
moosq authored Jun 29, 2022
2 parents cc0cfd8 + 79a5151 commit e4afcee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion internal/lsp/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Running test %s in %q`, job.Name, job.Config.Root)

logDir, _ := k3s.Run(c.console, job.Config, job.Name)

if files := fs.Abs(fs.FindFilesRecursive(logDir)...); len(files) > 0 {
if files := fs.Abs(excludeFromListIfPresent("mtc_workspace", fs.FindFilesRecursive(logDir))...); len(files) > 0 {
fmt.Fprintf(c.console, `
Content of log directory %q:
===============================================================================
Expand All @@ -165,3 +165,13 @@ Content of log directory %q:
}()

}

func excludeFromListIfPresent(str string, input []string) []string {
ret := make([]string, 0, len(input))
for _, elem := range input {
if !strings.Contains(elem, str) {
ret = append(ret, elem)
}
}
return ret
}
2 changes: 1 addition & 1 deletion k3/k3s/k3s.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (r *runner) Run(w io.Writer, testID string) error {
r.clean(testID)

// Execute test (k3s backend)
cmd := nttCommand(r.p, "run", "--", testID)
cmd := nttCommand(r.p, "run", "-j1", "--", testID)
cmd.Dir = r.Dir
cmd.Env = append(cmd.Env, "SCT_K3_SERVER=ON")
out, err := cmd.CombinedOutput()
Expand Down

0 comments on commit e4afcee

Please sign in to comment.