Skip to content
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

End to end tests in Golang #951

Merged
merged 5 commits into from
Oct 13, 2023
Merged

End to end tests in Golang #951

merged 5 commits into from
Oct 13, 2023

Conversation

atoulme
Copy link
Contributor

@atoulme atoulme commented Oct 6, 2023

This PR is an effort to create a set of tests that can listen to the different data inputs from the chart, and refer to them for testing. The cluster can continuously report data in, and we can use this data to assert based on the deployment.

This test runs against kind with a variety of kubernetes versions.

@atoulme atoulme changed the title Continuous ingest End to end tests in Golang Oct 7, 2023
@atoulme atoulme marked this pull request as ready for review October 7, 2023 16:16
@atoulme atoulme requested review from a team as code owners October 7, 2023 16:16
.github/workflows/e2e.yaml Outdated Show resolved Hide resolved
.github/workflows/e2e.yaml Outdated Show resolved Hide resolved
Comment on lines 48 to 55
// export KUBECONFIG=/tmp/kube-config-splunk-otel-collector-chart-e2e-testing
// export K8S_VERSION=v1.28.0
// kind create cluster --kubeconfig=/tmp/kube-config-splunk-otel-collector-chart-e2e-testing --config=.github/workflows/configs/e2e-kind-config-$K8S_VERSION.yaml
// cd e2e_tests/testdata/nodejs
// docker build -t nodejs_test:latest .
// kind load docker-image nodejs_test:latest --name kind
// make cert-manager
// kubectl get csr -o=jsonpath='{range.items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs kubectl certificate approve
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be automated w/ existing and updated helpers: https://github.com/signalfx/splunk-otel-collector/tree/main/tests/testutils/kubeutils.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need this PR or equivalent functionality to use helpers, right now they hardcode v1.26, which is something we modulate on to test different versions of Kubernetes.

e2e_tests/e2e_test.go Outdated Show resolved Hide resolved
e2e_tests/e2e_test.go Outdated Show resolved Hide resolved
@atoulme
Copy link
Contributor Author

atoulme commented Oct 9, 2023

Let me pause work on this PR while we get #949 squared away. I'll address your feedback in changes there first.

@atoulme
Copy link
Contributor Author

atoulme commented Oct 10, 2023

OK, this is in a better place now. I can refactor to use helpers now, let me see what I can do.

functional_tests/functional_test.go Outdated Show resolved Hide resolved
functional_tests/functional_test.go Outdated Show resolved Hide resolved
functional_tests/functional_test.go Outdated Show resolved Hide resolved
@dmitryax
Copy link
Contributor

@atoulme looks like the test are failing

Copy link
Contributor

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @atoulme!

@atoulme
Copy link
Contributor Author

atoulme commented Oct 13, 2023

A few follow ups on this PR:

  • I need to continue to work on integrating helpers, and reducing the custom code in this PR.
  • There are a number of improvements to ptracetest, pmetrictest that I have identified.
  • There are a number of things we cannot test in kind, such as journald logs.

@atoulme atoulme merged commit c9a6662 into main Oct 13, 2023
24 checks passed
@atoulme atoulme deleted the continuous_ingest branch October 18, 2023 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants