Skip to content

Commit

Permalink
Adding env property for saving execution result
Browse files Browse the repository at this point in the history
  • Loading branch information
kashishm committed May 12, 2017
1 parent a3d604b commit 2e16ba3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions env/env.go
Expand Up @@ -33,6 +33,7 @@ const (
GaugeReportsDirEnvName = "gauge_reports_dir" // directory where reports are generated by plugins
OverwriteReportsEnvProperty = "overwrite_reports"
UseNestedSpecs = "use_nested_specs"
SaveExecutionResult = "save_execution_result" // determines if last run result should be saved
)

func GetCurrentExecutableDir() (string, string) {
Expand Down Expand Up @@ -107,3 +108,11 @@ func ShouldUseNestedSpecs() bool {
}
return false
}

func ShouldSaveExecutionResult() bool {
envValue := os.Getenv(SaveExecutionResult)
if strings.ToLower(envValue) == "true" {
return true
}
return false
}
4 changes: 3 additions & 1 deletion htmlReport.go
Expand Up @@ -83,7 +83,9 @@ func createReport(suiteResult *gauge_messages.SuiteExecutionResult) {
}
reportsDir := getReportsDirectory(getNameGen())
res := generator.ToSuiteResult(projectRoot, suiteResult.GetSuiteResult())
go saveLastExecutionResult(res, reportsDir, pluginsDir)
if env.ShouldSaveExecutionResult() {
go saveLastExecutionResult(res, reportsDir, pluginsDir)
}
generator.GenerateReport(res, reportsDir, theme.GetThemePath(pluginsDir))
}

Expand Down

0 comments on commit 2e16ba3

Please sign in to comment.