diff --git a/e2e/config_test.go b/e2e/config_test.go index 85a7902ae..0c4a29d35 100644 --- a/e2e/config_test.go +++ b/e2e/config_test.go @@ -84,7 +84,7 @@ var testConfig = func(o *option.Option, installed bool) { gomega.Expect(startCmdSession).Should(gexec.Exit(0)) gomega.Expect(limaConfigFilePath).Should(gomega.BeARegularFile()) - cfgBuf, err := os.ReadFile(limaConfigFilePath) + cfgBuf, err := os.ReadFile(filepath.Clean(limaConfigFilePath)) gomega.Expect(err).ShouldNot(gomega.HaveOccurred()) gomega.Expect(cfgBuf).Should(gomega.SatisfyAll(gomega.ContainSubstring("cpus: 6"), gomega.ContainSubstring("memory: 4GiB"))) }) @@ -94,7 +94,7 @@ var testConfig = func(o *option.Option, installed bool) { gomega.Expect(startCmdSession).Should(gexec.Exit(0)) gomega.Expect(limaConfigFilePath).Should(gomega.BeARegularFile()) - cfgBuf, err := os.ReadFile(limaConfigFilePath) + cfgBuf, err := os.ReadFile(filepath.Clean(limaConfigFilePath)) gomega.Expect(err).ShouldNot(gomega.HaveOccurred()) // 4 CPUs is the default gomega.Expect(cfgBuf).Should(gomega.SatisfyAll(gomega.MatchRegexp(`cpus: \d`), gomega.ContainSubstring("memory: 6GiB"))) @@ -105,7 +105,7 @@ var testConfig = func(o *option.Option, installed bool) { gomega.Expect(startCmdSession).Should(gexec.Exit(0)) gomega.Expect(limaConfigFilePath).Should(gomega.BeARegularFile()) - cfgBuf, err := os.ReadFile(limaConfigFilePath) + cfgBuf, err := os.ReadFile(filepath.Clean(limaConfigFilePath)) gomega.Expect(err).ShouldNot(gomega.HaveOccurred()) gomega.Expect(cfgBuf).Should(gomega.SatisfyAll(gomega.MatchRegexp(`cpus: \d`), gomega.MatchRegexp(`memory: \dGiB`))) }) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 0420fbc54..e048471b0 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -16,8 +16,10 @@ import ( "github.com/runfinch/common-tests/tests" ) -const virtualMachineRootCmd = "vm" -const installedTestSubject = "finch" +const ( + virtualMachineRootCmd = "vm" + installedTestSubject = "finch" +) var installed = flag.Bool("installed", false, "the flag to show whether the tests are ran against installed application")