Skip to content

cloud storage dedup#1800

Open
Igor-splunk wants to merge 29 commits intodevelopfrom
CSPL-4601-rebased
Open

cloud storage dedup#1800
Igor-splunk wants to merge 29 commits intodevelopfrom
CSPL-4601-rebased

Conversation

@Igor-splunk
Copy link
Copy Markdown
Collaborator

Description

What does this PR have in it?

Key Changes

Highlight the updates in specific files

Testing and Verification

How did you test these changes? What automated tests are added?

Related Issues

Jira tickets, GitHub issues, Support tickets...

PR Checklist

  • Code changes adhere to the project's coding standards.
  • Relevant unit and integration tests are included.
  • Documentation has been updated accordingly.
  • All tests pass locally.
  • The PR description follows the project's guidelines.

kasiakoziol and others added 7 commits March 16, 2026 07:05
* CSPL-4397 Remove time dependency from tests

* CSPL-4397 Removing test reliance on time

* CSPL-4397 Adjusting timeouts

* CSPL-4354 Fixing time dependencies in unit tests and fixing timeouts in integ tests

* CSPL-4397 Move to using watch

* CSPL-4397 Refactor pod reset detection to use UID-based tracking instead of time-based comparison, add fail-fast test prerequisites validation, and improve code clarity with variable renaming

* CSPL-4397 Refactoring

* CSPL-4397 Addressing comments
…1768)

* CSPL-4602 Moving duplicated code for LM tests to a shared codebase

* CSPL-4602 Addinf license manager tests to workflows

* CSPL-4602 Address comments

* CSPL-4602 Moving LM shared test utils to licensemanager package

* CSPL-4602 Addressing base branch changes
* CSPL-4377 Get rid of not expected panic in tests

* CSPL-4377 Check error for app disablement in tests
* Enhance error handling in WaitforPhaseChange and fix variable name in NewTestCaseEnv

* Updated WaitforPhaseChange to log an error if the phase transition is not observed within the timeout.
* Corrected the variable name check in NewTestCaseEnv to use the provided name instead of an uninitialized envName.
* Changed Kind from "ClusterManager" to "ClusterMaster" in ClusterMaster struct.

* Update error logging in WaitforPhaseChange to use Error level for timeout observations
matrix:
test:
[
masterappframeworkc3,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to agree whether we want to run master tests. I had the same concern on license manager/master tests and as of now, they are not run for master.

branches:
- develop
- main
- CSPL-4601-rebased
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remember to remove this before merging

- { order: 3, name: "m4_gcp_sanity" }
- { order: 4, name: "m4_mgr_gcp_sanity" }
- { order: 5, name: "s1_gcp_sanity" }
- { order: 1, name: "masterappframeworkc3" }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same concern here

BeforeEach(func() {
var err error
name := fmt.Sprintf("%s-%s", "master"+testenvInstance.GetName(), testenv.RandomDNSName(3))
fmt.Printf("[DEBUG] M4 BeforeEach starting, name=%s\n", name)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to keep these "logs"?

Comment thread test/testenv/util.go
return
}
logf.Log.Info("[DEBUG] Pod status (wide)", "namespace", ns)
for _, line := range strings.Split(string(output), "\n") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be moved to a separate function

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up!

Comment thread test/testenv/util.go
lines := strings.Split(string(output), "\n")
logf.Log.Info("[DEBUG] Recent events", "namespace", ns, "total", len(lines))
start := 0
if len(lines) > 30 {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

30 could be moved to a constant and referenced from there

return 0
fi

kubectl config set-credentials ci-test-runner --token="${TOKEN}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure that it doesn't get printed out in the pipelines

@vivekr-splunk vivekr-splunk self-requested a review April 10, 2026 14:17
Comment thread test/trigger-tests.sh
echo "License path not set. Changing to GCP default"
export ENTERPRISE_LICENSE_LOCATION="${GCP_ENTERPRISE_LICENSE_LOCATION}"
fi
if [[ -z "${ENTERPRISE_LICENSE_LOCATION}" ]]; then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same if as above, in line 103

@@ -0,0 +1,146 @@
package testenv
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add copyright stmt


func (testenv *TestCaseEnv) setup() error {
testenv.Log.Info("testenv initializing.\n")
testenv.Log.Info("[DEBUG] testenv setup starting", "namespace", testenv.namespace, "clusterProvider", ClusterProvider, "clusterWide", installOperatorClusterWide)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep this DEBUG here and below?

testenv.Log.Info("[DEBUG] Creating namespace...")
err = testenv.createNamespace()
if err != nil {
testenv.Log.Info("[DEBUG] Failed to create namespace", "error", err)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*Error

testenv.Log.Info("[DEBUG] Creating service account...")
err = testenv.createSA()
if err != nil {
testenv.Log.Info("[DEBUG] Failed to create service account", "error", err)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*Error

Comment thread test/testenv/util.go
return
}
logf.Log.Info("[DEBUG] PVC status", "namespace", ns)
for _, line := range strings.Split(string(output), "\n") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be moved to a separate function

Comment thread test/testenv/util.go
func DumpGetEvents(ns string) {
output, err := exec.Command("kubectl", "get", "events", "-n", ns, "--sort-by=.lastTimestamp").Output()
if err != nil {
logf.Log.Info("[DEBUG] Failed to get events", "namespace", ns, "error", err)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*Error

gomega.Eventually(func() string {
_, ver, err := GetPodAppStatus(ctx, deployment, podName, ns, appName, clusterWideInstall)
if err != nil {
testenv.Log.Info("Retrying app version check", "pod", podName, "app", appName, "error", err)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*Error

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these tests are meant to be applicable to all cloud providers, then I would remove any s3 references in names. (It applies to all files under test/appframework/).

run: |
az aks get-credentials --resource-group ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --name ${{ env.TEST_CLUSTER_NAME }} --admin --overwrite-existing
- name: Setup long-lived service account auth
run: |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already in test tools. Could you move it to a separate file and reference it there and here, e.g. as a script file?

Copy link
Copy Markdown
Collaborator

@kubabuczak kubabuczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice job. Can you update PR description?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to check with @vivekr-splunk - he mentioned that we should not change workflow tests

branches:
- develop
- main
- CSPL-4601-rebased
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to remove before merge

- name: Get AKS credentials
run: |
az aks get-credentials --resource-group ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --name ${{ env.TEST_CLUSTER_NAME }} --admin --overwrite-existing
- name: Setup long-lived service account auth
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that such code should not be placed here - workflow should only execute such scripts or contain very simple logic.

appListV1 = testenv.BasicApps
appFileList := testenv.GetAppFileList(appListV1)
ctx := context.TODO()
cloudBackend = testenv.NewCloudStorageBackend(testS3Bucket, testDataS3Bucket)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s3 is AWS specific - maybe testDataBucket?


// GenerateAppFrameworkVolumeSpec returns a VolumeSpec appropriate for the current ClusterProvider.
// Use this instead of calling GenerateIndexVolumeSpec directly with hardcoded provider values.
func GenerateAppFrameworkVolumeSpec(ctx context.Context, testenvInstance *TestCaseEnv, volumeName string) enterpriseApi.VolumeSpec {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] maybe this should be defined as method on *TestCaseEnv?

Comment thread test/testenv/util.go
return
}
logf.Log.Info("[DEBUG] Pod status (wide)", "namespace", ns)
for _, line := range strings.Split(string(output), "\n") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up!

Comment thread test/testenv/verificationutils.go Outdated
DumpGetSplunkVersion(ctx, testenv.GetName(), deployment, "monitoring-console")
return monitoringConsole.Status.Phase
}, ConsistentDuration, ConsistentPollInterval).Should(gomega.Equal(enterpriseApi.PhaseReady))
DumpGetSplunkVersion(ctx, testenv.GetName(), deployment, "monitoring-console")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that this and other Consistently code blocks were added to detect phase flip-flopping. Do we check it somehow now?

The original function was flaky or too slow?

Comment on lines 35 to 36
ConsistentPollInterval = 200 * time.Millisecond
ConsistentDuration = 2000 * time.Millisecond
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are not used - should we remove them?

)

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we are not calling loadEnvFile here?

with:
azcliversion: ${{ steps.dotenv.outputs.AZ_CLI_VERSION }}
inlineScript: |
az aks delete --name ${{ env.TEST_CLUSTER_NAME }} --resource-group ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} -y No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove TEST_CLUSTER_NAME?

Base automatically changed from feature/test-refactoring to develop April 14, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants