log.Entry().Fatal("failed to persist Influx environment")
}
}
// GaugeExecuteTestsCommand Installs gauge and executes specified gauge tests.
funcGaugeExecuteTestsCommand()*cobra.Command{
constSTEP_NAME="gaugeExecuteTests"
metadata:=gaugeExecuteTestsMetadata()
varstepConfiggaugeExecuteTestsOptions
varstartTimetime.Time
varinfluxgaugeExecuteTestsInflux
varlogCollector*log.CollectorHook
varcreateGaugeExecuteTestsCmd=&cobra.Command{
Use:STEP_NAME,
Short:"Installs gauge and executes specified gauge tests.",
Long:`InthisstepGauge([getgauge.io](https://getgauge.io)) acceptance tests are executed. Using Gauge it will be possible to have a three-tier test layout:
UsingGaugeitispossibletowritetestspecificationsin[Markdownsyntax](http://daringfireball.net/projects/markdown/syntax) and therefore allow e.g. product owners to write the relevant acceptance test specifications. At the same time it allows the developer to implement the steps described in the specification in her development environment.
Youcanusethe[sampleprojects](https://github.com/getgauge/gauge-mvn-archetypes) of Gauge.`,
cmd.Flags().StringVar(&stepConfig.InstallCommand,"installCommand",os.Getenv("PIPER_installCommand"),"Defines the command for installing Gauge. Gauge should be installed using npm. Example: npm install -g @getgauge/cli@1.2.1")
cmd.Flags().StringVar(&stepConfig.LanguageRunner,"languageRunner",os.Getenv("PIPER_languageRunner"),"Defines the Gauge language runner to be used. Example: java")
cmd.Flags().StringVar(&stepConfig.RunCommand,"runCommand",os.Getenv("PIPER_runCommand"),"Defines the command which is used for executing Gauge. Example: run -s -p specs/")
cmd.Flags().StringVar(&stepConfig.TestOptions,"testOptions",os.Getenv("PIPER_testOptions"),"Allows to set specific options for the Gauge execution. Details can be found for example [in the Gauge Maven plugin documentation](https://github.com/getgauge-contrib/gauge-maven-plugin#executing-specs)")
cmd.MarkFlagRequired("runCommand")
}
// retrieve step metadata
funcgaugeExecuteTestsMetadata()config.StepData{
vartheMetaData=config.StepData{
Metadata:config.StepMetadata{
Name:"gaugeExecuteTests",
Aliases:[]config.Alias{},
Description:"Installs gauge and executes specified gauge tests.",
{Name:"seleniumHubCredentialsId",Description:"Defines the id of the user/password credentials to be used to connect to a Selenium Hub. The credentials are provided in the environment variables `PIPER_SELENIUM_HUB_USER` and `PIPER_SELENIUM_HUB_PASSWORD`.",Type:"jenkins"},