-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[chore] Functional tests v2 #949
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
025e4b1
[chore] add e2e tests that test cluster receiver metrics and an attem…
atoulme 51664dd
code review and fix images
atoulme c55982b
wip
atoulme 1fe73c5
traces testing
atoulme 0b7e357
switch order
atoulme 380596d
wip
atoulme 84aa3a2
wip
atoulme bf66417
code review
atoulme 3a98cd9
operator_values.yaml -> test_values.yaml
atoulme 4dc0f42
rename e2e -> functional
atoulme 33da6a5
move up fixing CSRs
atoulme 0ca059e
log using t.Logf
atoulme bab98ad
fix commands to run
atoulme 64dbc7a
add code to write metrics, and disable batch processor
atoulme 49f8e91
Merge branch 'main' into add_e2e_tests
atoulme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
kubeadmConfigPatches: | ||
- | | ||
kind: InitConfiguration | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
node-labels: "ingress-ready=true" | ||
- | | ||
kind: KubeletConfiguration | ||
serverTLSBootstrap: true | ||
extraPortMappings: | ||
- containerPort: 80 | ||
hostPort: 80 | ||
protocol: TCP | ||
- containerPort: 443 | ||
hostPort: 443 | ||
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: functional-tests | ||
|
||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [ main ] | ||
|
||
env: | ||
# Make sure to exit early if cache segment download times out after 2 minutes. | ||
# We limit cache download as a whole to 5 minutes. | ||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 | ||
jobs: | ||
kubernetes-test: | ||
env: | ||
KUBECONFIG: /tmp/kube-config-splunk-otel-collector-chart-functional-testing | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
k8s-version: | ||
- v1.28.0 # Support: 28 Aug 2024 - 28 Oct 2024 | ||
- v1.27.3 # Support: 28 Apr 2024 - 28 Jun 2024 | ||
- v1.26.6 # Support: 28 Dec 2023 - 28 Feb 2024 | ||
- v1.25.11 # Support: 27 Aug 2023 - 27 Oct 2023 | ||
- v1.24.15 # Support: 28 May 2023 - 28 Jul 2023 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ~1.20.8 | ||
cache: false | ||
- name: Cache Go | ||
id: go-cache | ||
timeout-minutes: 5 | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/go/bin | ||
~/go/pkg/mod | ||
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | ||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
with: | ||
node_image: kindest/node:${{ matrix.k8s-version }} | ||
kubectl_version: ${{ matrix.k8s-version }} | ||
cluster_name: kind | ||
config: ./.github/workflows/configs/kind-config.yaml | ||
- name: Fix kubelet TLS server certificates | ||
run: | | ||
kubectl get csr -o=jsonpath='{range.items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs kubectl certificate approve | ||
- name: Update dependencies | ||
run: | | ||
make repo-update dep-build | ||
- name: Deploy cert-manager | ||
run: | | ||
make cert-manager | ||
- name: Build Node.js docker image | ||
run: | | ||
cd functional_tests/testdata/nodejs | ||
docker build -t nodejs_test:latest . | ||
kind load docker-image nodejs_test:latest --name kind | ||
- name: run functional tests | ||
run: | | ||
cd functional_tests | ||
go test -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
helm-charts/splunk-otel-collector/Chart.lock | ||
|
||
**/__pycache__/* | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is cert-manager installation for the operator webhook? if so, then can we just enable the cert-manager dependency when installing helm chart?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that didn't work. I copied the cert-manager testing code from the operator project instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jina's suggestion should theoretically be plausible, I wonder if this a limitation of using kind in a GH workflow. This solution is acceptable for now.
The operator project runs tests in parallel using 1 kind cluster with the kuttl test framework which results in each test case getting a unique k8s namespace to run the test case in. Since you can only have 1 cert-manager per k8s cluster, the operator project runs 'make cert-manager' once when setting up the kind cluster before any tests are run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It really seemed like a weird ordering issue, as in the operator would be failing to get a cert and just hang there. It is probably because of the nature of the deployment, if you install cert-manager at the same time as the operator.
The good news is that we can patch this to use the cert-manager in the helm chart with a smaller delta.