Skip to content

Commit

Permalink
Fix coverage and remove prints
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteF committed Oct 12, 2017
1 parent b6411c9 commit 99e14b7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions cmd/initSettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ var initSettingsCmd = &cobra.Command{

}
fmt.Println(name)
fmt.Fprintln(os.Stderr, "the name is", name)
ws := workspace.New(name)

force, err := cmd.Flags().GetBool("force")
Expand All @@ -52,7 +51,6 @@ var initSettingsCmd = &cobra.Command{

exists, err := utils.DirExists(ws.Path())
if err != nil {
fmt.Fprintln(os.Stderr, "WE GOT AN ERROR")
return err
}
if exists && !force {
Expand Down
2 changes: 1 addition & 1 deletion internal/testwrapper/vg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func main() {
fmt.Sprintf("-test.coverprofile=%04d.out", n),
"-test.outputdir=coverages",
}
cmd := exec.Command("testvg", append(os.Args[1:], args...)...)
cmd := exec.Command("testvg", append(args, os.Args[1:]...)...)
stdout := new(bytes.Buffer)
stderr := new(bytes.Buffer)
cmd.Stdout = stdout
Expand Down
2 changes: 2 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package main

import (
"os"
"testing"
)

// TestMain - test to drive external testing coverage
func TestMain(t *testing.T) {
os.Args = os.Args[2:]
main()
}
2 changes: 1 addition & 1 deletion test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ eval "$(vg eval --shell bash)"
rm -rf coverages

set -uex -o pipefail
go test -coverprofile=coverage.out -coverpkg=github.com/GetStream/vg,github.com/GetStream/vg/cmd -c github.com/GetStream/vg -o testbins/testvg
go test -coverprofile=coverage.out -coverpkg="$(go list ./... | paste -sd ',' -)" -c github.com/GetStream/vg -o testbins/testvg

go build -i -o testbins/vg github.com/GetStream/vg/internal/testwrapper/vg

Expand Down

0 comments on commit 99e14b7

Please sign in to comment.