Skip to content

cloud storage dedup#1800

Open
Igor-splunk wants to merge 19 commits intofeature/test-refactoringfrom
CSPL-4601-rebased
Open

cloud storage dedup#1800
Igor-splunk wants to merge 19 commits intofeature/test-refactoringfrom
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.

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"?

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!

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
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

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

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?

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!

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?

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