-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[testutil] Stop container using docker rm -f #124
- kill the docker run process does not work - add labels to created container so they can be cleaned in batch
- Loading branch information
Showing
4 changed files
with
127 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
// Package testutil defines helper functions like condition, golden file, docker container etc. | ||
package testutil | ||
|
||
import "time" | ||
|
||
var testStart time.Time | ||
|
||
// SetTestStart allows you to override the global test start time. | ||
// Which is used as a simple identifier to distinguish different tests. | ||
// For instance, it is used as label in container test. | ||
func SetTestStart(t time.Time) { | ||
testStart = t | ||
} | ||
|
||
func init() { | ||
testStart = time.Now() | ||
} |