Skip to content

Commit 03323c8

Browse files
[chore] rewrite python tests into golang and remove python tests (#1652)
* rewrite python tests into golang and remove python tests � Conflicts: � .github/workflows/functional_test.yaml � test/k8s_logging_tests/test_config_logging.py * changes after review
1 parent 9b5889d commit 03323c8

22 files changed

+326
-829
lines changed

.github/workflows/functional_test.yaml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name: Splunk Platform Functional Test
33
on:
44
pull_request:
55

6+
env:
7+
GO_VERSION: 1.24.1
8+
# Make sure to exit early if cache segment download times out after 2 minutes.
9+
# We limit cache download as a whole to 5 minutes.
10+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
11+
612
jobs:
713
functional-test:
814
name: K8s ${{ matrix.kubernetes_version }} ${{ matrix.container_runtime }}, Splunk ${{ matrix.splunk_version }}
@@ -42,6 +48,10 @@ jobs:
4248
steps:
4349
- name: Checkout
4450
uses: actions/checkout@v4
51+
- uses: actions/setup-go@v5
52+
with:
53+
go-version: ${{ env.GO_VERSION }}
54+
cache-dependency-path: '**/go.sum'
4555

4656
# # Leave this here for debugging
4757
# - name: Setup upterm session
@@ -97,30 +107,11 @@ jobs:
97107
kubectl apply -f test/test_setup.yaml
98108
sleep 60
99109
100-
- uses: actions/setup-python@v5
101-
with:
102-
python-version: "3.10"
103-
104-
- name: Run functional tests
110+
- name: Run Splunk Integration Tests
105111
run: |
106-
kubectl get nodes
107-
export PYTHONWARNINGS="ignore:Unverified HTTPS request"
108112
export CI_SPLUNK_HOST=$(kubectl get pod splunk --template={{.status.podIP}})
109113
cd test
110-
pip install --upgrade pip
111-
pip install -r requirements.txt
112-
echo "Running functional tests....."
113-
python -m pytest \
114-
--splunkd-url https://$CI_SPLUNK_HOST:8089 \
115-
--splunk-user admin \
116-
--splunk-password $CI_SPLUNK_PASSWORD \
117-
-p no:warnings -s
118-
# # Leave this here for debugging
119-
# sleep 180
120-
# echo "Getting agent logs....."
121-
# kubectl get pods -l release=ci-sck --no-headers=true | awk '/agent/{print $1}' | xargs kubectl logs
122-
# echo "Getting collector logs....."
123-
# kubectl get pods -l release=ci-sck --no-headers=true | awk '/cluster/{print $1}' | xargs kubectl logs
114+
go test -v -tags splunk_integration
124115
125116
- name: Print splunk-otel-collector logs
126117
if: always()

test/README.md

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Splunk Platform Functional Test Environment Setup
22

33
## Prerequisites
4-
* Python version must be > 3.x
4+
* Golang version >= 1.22.10
55
* Kubectl = v1.15.2
66
* Minikube = v1.20.0
77
* Helm = 3.3.x
@@ -52,34 +52,8 @@
5252
For example: `index=ci_events`
5353

5454
## Testing Instructions
55-
1. (Optional) Use a virtual environment for the test
55+
1. Start tests
5656
```
57-
virtualenv --python=python3.6 venv
58-
source venv/bin/activate
57+
go test -v -tags splunk_integration
5958
```
60-
2. Install the dependencies
61-
```
62-
pip install -r requirements.txt
63-
export PYTHONWARNINGS="ignore:Unverified HTTPS request"
64-
```
65-
3. Start the test with the required options configured
66-
```
67-
python -m pytest \
68-
--splunkd-url https://localhost:8089 \
69-
--splunk-user admin \
70-
--splunk-password helloworld \
71-
-p no:warnings -s
72-
```
73-
**Options are:**
74-
--splunkd-url
75-
* Description: splunkd url used to send test data to.
76-
* Default: https://localhost:8089
77-
78-
--splunk-user
79-
* Description: splunk username
80-
* Default: admin
81-
82-
--splunk-password
83-
* Description: splunk user password
84-
* Default: helloworld
8559

test/__init__.py

Whitespace-only changes.

test/common.py

Lines changed: 0 additions & 285 deletions
This file was deleted.

0 commit comments

Comments
 (0)