Skip to content

Commit

Permalink
try to fix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter authored Dec 9, 2021
1 parent 1186212 commit c5b5da9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion process_testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ func (v *Venom) runTestSuite(ctx context.Context, ts *TestSuite) {
ts.Vars.Add(k, computedV)
}

ts.Vars.Add("venom.executable", os.Args[0])
exePath, err := os.Executable()
if err != nil {
log.Errorf("failed to get executable path: %v", err)
} else {
ts.Vars.Add("venom.executable", exePath)
}

ts.Vars.Add("venom.libdir", v.LibDir)
ts.Vars.Add("venom.testsuite", ts.Name)
ts.ComputedVars = H{}
Expand Down
3 changes: 2 additions & 1 deletion tests/user_executor_custom_stop_on_failure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ testcases:
steps:
# spawn a venom sub-process and expect it to fail and make assertions on its error messages
- type: exec
script: '{{.venom.executable}} run {{.venom.testsuite.workdir}}/files/stop_on_failure.yml --lib-dir {{.venom.testsuite.workdir}}/../{{.venom.libdir}}'
script: '{{.venom.executable}} run {{.venom.testsuite.workdir}}/../tests/files/stop_on_failure.yml --lib-dir {{.venom.testsuite.workdir}}/../{{.venom.libdir}}'
assertions:
- result.code ShouldEqual 2
- result.systemout ShouldContainSubstring 'Skipping remaining steps because stop-on-failure is set'
- result.systemout ShouldContainSubstring '0:' # matches step #0:
- result.systemout ShouldNotContainSubstring '2:' # matches step #2:
- result.systemerr ShouldBeEmpty

0 comments on commit c5b5da9

Please sign in to comment.