Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
00f5b5a
Feature/CSPL-4397 Eliminate reliance on time in tests (#1735)
kasiakoziol Mar 16, 2026
03bf955
Merge branch 'develop' into feature/test-refactoring
kasiakoziol Mar 16, 2026
820d9c7
CSPL-4602 Moving duplicated code for LM tests to a shared codebase (#…
kasiakoziol Mar 16, 2026
064e240
Feature/cspl 4377 remove panic from test (#1777)
kasiakoziol Mar 18, 2026
f3c886f
Merge branch 'develop' into feature/test-refactoring
kasiakoziol Mar 20, 2026
5b7c1d6
Fix Silent Failures (#1785)
kubabuczak Mar 27, 2026
95f58d3
cloud storage dedup
Igor-splunk Mar 29, 2026
96c9c47
move to a single file
Igor-splunk Mar 30, 2026
aee9362
use cloud provider
Igor-splunk Mar 30, 2026
22ba21e
update gcputils
Igor-splunk Mar 30, 2026
f5534f2
find approot gcp
Igor-splunk Mar 30, 2026
f65111d
pass bucket name
Igor-splunk Mar 30, 2026
1814352
replace
Igor-splunk Apr 1, 2026
308a6b4
Up the timeout
Igor-splunk Apr 2, 2026
f3b7bd7
Eventually
Igor-splunk Apr 8, 2026
1ea92b4
metrics server
Igor-splunk Apr 8, 2026
dade2c8
clean up isolation
Igor-splunk Apr 8, 2026
547b647
Run azure one by one
Igor-splunk Apr 9, 2026
d41381c
Add case for empty status
Igor-splunk Apr 10, 2026
32372f2
fix
Igor-splunk Apr 10, 2026
ad9b26c
up the timeout
Igor-splunk Apr 12, 2026
594400e
use v3
Igor-splunk Apr 13, 2026
88777a0
pool eventually
Igor-splunk Apr 13, 2026
4b6b215
up the timeout
Igor-splunk Apr 13, 2026
7cc5715
up the timeout
Igor-splunk Apr 14, 2026
54d16d8
check for flip-flop
Igor-splunk Apr 14, 2026
f0921c1
rename
Igor-splunk Apr 14, 2026
cb92728
remove mid checks
Igor-splunk Apr 14, 2026
2805bd3
Merge conflicts
Igor-splunk Apr 15, 2026
398c08f
Merge conflicts
Igor-splunk Apr 20, 2026
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
112 changes: 76 additions & 36 deletions .github/workflows/int-test-azure-workflow.yml
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

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
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

paths-ignore:
- 'docs/**'
- '*.md'
Expand Down Expand Up @@ -108,6 +109,18 @@ jobs:
inlineScript: |
az aks update -n ${{ env.TEST_CLUSTER_NAME }} -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --attach-acr ${{ secrets.AZURE_CONTAINER_REGISTRY }}
int-tests-appframeworkazure:
strategy:
fail-fast: false
max-parallel: 1
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.

managerappframeworkc3,
masterappframeworkm4,
managerappframeworkm4,
appframeworksS1,
]
runs-on: ubuntu-latest
needs: setup-aks-cluster
env:
Expand All @@ -117,7 +130,7 @@ jobs:
SPLUNK_ENTERPRISE_RELEASE_IMAGE: ${{ secrets.SPLUNK_ENTERPRISE_RELEASE_IMAGE }}
SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator
SPLUNK_OPERATOR_IMAGE_FILENAME: splunk-operator
TEST_FOCUS: azure_sanity
TEST_FOCUS: "${{ matrix.test }}"
# This regex matches any string not containing integration keyword
TEST_TO_SKIP: "^(?:[^i]+|i(?:$|[^n]|n(?:$|[^t]|t(?:$|[^e]|e(?:$|[^g]|g(?:$|[^r]|r(?:$|[^a]|a(?:$|[^t]|t(?:$|[^i]|i(?:$|[^o]|o(?:$|[^n])))))))))))*$"
TEST_CLUSTER_PLATFORM: azure
Expand All @@ -134,7 +147,6 @@ jobs:
AZURE_CONTAINER_REGISTRY_LOGIN_SERVER: ${{ secrets.AZURE_ACR_LOGIN_SERVER }}
AZURE_REGION: ${{ secrets.AZURE_REGION }}
CLUSTER_WIDE: "true"
# AZURE_MANAGED_ID_ENABLED: "${{ matrix.auth_method_managed_id }}"
AZURE_MANAGED_ID_ENABLED: "false"
steps:
# Need this because apps are downloaded from S3.
Expand Down Expand Up @@ -195,38 +207,55 @@ jobs:
run: |
docker tag ${{ env.SPLUNK_ENTERPRISE_IMAGE }} ${{ secrets.AZURE_ACR_LOGIN_SERVER }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }}
docker push ${{ secrets.AZURE_ACR_LOGIN_SERVER }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }}
- name: Azure Kubernetes set context
uses: Azure/aks-set-context@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
resource-group: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
cluster-name: ${{ env.TEST_CLUSTER_NAME }}
- 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.

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?

kubectl create serviceaccount ci-test-runner -n kube-system 2>/dev/null || true
kubectl create clusterrolebinding ci-test-runner-admin \
--clusterrole=cluster-admin \
--serviceaccount=kube-system:ci-test-runner 2>/dev/null || true

cat <<'EOF' | kubectl apply -f -
apiVersion: v1
kind: Secret
metadata:
name: ci-test-runner-token
namespace: kube-system
annotations:
kubernetes.io/service-account.name: ci-test-runner
type: kubernetes.io/service-account-token
EOF

echo "Waiting for service account token..."
TOKEN=""
for i in $(seq 1 30); do
TOKEN=$(kubectl get secret ci-test-runner-token -n kube-system -o jsonpath='{.data.token}' 2>/dev/null | base64 -d 2>/dev/null)
if [ -n "${TOKEN}" ]; then break; fi
sleep 2
done

if [ -n "${TOKEN}" ]; then
kubectl config set-credentials ci-test-runner --token="${TOKEN}"
kubectl config set-context --current --user=ci-test-runner
echo "Switched kubeconfig to long-lived service account token"
else
echo "WARNING: Could not create SA token, keeping admin cert auth"
fi
kubectl cluster-info
- name: install metric server
uses: Azure/aks-set-context@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
resource-group: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
cluster-name: ${{ env.TEST_CLUSTER_NAME }}
inlineScript: |
curl -LO https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
kubectl replace --force -f components.yaml || kubectl apply -f components.yaml
continue-on-error: true
run: |
curl -LO https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.7.2/components.yaml
kubectl replace --force -f components.yaml || kubectl apply -f components.yaml
- name: install k8s dashboard
uses: Azure/aks-set-context@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
resource-group: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
cluster-name: ${{ env.TEST_CLUSTER_NAME }}
inlineScript: |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.5/aio/deploy/recommended.yaml
- name: Setup Kustomize
run: |
sudo snap install kustomize
mkdir -p ./bin
cp /snap/bin/kustomize ./bin/kustomize
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.5/aio/deploy/recommended.yaml
- name: Run Integration test
timeout-minutes: 240
timeout-minutes: 300
env:
TEST_TIMEOUT: 225m
TEST_TIMEOUT: 280m
run: |
make int-test
- name: Collect Test Logs
Expand All @@ -238,31 +267,42 @@ jobs:
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: "splunk-pods-logs--artifacts-appframeworkazure"
name: "splunk-pods-logs--artifacts-${{ matrix.test }}"
path: "/tmp/pod_logs/**"
- name: Upload Integration Test Results
if: always()
uses: actions/upload-artifact@v6
with:
name: "test-report-integration-azure"
name: "test-report-integration-azure-${{ matrix.test }}"
path: report-junit*.xml
- name: Publish Integration Test Report
uses: mikepenz/action-junit-report@v6
if: always()
with:
report_paths: 'report-junit*.xml'
check_name: 'Integration Test Results (Azure)'
check_name: 'Integration Test Results (Azure) - ${{ matrix.test }}'
detailed_summary: true
- name: Cleanup Test Case artifacts
if: ${{ always() }}
run: |
tools/cleanup.sh
make cleanup
make clean
cleanup-aks-cluster:
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [setup-aks-cluster, int-tests-appframeworkazure]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Dotenv Action
id: dotenv
uses: falti/dotenv-action@v1
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Delete AKS Cluster
if: ${{ always() }}
uses: azure/CLI@v1
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
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?

az aks delete --name az${{ github.run_id }} --resource-group ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} -y
60 changes: 18 additions & 42 deletions .github/workflows/int-test-gcp-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
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

paths-ignore:
- 'docs/**'
- '*.md'
Expand Down Expand Up @@ -68,13 +69,14 @@ jobs:

create-cluster-and-run-tests:
strategy:
fail-fast: false
matrix:
test_focus:
- { order: 1, name: "c3_gcp_sanity" }
- { order: 2, name: "c3_mgr_gcp_sanity" }
- { 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

- { order: 2, name: "managerappframeworkc3" }
- { order: 3, name: "masterappframeworkm4" }
- { order: 4, name: "managerappframeworkm4" }
- { order: 5, name: "appframeworksS1" }
runs-on: ubuntu-latest
needs: build-operator-image
env:
Expand All @@ -84,7 +86,7 @@ jobs:
ARTIFACT_REGISTRY: ${{ secrets.GCP_ARTIFACT_REGISTRY }}
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GCP_REGION: ${{ secrets.GCP_REGION }}
AWS_S3_REGION: ${{ secrets.GCP_REGION }}
GCP_STORAGE_REGION: ${{ secrets.GCP_REGION }}
GCP_ZONE: ${{ secrets.GCP_ZONE }}
GCP_NETWORK: default # Adjust if using a custom network
GCP_SUBNETWORK: default # Adjust if using a custom subnetwork
Expand Down Expand Up @@ -112,7 +114,7 @@ jobs:
GCP_TEST_CONTAINER: ${{ secrets.GCP_TEST_CONTAINER}}
GCP_INDEXES_CONTAINER: ${{ secrets.GCP_INDEXES_CONTAINER}}
ECR_REPOSITORY: ${{ secrets.GCP_ARTIFACT_REGISTRY }}
GCP_CONTAINER_REGISTRY_LOGIN_SERVER: ${{ secrets.AZURE_ACR_LOGIN_SERVER }}
GCP_CONTAINER_REGISTRY_LOGIN_SERVER: ${{ secrets.GCP_ARTIFACT_REGISTRY }}
steps:
- name: Set Test Cluster Name
run: |
Expand All @@ -136,46 +138,28 @@ jobs:
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
install_components: 'kubectl'
install_components: 'kubectl,gke-gcloud-auth-plugin'

- name: Set GCP Project
run: |
gcloud config set project ${{ env.GCP_PROJECT_ID }}
echo "USE_GKE_GCLOUD_AUTH_PLUGIN=True" >> $GITHUB_ENV

- name: Create GKE Cluster
run: |
export EKS_CLUSTER_K8_VERSION=${{ steps.dotenv.outputs.EKS_CLUSTER_K8_VERSION }}
export GKE_CLUSTER_K8_VERSION=${{ steps.dotenv.outputs.EKS_CLUSTER_K8_VERSION }}
make cluster-up

- name: Get Kubernetes Credentials
run: |
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.GCP_ZONE }} --project ${{ env.GCP_PROJECT_ID }}

- name: Allow Pulling from Artifact Registry
run: |
gcloud auth configure-docker ${{ secrets.GCP_ARTIFACT_REGISTRY }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
install_components: 'kubectl'

- name: Change Splunk Enterprise Image on Main Branches
if: github.ref == 'refs/heads/main'
run: |
echo "SPLUNK_ENTERPRISE_IMAGE=${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_RELEASE_IMAGE }}" >> $GITHUB_ENV

- name: Authenticate to GCP
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}

- name: Set GCP Project
run: |
gcloud config set project ${{ env.GCP_PROJECT_ID }}

- name: Install Kubectl
uses: azure/setup-kubectl@v3
with:
Expand Down Expand Up @@ -224,19 +208,10 @@ jobs:
docker tag ${{ env.SPLUNK_ENTERPRISE_IMAGE }} ${{ secrets.GCP_ARTIFACT_REGISTRY }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }}
docker push ${{ secrets.GCP_ARTIFACT_REGISTRY }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }}

- name: Get Kubernetes Credentials
run: |
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.GCP_ZONE }} --project ${{ env.GCP_PROJECT_ID }}

- name: Get GKE Credentials
uses: google-github-actions/get-gke-credentials@v1
with:
cluster_name: ${{ env.CLUSTER_NAME }}
location: ${{ env.GCP_ZONE }}

- name: Install Metrics Server
continue-on-error: true
run: |
curl -LO https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
curl -LO https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.7.2/components.yaml
kubectl replace --force -f components.yaml || kubectl apply -f components.yaml

- name: Install Kubernetes Dashboard
Expand All @@ -245,8 +220,9 @@ jobs:

- name: Setup Kustomize
run: |
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
sudo mv kustomize /usr/local/bin/
sudo snap install kustomize
mkdir -p ./bin
cp /snap/bin/kustomize ./bin/kustomize

- name: Verify kubectl Configuration
run: |
Expand All @@ -257,9 +233,9 @@ jobs:
kubectl apply -f test/gcp-storageclass.yaml

- name: Run Integration Tests
timeout-minutes: 240
timeout-minutes: 300
env:
TEST_TIMEOUT: 225m
TEST_TIMEOUT: 280m
run: |
export GCP_SERVICE_ACCOUNT_KEY=${{ secrets.GCP_SERVICE_ACCOUNT_KEY_BASE64 }}
make int-test
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,9 @@ $(CONTROLLER_GEN): $(LOCALBIN)
test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_TOOLS_VERSION}

KUSTOMIZE = $(LOCALBIN)/kustomize
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
test -s $(LOCALBIN)/kustomize || curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,${KUSTOMIZE_VERSION}) $(LOCALBIN)
test -s $(LOCALBIN)/kustomize || GOBIN=$(LOCALBIN) go install sigs.k8s.io/kustomize/kustomize/v5@${KUSTOMIZE_VERSION}

ENVTEST = $(LOCALBIN)/setup-envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
Expand Down
4 changes: 4 additions & 0 deletions pkg/splunk/enterprise/searchheadclusterpodmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ func (mgr *searchHeadClusterPodManager) FinishRecycle(ctx context.Context, n int
mgr.log.Info("Releasing search head cluster member from detention", "memberName", memberName)
c := mgr.getClient(ctx, n)
return false, c.SetSearchHeadDetention(false)

case "":
mgr.log.Info("Member has empty Status, waiting for pod to rejoin cluster", "memberName", memberName)
return false, nil
}

// unhandled status
Expand Down
Loading
Loading