Skip to content

Commit

Permalink
Added testcase for stash
Browse files Browse the repository at this point in the history
  • Loading branch information
Satyam Sinha committed Nov 9, 2022
1 parent 01a4425 commit 11c05ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/suites/main.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package main

import (
"context"
"log"

"github.com/PaloAltoNetworks/barrier"
_ "github.com/PaloAltoNetworks/barrier/examples/suites/suite1"
_ "github.com/PaloAltoNetworks/barrier/examples/suites/suite2"
)

func stash(ctx context.Context) interface{} {
return "stash-string"
}

func main() {
cmd := barrier.NewCommand("tests", "integration tests", "v0.0.0", nil)
cmd := barrier.NewCommand("tests", "integration tests", "v0.0.0", stash)
// Run the command.
if err := cmd.Execute(); err != nil {
log.Fatalln(err)
Expand Down
3 changes: 3 additions & 0 deletions examples/suites/suite1/suite1.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func init() {
// Demo: Use suite setup vars in test
suiteURL := t.SuiteSetupInfo().(string)

// Demo: Usage of stash
fmt.Println("stash is: " + t.Stash().(string))

barrier.Step(t, "perform a get on setup", func() error {
_, _ = http.Get(suiteURL) // make http call but ignore results
return nil
Expand Down

0 comments on commit 11c05ce

Please sign in to comment.