Skip to content

Commit

Permalink
Merge pull request #256 from SAP/gen_meta_fix
Browse files Browse the repository at this point in the history
fix test data
  • Loading branch information
ShimiT authored Feb 20, 2019
2 parents e0f4eb0 + aafebf1 commit e8de13c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
35 changes: 28 additions & 7 deletions integration/cloud_mta_build_tool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ var _ = Describe("Integration - CloudMtaBuildTool", func() {
fmt.Println(err)
}
Ω(cmdOut).ShouldNot(BeNil())
// Read the MakeFile was generated
out, error := ioutil.ReadFile(filepath.Join(dir, "testdata", "mta_demo", "Makefile.mta"))
Ω(error).Should(BeNil())
Ω(out).ShouldNot(BeEmpty())

// Check the MakeFile was generated
Ω(filepath.Join(dir, "testdata", "mta_demo", "Makefile.mta")).Should(BeAnExistingFile())
})

It("Command name error", func() {
Expand All @@ -112,11 +111,33 @@ var _ = Describe("Integration - CloudMtaBuildTool", func() {
}
Ω(err).Should(Equal(""))
Ω(cmdOut).ShouldNot(BeEmpty())
// Check the MakeFile was generated
Ω(filepath.Join(dir, "testdata", "mta_demo", "mta_archives", archiveName)).Should(BeAnExistingFile())
})
})

var _ = Describe("Generate the Verbose Makefile and use it for mtar generation", func() {

It("Generate Verbose Makefile", func() {
dir, _ := os.Getwd()
os.RemoveAll(filepath.Join(dir, "testdata", "mta_demo", "Makefile.mta"))
os.RemoveAll(filepath.Join(dir, "testdata", "mta_demo", "mta_archives", archiveName))
path := filepath.Join(dir, "testdata", "mta_demo")
bin := filepath.FromSlash(binPath)
cmdOut, err, _ := execute(bin, "init -m=verbose", path)
if len(err) > 0 {
fmt.Println(err)
}
Ω(cmdOut).ShouldNot(BeNil())
// Read the MakeFile was generated
out, error := ioutil.ReadFile(filepath.Join(dir, "testdata", "mta_demo", "mta_archives", archiveName))
Ω(error).Should(BeNil())
Ω(out).ShouldNot(BeNil())
Ω(filepath.Join(dir, "testdata", "mta_demo", "Makefile.mta")).Should(BeAnExistingFile())
// generate mtar
bin = filepath.FromSlash("make")
execute(bin, "-f Makefile.mta p=cf", path)
//check mtar existence
Ω(filepath.Join(dir, "testdata", "mta_demo", "mta_archives", archiveName)).Should(BeAnExistingFile())
})

})

var _ = Describe("MBT gen commands", func() {
Expand Down
2 changes: 1 addition & 1 deletion internal/tpl/testdata/ExpectedMakeFileWindows
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MAKEFLAGS += -j
.PHONY: validate ui meta mtar cleanup
# Default target compile all
all: validate ui meta mtar cleanup
# Validatgit guie mta.yaml
# Validate mta.yaml
validate:
@mbt validate -d=dev -r=${strict}
# Set the current project repository path for general mta process
Expand Down

0 comments on commit e8de13c

Please sign in to comment.