Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added tests for new terraform environment #167

Merged
merged 1 commit into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manager/environment/new_packer_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/samber/oops"
)

// Creates a new Packer environment for the given cloud.
func NewPackerEnvironment(
cloud iota.Cloud,
) (*Environment[*PackerBaseEnvironment], error) {
Expand Down
4 changes: 2 additions & 2 deletions manager/environment/new_terraform_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/samber/oops"
)

// Creates a new Terraform environment for the given cloud.
func NewTerraformEnvironment(
pathToPackerManifest string,
cloud iota.Cloud,
Expand All @@ -14,8 +15,7 @@ func NewTerraformEnvironment(
With("cloud", cloud).
With("pathToPackerManifest", pathToPackerManifest).
In("manager").
In("environment").
Tags("TerraformEnvironment")
In("environment")

base := NewTerraformBaseEnvironment()

Expand Down
19 changes: 19 additions & 0 deletions manager/environment/tests/new_terraform_environment_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package tests

import (
"github.com/ed3899/kumo/manager/environment"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("NewTerraformEnvironment", func() {
Context("when the cloud is unknown", func() {
It("returns an error", func() {
_, err := environment.NewTerraformEnvironment(
"",
-1,
)
Expect(err).To(HaveOccurred())
})
})
})