Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions layer4/assessment.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ type Assessment struct {
Steps []AssessmentStep `yaml:"steps"`
// StepsExecuted is the number of steps that were executed during the test
StepsExecuted int `yaml:"steps-executed,omitempty"`
// RunDuration is the time it took to run the test
RunDuration string `yaml:"run-duration,omitempty"`
// Start is the time the assessment run began.
Start string `yaml:"start"`
// End is the time the assessment run finished.
// This is omitted if the assessment was interrupted or did not complete.
End string `yaml:"end,omitempty"`
// Value is the object that was returned during the test
Value interface{} `yaml:"value,omitempty"`
// Changes is a slice of changes that were made during the test
Expand Down Expand Up @@ -88,7 +91,7 @@ func (a *Assessment) Run(targetData interface{}, changesAllowed bool) Result {
return a.Result
}

startTime := time.Now()
a.Start = time.Now().Format(time.RFC3339)
err := a.precheck()
if err != nil {
a.Result = Unknown
Expand All @@ -104,7 +107,7 @@ func (a *Assessment) Run(targetData interface{}, changesAllowed bool) Result {
return Failed
}
}
a.RunDuration = time.Since(startTime).String()
a.End = time.Now().Format(time.RFC3339)
return a.Result
}

Expand Down
Loading
Loading