Skip to content
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ jobs:
mkdir -p /tmp/test-results
find ./test -name "*junit.xml" -exec cp {} /tmp/test-results \;
environment:
TEST_FOCUS: "smoke|ingest_search|monitoring_console|smartstore|licensemaster"
TEST_FOCUS: "smoke|ingest_search|monitoring_console|smartstore|licensemaster|scaling_test"
- store_test_results:
name: Save test results
path: /tmp/test-results
Expand Down
7 changes: 4 additions & 3 deletions test/monitoring_console/monitoring_console_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
. "github.com/onsi/gomega"

enterprisev1 "github.com/splunk/splunk-operator/pkg/apis/enterprise/v1"
splcommon "github.com/splunk/splunk-operator/pkg/splunk/common"
"github.com/splunk/splunk-operator/test/testenv"
)

Expand Down Expand Up @@ -138,7 +139,7 @@ var _ = Describe("Monitoring Console test", func() {
Expect(err).To(Succeed(), "Failed to scale Standalone")

// Ensure standalone is scaling up
testenv.VerifyStandaloneScalingUp(deployment, testenvInstance)
testenv.VerifyStandalonePhase(deployment, testenvInstance, deployment.GetName(), splcommon.PhaseScalingUp)

// Wait for Standalone to be in READY status
testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance)
Expand Down Expand Up @@ -213,7 +214,7 @@ var _ = Describe("Monitoring Console test", func() {
Expect(err).To(Succeed(), "Failed to scale Search Head Cluster")

// Ensure Search Head cluster scales up and go to ScalingUp phase
testenv.VerifySearchHeadClusterScalingUp(deployment, testenvInstance)
testenv.VerifySearchHeadClusterPhase(deployment, testenvInstance, splcommon.PhaseScalingUp)

// Scale indexers
scaledIndexerReplicas := defaultIndexerReplicas + 1
Expand All @@ -231,7 +232,7 @@ var _ = Describe("Monitoring Console test", func() {
Expect(err).To(Succeed(), "Failed to scale Indxer Cluster")

// Ensure Indxer cluster scales up and go to ScalingUp phase
testenv.VerifyIndexerClusterScalingUp(deployment, testenvInstance)
testenv.VerifyIndexerClusterPhase(deployment, testenvInstance, splcommon.PhaseScalingUp, idxcName)

// Deploy Standalone
standalone, err := deployment.DeployStandalone(deployment.GetName())
Expand Down
61 changes: 61 additions & 0 deletions test/scaling_test/scaling_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright (c) 2018-2021 Splunk Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package scalingtest

import (
"testing"
"time"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"

"github.com/splunk/splunk-operator/test/testenv"
)

const (
// PollInterval specifies the polling interval
PollInterval = 5 * time.Second

// ConsistentPollInterval is the interval to use to consistently check a state is stable
ConsistentPollInterval = 200 * time.Millisecond
ConsistentDuration = 2000 * time.Millisecond
)

var (
testenvInstance *testenv.TestEnv
testSuiteName = "scaling-" + testenv.RandomDNSName(2)
)

// TestBasic is the main entry point
func TestBasic(t *testing.T) {

RegisterFailHandler(Fail)

junitReporter := reporters.NewJUnitReporter(testSuiteName + "_junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Running "+testSuiteName, []Reporter{junitReporter})
}

var _ = BeforeSuite(func() {
var err error
testenvInstance, err = testenv.NewDefaultTestEnv(testSuiteName)
Expect(err).ToNot(HaveOccurred())
})

var _ = AfterSuite(func() {
if testenvInstance != nil {
Expect(testenvInstance.Teardown()).ToNot(HaveOccurred())
}
})
Loading