@@ -32,6 +32,7 @@ import (
3232 "github.com/elastic/elastic-package/internal/testrunner/runners/static"
3333 "github.com/elastic/elastic-package/internal/testrunner/runners/system"
3434 "github.com/elastic/elastic-package/internal/testrunner/script"
35+ "github.com/elastic/elastic-package/internal/version"
3536)
3637
3738const testLongDescription = `Use this command to run tests on a package. Currently, the following types of tests are available:
@@ -178,6 +179,13 @@ func testRunnerAssetCommandAction(cmd *cobra.Command, args []string) error {
178179 return fmt .Errorf ("failed to read global config: %w" , err )
179180 }
180181
182+ stackVersion , err := kibanaClient .Version ()
183+ if err != nil {
184+ return fmt .Errorf ("fetching stack version failed: %w" , err )
185+ }
186+
187+ logger .Info (version .Version ())
188+ logger .Infof ("elastic-stack: %s\n " , stackVersion .Version ())
181189 runner := asset .NewAssetTestRunner (asset.AssetTestRunnerOptions {
182190 PackageRoot : packageRoot ,
183191 KibanaClient : kibanaClient ,
@@ -266,6 +274,7 @@ func testRunnerStaticCommandAction(cmd *cobra.Command, args []string) error {
266274 return fmt .Errorf ("failed to read global config: %w" , err )
267275 }
268276
277+ logger .Info (version .Version ())
269278 runner := static .NewStaticTestRunner (static.StaticTestRunnerOptions {
270279 PackageRoot : packageRoot ,
271280 DataStreams : dataStreams ,
@@ -384,6 +393,13 @@ func testRunnerPipelineCommandAction(cmd *cobra.Command, args []string) error {
384393 return fmt .Errorf ("failed to read global config: %w" , err )
385394 }
386395
396+ esClientInfo , err := esClient .Info (ctx )
397+ if err != nil {
398+ return fmt .Errorf ("fetching stack version failed: %w" , err )
399+ }
400+
401+ logger .Info (version .Version ())
402+ logger .Infof ("elastic-stack: %s\n " , esClientInfo .Version .Number )
387403 runner := pipeline .NewPipelineTestRunner (pipeline.PipelineTestRunnerOptions {
388404 Profile : profile ,
389405 PackageRoot : packageRoot ,
@@ -576,6 +592,13 @@ func testRunnerSystemCommandAction(cmd *cobra.Command, args []string) error {
576592 return fmt .Errorf ("failed to read global config: %w" , err )
577593 }
578594
595+ info , err := esClient .Info (ctx )
596+ if err != nil {
597+ return fmt .Errorf ("fetching stack version failed: %w" , err )
598+ }
599+
600+ logger .Info (version .Version ())
601+ logger .Infof ("elastic-stack: %s" , info .Version .Number )
579602 runner := system .NewSystemTestRunner (system.SystemTestRunnerOptions {
580603 Profile : profile ,
581604 PackageRoot : packageRoot ,
@@ -742,6 +765,13 @@ func testRunnerPolicyCommandAction(cmd *cobra.Command, args []string) error {
742765 return fmt .Errorf ("failed to read global config: %w" , err )
743766 }
744767
768+ stackVersion , err := kibanaClient .Version ()
769+ if err != nil {
770+ return fmt .Errorf ("fetching stack version failed: %w" , err )
771+ }
772+
773+ logger .Info (version .Version ())
774+ logger .Infof ("elastic-stack: %s" , stackVersion .Version ())
745775 runner := policy .NewPolicyTestRunner (policy.PolicyTestRunnerOptions {
746776 PackageRoot : packageRoot ,
747777 KibanaClient : kibanaClient ,
0 commit comments