Skip to content

Commit 4d01194

Browse files
CSPL-3964: Fixing failing tests from previous failed run.
1 parent a59f388 commit 4d01194

File tree

5 files changed

+68
-2
lines changed

5 files changed

+68
-2
lines changed

.github/workflows/build-test-push-workflow.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator
6060
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
6161
S3_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
62+
SPLUNK_GENERAL_TERMS: --accept-sgt-current-at-splunk-com
63+
6264
steps:
6365
- name: Set up cosign
6466
uses: sigstore/cosign-installer@main
@@ -115,6 +117,8 @@ jobs:
115117
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
116118
S3_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
117119
IMAGE_NAME: ${{ secrets.ECR_REPOSITORY }}/splunk/splunk-operator:${{ github.sha }}
120+
SPLUNK_GENERAL_TERMS: --accept-sgt-current-at-splunk-com
121+
118122
steps:
119123
- name: Set up cosign
120124
uses: sigstore/cosign-installer@main
@@ -189,6 +193,8 @@ jobs:
189193
EKS_SSH_PUBLIC_KEY: ${{ secrets.EKS_SSH_PUBLIC_KEY }}
190194
CLUSTER_WIDE: "true"
191195
DEPLOYMENT_TYPE: ""
196+
SPLUNK_GENERAL_TERMS: --accept-sgt-current-at-splunk-com
197+
192198
steps:
193199
- name: Set Test Cluster Name
194200
run: |

test/appframework_aws/c3/appframework_aws_suite_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
. "github.com/onsi/gomega"
2424

2525
"github.com/joho/godotenv"
26+
"github.com/splunk/splunk-operator/pkg/splunk/enterprise"
2627
"github.com/splunk/splunk-operator/test/testenv"
2728
)
2829

@@ -100,6 +101,22 @@ func loadEnvFile() error {
100101

101102
var _ = BeforeSuite(func() {
102103
var err error
104+
105+
// Override script locations to use absolute paths for integration tests
106+
// These are relative to test/appframework_aws/c3/, so we go up 3 levels to project root
107+
enterprise.GetReadinessScriptLocation = func() string {
108+
fileLocation, _ := filepath.Abs("../../../tools/k8_probes/readinessProbe.sh")
109+
return fileLocation
110+
}
111+
enterprise.GetLivenessScriptLocation = func() string {
112+
fileLocation, _ := filepath.Abs("../../../tools/k8_probes/livenessProbe.sh")
113+
return fileLocation
114+
}
115+
enterprise.GetStartupScriptLocation = func() string {
116+
fileLocation, _ := filepath.Abs("../../../tools/k8_probes/startupProbe.sh")
117+
return fileLocation
118+
}
119+
103120
testenvInstance, err = testenv.NewDefaultTestEnv(testSuiteName)
104121
Expect(err).ToNot(HaveOccurred())
105122

test/appframework_aws/m4/appframework_aws_suite_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
. "github.com/onsi/ginkgo/v2"
2323
. "github.com/onsi/gomega"
2424

25+
"github.com/splunk/splunk-operator/pkg/splunk/enterprise"
2526
"github.com/splunk/splunk-operator/test/testenv"
2627
)
2728

@@ -63,6 +64,22 @@ func TestBasic(t *testing.T) {
6364

6465
var _ = BeforeSuite(func() {
6566
var err error
67+
68+
// Override script locations to use absolute paths for integration tests
69+
// These are relative to test/appframework_aws/m4/, so we go up 3 levels to project root
70+
enterprise.GetReadinessScriptLocation = func() string {
71+
fileLocation, _ := filepath.Abs("../../../tools/k8_probes/readinessProbe.sh")
72+
return fileLocation
73+
}
74+
enterprise.GetLivenessScriptLocation = func() string {
75+
fileLocation, _ := filepath.Abs("../../../tools/k8_probes/livenessProbe.sh")
76+
return fileLocation
77+
}
78+
enterprise.GetStartupScriptLocation = func() string {
79+
fileLocation, _ := filepath.Abs("../../../tools/k8_probes/startupProbe.sh")
80+
return fileLocation
81+
}
82+
6683
testenvInstance, err = testenv.NewDefaultTestEnv(testSuiteName)
6784
Expect(err).ToNot(HaveOccurred())
6885

test/monitoring_console/monitoring_console_suite_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
package monitoringconsoletest
1717

1818
import (
19+
"path/filepath"
1920
"testing"
2021
"time"
2122

2223
. "github.com/onsi/ginkgo/v2"
2324
. "github.com/onsi/gomega"
2425

26+
"github.com/splunk/splunk-operator/pkg/splunk/enterprise"
2527
"github.com/splunk/splunk-operator/test/testenv"
2628
)
2729

@@ -52,6 +54,22 @@ func TestBasic(t *testing.T) {
5254

5355
var _ = BeforeSuite(func() {
5456
var err error
57+
58+
// Override script locations to use absolute paths for integration tests
59+
// These are relative to test/monitoring_console/, so we go up 2 levels to project root
60+
enterprise.GetReadinessScriptLocation = func() string {
61+
fileLocation, _ := filepath.Abs("../../tools/k8_probes/readinessProbe.sh")
62+
return fileLocation
63+
}
64+
enterprise.GetLivenessScriptLocation = func() string {
65+
fileLocation, _ := filepath.Abs("../../tools/k8_probes/livenessProbe.sh")
66+
return fileLocation
67+
}
68+
enterprise.GetStartupScriptLocation = func() string {
69+
fileLocation, _ := filepath.Abs("../../tools/k8_probes/startupProbe.sh")
70+
return fileLocation
71+
}
72+
5573
testenvInstance, err = testenv.NewDefaultTestEnv(testSuiteName)
5674
Expect(err).ToNot(HaveOccurred())
5775
})

test/testenv/s3utils.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,19 @@ func DisableAppsToS3(downloadDir string, appFileList []string, s3TestDir string)
316316
// Tar disabled app folder
317317
tarDestination := disabledAppsFolder + "/" + key
318318
cmd = exec.Command("tar", "-czf", tarDestination, "--directory", untarredCurrentAppFolder, appFolderName)
319-
cmd.Run()
319+
err = cmd.Run()
320+
if err != nil {
321+
log.Fatalf("Failed to create tar archive for disabled app %s: %v", key, err)
322+
return nil, err
323+
}
320324
}
321325

322326
// Upload disabled apps to S3
323-
uploadedFiles, _ := UploadFilesToS3(testIndexesS3Bucket, s3TestDir, appFileList, disabledAppsFolder)
327+
uploadedFiles, err := UploadFilesToS3(testIndexesS3Bucket, s3TestDir, appFileList, disabledAppsFolder)
328+
if err != nil {
329+
log.Fatalf("Failed to upload disabled apps to S3: %v", err)
330+
return nil, err
331+
}
324332

325333
return uploadedFiles, nil
326334
}

0 commit comments

Comments
 (0)