Skip to content

Commit

Permalink
Fix environment variables for hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
5nord committed May 10, 2023
1 parent 8f27b94 commit 36b854f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions control/k3r/k3r.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,20 @@ func buildEnv(t *Test) ([]string, error) {
if t.Config != nil {
// K3_NAME is required by test hooks (aka. sut-control.sh)
ret = append(ret, "K3_NAME="+t.Config.Name)
if file := t.Config.HooksFile; file != "" {
ret = append(ret, "K3_HOOKS_FILE="+file)
}
if t := t.Config.Timeout.Duration; t > 0 {
ret = append(ret, "K3_TIMEOUT="+t.String())
}

if file := t.Config.ManifestFile; file != "" {
ret = append(ret, "K3_SOURCE_DIR="+file)
}

if t.Name != "" {
ret = append(ret, "K3_TEST_NAME="+t.Name)
}

// All declared (environment) variables are passed to k3r.
for k, v := range t.Config.Variables {
Expand Down

0 comments on commit 36b854f

Please sign in to comment.