github.com/redhat-appstudio/e2e-tests@v0.0.0-20240520140907-9709f6f59323/templates/test_suite_cmd.tmpl (about)

     1  package cmd
     2  
     3  /* This was generated from a template file. Please feel free to update as necessary */
     4  
     5  import (
     6  	"fmt"
     7  	"os"
     8  	"testing"
     9  
    10  	"github.com/redhat-appstudio/e2e-tests/pkg/framework"
    11  
    12  	"github.com/onsi/ginkgo/v2"
    13  	"github.com/onsi/gomega"
    14  	_ "github.com/redhat-appstudio/e2e-tests/tests/{{ .SuiteName }}"
    15  
    16  	"flag"
    17  
    18  	"github.com/spf13/viper"
    19  )
    20  
    21  const ()
    22  
    23  var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
    24  	return nil
    25  }, func(data []byte) {})
    26  
    27  var webhookConfigPath string
    28  
    29  func init() {
    30  	rootDir, _ := os.Getwd()
    31  	flag.StringVar(&webhookConfigPath, "webhookConfigPath", "", "path to webhook config file")
    32  }
    33  
    34  func {{ .SuiteName }}Test(t *testing.T) {
    35  	GinkgoWriter.Println("Starting {{ .SuiteName }} tests...")
    36  
    37  	gomega.RegisterFailHandler(ginkgo.Fail)
    38  	ginkgo.RunSpecs(t, "{{ .SuiteName }} tests")
    39  }
    40  
    41  var _ = ginkgo.SynchronizedAfterSuite(func() {}, func() {
    42  	//Send webhook only it the parameter configPath is not empty
    43  	if len(webhookConfigPath) > 0 {
    44  		GinkgoWriter.Println("Send webhook")
    45  		framework.SendWebhook(webhookConfigPath)
    46  	}
    47  })