-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removing unused packages and adding improving coverage
- Loading branch information
1 parent
c43b2d9
commit 683559a
Showing
18 changed files
with
200 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ aftctl64.exe | |
.env | ||
|
||
test | ||
tests | ||
cover.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ coverage: | |
|
||
.PHONY: install | ||
install: | ||
go install ./cmd/rosa | ||
go install ./cmd/aftctl | ||
|
||
.PHONY: fmt | ||
fmt: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package deploy_test | ||
|
||
import ( | ||
ginkgo "github.com/onsi/ginkgo/v2" | ||
gomega "github.com/onsi/gomega" | ||
|
||
"testing" | ||
) | ||
|
||
func TestDeploy(t *testing.T) { | ||
gomega.RegisterFailHandler(ginkgo.Fail) | ||
ginkgo.RunSpecs(t, "Deploy Suite") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package deploy | ||
|
||
import ( | ||
"github.com/edgarsilva948/aftctl/cmd/deploy/aft" | ||
|
||
ginkgo "github.com/onsi/ginkgo/v2" | ||
gomega "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = ginkgo.Describe("Deploy Command", func() { | ||
|
||
ginkgo.Context("Cmd", func() { | ||
ginkgo.It("should have 'deploy' as the use field", func() { | ||
gomega.Expect(Cmd.Use).To(gomega.Equal("deploy")) | ||
}) | ||
|
||
ginkgo.It("should have a slice of aliases containing 'setup'", func() { | ||
gomega.Expect(Cmd.Aliases).To(gomega.ConsistOf("setup")) | ||
}) | ||
|
||
ginkgo.It("should have a short description", func() { | ||
gomega.Expect(Cmd.Short).To(gomega.Equal("Deploy AFT from from stdin")) | ||
}) | ||
|
||
ginkgo.It("should have a long description", func() { | ||
gomega.Expect(Cmd.Long).To(gomega.Equal("Deploy AFT from from stdin")) | ||
}) | ||
|
||
ginkgo.It("should register aft.Cmd as a subcommand", func() { | ||
gomega.Expect(Cmd.HasSubCommands()).To(gomega.BeTrue()) | ||
gomega.Expect(Cmd.Commands()).To(gomega.ContainElement(aft.Cmd)) | ||
}) | ||
}) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
metadata: | ||
name: "batata" | ||
name: "" | ||
|
||
deploymentConfiguration: | ||
createTerraformStateBucket: true | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package tags_test | ||
|
||
import ( | ||
ginkgo "github.com/onsi/ginkgo/v2" | ||
gomega "github.com/onsi/gomega" | ||
|
||
"testing" | ||
) | ||
|
||
func TestTags(t *testing.T) { | ||
gomega.RegisterFailHandler(ginkgo.Fail) | ||
ginkgo.RunSpecs(t, "Tags Suite") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package tags | ||
|
||
import ( | ||
ginkgo "github.com/onsi/ginkgo/v2" | ||
gomega "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = ginkgo.Describe("Tags", func() { | ||
|
||
ginkgo.Context("When defining prefix", func() { | ||
ginkgo.It("should have a prefix as 'created-by-'", func() { | ||
gomega.Expect(prefix).To(gomega.Equal("created-by-")) | ||
}) | ||
}) | ||
|
||
ginkgo.Context("When using Aftctl tag", func() { | ||
ginkgo.It("should concatenate prefix and 'aftctl'", func() { | ||
gomega.Expect(Aftctl).To(gomega.Equal("created-by-aftctl")) | ||
}) | ||
}) | ||
|
||
ginkgo.Context("When using True constant", func() { | ||
ginkgo.It("should be 'true'", func() { | ||
gomega.Expect(True).To(gomega.Equal("true")) | ||
}) | ||
}) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package color_test | ||
|
||
import ( | ||
ginkgo "github.com/onsi/ginkgo/v2" | ||
gomega "github.com/onsi/gomega" | ||
|
||
"testing" | ||
) | ||
|
||
func TestColor(t *testing.T) { | ||
gomega.RegisterFailHandler(ginkgo.Fail) | ||
ginkgo.RunSpecs(t, "Color Suite") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package color | ||
|
||
import ( | ||
ginkgo "github.com/onsi/ginkgo/v2" | ||
gomega "github.com/onsi/gomega" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var _ = ginkgo.Describe("Color", func() { | ||
|
||
ginkgo.Describe("UseColor function", func() { | ||
ginkgo.Context("when color option is 'never'", func() { | ||
ginkgo.It("should return false", func() { | ||
color = "never" | ||
gomega.Expect(UseColor()).To(gomega.BeFalse()) | ||
}) | ||
}) | ||
|
||
ginkgo.Context("when color option is 'always'", func() { | ||
ginkgo.It("should return true", func() { | ||
color = "always" | ||
gomega.Expect(UseColor()).To(gomega.BeTrue()) | ||
}) | ||
}) | ||
}) | ||
|
||
ginkgo.Describe("AddFlag function", func() { | ||
var cmd *cobra.Command | ||
ginkgo.BeforeEach(func() { | ||
cmd = &cobra.Command{} | ||
AddFlag(cmd) | ||
}) | ||
|
||
ginkgo.It("should add a 'color' flag", func() { | ||
gomega.Expect(cmd.PersistentFlags().Lookup("color")).To(gomega.Not(gomega.BeNil())) | ||
}) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package info_test | ||
|
||
import ( | ||
ginkgo "github.com/onsi/ginkgo/v2" | ||
gomega "github.com/onsi/gomega" | ||
|
||
"testing" | ||
) | ||
|
||
func TestInfo(t *testing.T) { | ||
gomega.RegisterFailHandler(ginkgo.Fail) | ||
ginkgo.RunSpecs(t, "Info Suite") | ||
} |
Oops, something went wrong.