Skip to content

Commit

Permalink
Added basic integration test
Browse files Browse the repository at this point in the history
This test will only create a cluster and collect logs from it.
  • Loading branch information
huutomerkki committed Jul 25, 2023
1 parent f4eedc0 commit a0979d8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if [[ ${GINKGO_FOCUS:-} == "clusterctl-upgrade" ]]; then
fi

# Integration test environment vars and config
if [[ ${GINKGO_FOCUS:-} == "integration" ]]; then
if [[ ${GINKGO_FOCUS:-} == "integration" || ${GINKGO_FOCUS:-} == "basic" ]]; then
export NUM_NODES=${NUM_NODES:-"2"}
export CONTROL_PLANE_MACHINE_COUNT=${CONTROL_PLANE_MACHINE_COUNT:-"1"}
export WORKER_MACHINE_COUNT=${WORKER_MACHINE_COUNT:-"1"}
Expand Down
32 changes: 32 additions & 0 deletions test/e2e/basic_integration_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package e2e

import (
"os"
"path/filepath"
"strings"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("When testing basic cluster creation [basic]", func() {
BeforeEach(func() {
osType := strings.ToLower(os.Getenv("OS"))
Expect(osType).ToNot(Equal(""))
validateGlobals(specName)

// We need to override clusterctl apply log folder to avoid getting our credentials exposed.
clusterctlLogFolder = filepath.Join(os.TempDir(), "clusters", bootstrapClusterProxy.GetName())
})

It("Should create a workload cluster", func() {
By("Fetching cluster configuration")
k8sVersion := e2eConfig.GetVariable("KUBERNETES_VERSION")
By("Provision Workload cluster")
targetCluster, _ = createTargetCluster(k8sVersion)
})

AfterEach(func() {
DumpSpecResourcesAndCleanup(ctx, specName, bootstrapClusterProxy, artifactFolder, namespace, e2eConfig.GetIntervals, clusterName, clusterctlLogFolder, skipCleanup)
})
})

0 comments on commit a0979d8

Please sign in to comment.