Skip to content

Commit

Permalink
Merge branch 'livetest-with-ctx' into 'master'
Browse files Browse the repository at this point in the history
allow access to testcase context

See merge request pace/go-microservice!38
  • Loading branch information
Vincent Landgraf committed Feb 22, 2019
2 parents 52873f4 + beaf7fe commit 45fea1d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions testing/livetest/test_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ func NewTestProxy(ctx context.Context, name string) *T {
return &T{name: name, ctx: ctx, state: StateRunning}
}

// Context returns the livetest context. Useful
// for passing timeout and/or logging constraints from
// the test executor to the individual case
func (t *T) Context() context.Context {
return t.ctx
}

// Error logs an error message with the test
func (t *T) Error(args ...interface{}) {
log.Ctx(t.ctx).Error().Msg(fmt.Sprint(args...))
Expand Down

0 comments on commit 45fea1d

Please sign in to comment.