Skip to content

Commit

Permalink
integration: refactor top-level testsuite info and actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jsliacan authored and cfergeau committed Sep 5, 2023
1 parent 95fbb7f commit d135b5b
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions test/integration/testsuite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,29 @@ func TestTest(t *testing.T) {
}
reporterConfig.JUnitReport = filepath.Join("out", "integration.xml")

RunSpecs(t, "Test Suite", suiteConfig, reporterConfig)
RunSpecs(t, "Integration", suiteConfig, reporterConfig)

}

var _ = BeforeSuite(func() {

// set userHome
usr, err := user.Current()
Expect(err).NotTo(HaveOccurred())

userHome = usr.HomeDir

// cleanup CRC
Expect(RunCRCExpectSuccess("cleanup")).To(MatchRegexp("Cleanup finished"))

// remove config file
configFilePath := filepath.Join(userHome, ".crc", "crc.json")
err = os.RemoveAll(configFilePath)
if err != nil {
Expect(err).NotTo(HaveOccurred())
logrus.Infof("could not delete %s.", configFilePath)
logrus.Infof("%v", err)
}
userHome = usr.HomeDir
Expect(err).NotTo(HaveOccurred())

// set credPath
credPath = filepath.Join(userHome, ".crc", "machines", "crc", "id_rsa")
Expand All @@ -75,15 +86,15 @@ var _ = BeforeSuite(func() {

logrus.Infof("Error: Could not read GINKGO_OPTS.")
logrus.Infof("%v", err)
Expect(err).NotTo(HaveOccurred())
}
Expect(err).NotTo(HaveOccurred())

pullSecretPath = os.Getenv("PULL_SECRET_PATH") // this env var should contain location of pull-secret file
if err != nil {

logrus.Infof("Error: You need to set PULL_SECRET_PATH to find CRC useful.")
logrus.Infof("%v", err)
Expect(err).NotTo(HaveOccurred())
}
Expect(err).NotTo(HaveOccurred())

})

0 comments on commit d135b5b

Please sign in to comment.