Conversation
| matrix: | ||
| test: | ||
| [ | ||
| masterappframeworkc3, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" } |
| 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) |
There was a problem hiding this comment.
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") { |
There was a problem hiding this comment.
This could be moved to a separate function
| lines := strings.Split(string(output), "\n") | ||
| logf.Log.Info("[DEBUG] Recent events", "namespace", ns, "total", len(lines)) | ||
| start := 0 | ||
| if len(lines) > 30 { |
There was a problem hiding this comment.
30 could be moved to a constant and referenced from there
| return 0 | ||
| fi | ||
|
|
||
| kubectl config set-credentials ci-test-runner --token="${TOKEN}" |
There was a problem hiding this comment.
We need to make sure that it doesn't get printed out in the pipelines
| echo "License path not set. Changing to GCP default" | ||
| export ENTERPRISE_LICENSE_LOCATION="${GCP_ENTERPRISE_LICENSE_LOCATION}" | ||
| fi | ||
| if [[ -z "${ENTERPRISE_LICENSE_LOCATION}" ]]; then |
There was a problem hiding this comment.
This is the same if as above, in line 103
| @@ -0,0 +1,146 @@ | |||
| package testenv | |||
|
|
||
| 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) |
There was a problem hiding this comment.
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) |
| testenv.Log.Info("[DEBUG] Creating service account...") | ||
| err = testenv.createSA() | ||
| if err != nil { | ||
| testenv.Log.Info("[DEBUG] Failed to create service account", "error", err) |
| return | ||
| } | ||
| logf.Log.Info("[DEBUG] PVC status", "namespace", ns) | ||
| for _, line := range strings.Split(string(output), "\n") { |
There was a problem hiding this comment.
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) |
| 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) |
There was a problem hiding this comment.
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: | |
There was a problem hiding this comment.
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?
kubabuczak
left a comment
There was a problem hiding this comment.
Really nice job. Can you update PR description?
There was a problem hiding this comment.
We have to check with @vivekr-splunk - he mentioned that we should not change workflow tests
| branches: | ||
| - develop | ||
| - main | ||
| - CSPL-4601-rebased |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
[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") { |
| 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") |
There was a problem hiding this comment.
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?
| ConsistentPollInterval = 200 * time.Millisecond | ||
| ConsistentDuration = 2000 * time.Millisecond |
There was a problem hiding this comment.
Those are not used - should we remove them?
| ) | ||
|
|
||
| // TestBasic is the main entry point | ||
| func TestBasic(t *testing.T) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Why remove TEST_CLUSTER_NAME?
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