Skip to content

Commit c35e8b5

Browse files
committed
make integration now works with the mobile-core dev-setup openshift
1 parent c5daced commit c35e8b5

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

Makefile

+3-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ fmt:
4646
check: errcheck vet fmt test-unit
4747

4848
.PHONY: integration
49-
integration:
50-
go build -o mobile ./cmd/mobile
51-
go test ./integration
49+
integration: build
50+
go test -v ./integration -args -namespace=`oc project -q` -executable=`pwd`/mobile
5251

5352
.PHONY: release
5453
release: setup
55-
goreleaser --rm-dist
54+
goreleaser --rm-dist

integration/client_crudl_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestClientJson(t *testing.T) {
6464
m.Args("get", "client", expectedId).Should(notExists).Run().Test(t)
6565
o.Args("get", "mobileclient", expectedId).Should(notExists).Run().Test(t)
6666
m.Args("create", "client", name, clientType).Should(exists).Run().Test(t)
67-
m.Args("get", "client", expectedId).Should(exists).Run(t).Run().Test(t)
67+
m.Args("get", "client", expectedId).Should(exists).Run().Test(t)
6868
o.Args("get", "mobileclient", expectedId).Should(exists).Run().Test(t)
6969
m.Args("delete", "client", expectedId).Should(NoErr).Run().Test(t)
7070
m.Args("get", "client", expectedId).Should(notExists).Run().Test(t)

integration/flags.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import (
55
)
66

77
var namespace = flag.String("namespace", "", "Openshift namespace (most often Project) to run our integration tests in")
8-
var prefix = flag.String("prefix", "", "Client name to be created")
8+
var prefix = flag.String("prefix", "test", "Client name to be created")
99
var executable = flag.String("executable", "", "Executable under test")
1010
var update = flag.Bool("update", false, "update golden files")

integration/validatedCommandUtils.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type ValidationResult struct {
1515
}
1616

1717
func (v ValidationResult) Test(t *testing.T) (output []byte, err error) {
18-
t.Log(fmt.Sprintf("%s\n", output))
18+
t.Log(fmt.Sprintf("%s\n", v.Output))
1919
if !v.Success {
2020
t.Fatal(v.Message)
2121
}
@@ -84,21 +84,21 @@ func All(vs ...ValidationFunction) ValidationFunction {
8484
}
8585

8686
type CmdDesc struct {
87-
executable string
87+
Executable string
8888
Arg []string
8989
Validator ValidationFunction
9090
}
9191

9292
func (c CmdDesc) Args(arg ...string) CmdDesc {
93-
return CmdDesc{c.executable, append(c.Arg, arg...), c.Validator}
93+
return CmdDesc{c.Executable, append(c.Arg, arg...), c.Validator}
9494
}
9595

9696
func (c CmdDesc) Should(validator ValidationFunction) CmdDesc {
97-
return CmdDesc{c.executable, c.Arg, All(c.Validator, validator)}
97+
return CmdDesc{c.Executable, c.Arg, All(c.Validator, validator)}
9898
}
9999

100100
func (c CmdDesc) Run() ValidationResult {
101-
cmd := exec.Command(c.executable, c.Arg...)
101+
cmd := exec.Command(c.Executable, c.Arg...)
102102
output, err := cmd.CombinedOutput()
103103
return c.Validator(output, err)
104104
}

0 commit comments

Comments
 (0)