Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Ziwen Ning <[email protected]>
  • Loading branch information
ningziwen committed Dec 7, 2022
1 parent afca603 commit 231f437
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions e2e/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
})
Expand All @@ -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")))
Expand All @@ -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`)))
})
Expand Down
6 changes: 4 additions & 2 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 231f437

Please sign in to comment.