diff --git a/README.md b/README.md index 11d25af..61b9d09 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ Installer for Openshift Serverless ================================== +[![Build Status](https://travis-ci.com/wavesoftware/serverless-installer.svg?branch=master)](https://travis-ci.com/wavesoftware/serverless-installer) + Installer will create a usable installation of Openshift's Serverless Platform. ## Usage @@ -13,4 +15,4 @@ This command will deploy a serverless platform on currently configured cluster. ```bash serverless-installer script -``` \ No newline at end of file +``` diff --git a/cmd/installer/main_test.go b/cmd/installer/main_test.go index 00203fe..4ba8d9d 100644 --- a/cmd/installer/main_test.go +++ b/cmd/installer/main_test.go @@ -26,3 +26,7 @@ func TestMain(t *testing.T) { assert.Equal(t, 0, exitcode) } + +func TestExit(t *testing.T) { + exit(0) +} diff --git a/internal/cli/interactive/factory_test.go b/internal/cli/interactive/factory_test.go new file mode 100644 index 0000000..f4e024d --- /dev/null +++ b/internal/cli/interactive/factory_test.go @@ -0,0 +1,19 @@ +package interactive + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/wavesoftware/serverless-installer/internal/domain/contract" +) + +func TestCreate(t *testing.T) { + // given + answers := contract.LocationAwareAnswers{} + + // when + screen := Create(&answers) + + // then + assert.NotNil(t, screen) +} diff --git a/internal/cli/runner.go b/internal/cli/runner.go index ce22daa..120d637 100644 --- a/internal/cli/runner.go +++ b/internal/cli/runner.go @@ -1,7 +1,6 @@ package cli import ( - "fmt" "os" "github.com/mkideal/cli" @@ -41,7 +40,7 @@ func (r runner) Run() int { cli.Tree(help), cli.Tree(deploy), ).Run(r.args[1:]); err != nil { - fmt.Fprintln(os.Stderr, err) + logrus.Fatalf("CLI system couldnt parse args: %v. Exiting!", err) return 1 } return 0 diff --git a/internal/cli/runner_test.go b/internal/cli/runner_test.go new file mode 100644 index 0000000..21a9841 --- /dev/null +++ b/internal/cli/runner_test.go @@ -0,0 +1,15 @@ +package cli + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestBasicRunnerFactory(t *testing.T) { + // when + runner := NewRunner() + + // then + assert.NotNil(t, runner) +} diff --git a/internal/domain/contract/answers_test.go b/internal/domain/contract/answers_test.go index dec0b83..a29a892 100644 --- a/internal/domain/contract/answers_test.go +++ b/internal/domain/contract/answers_test.go @@ -13,3 +13,8 @@ func TestStruct(t *testing.T) { // then assert.NotNil(t, answers) } + +func TestFilename(t *testing.T) { + // then + assert.NotEmpty(t, AnswersFilename) +}