Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoravong committed Dec 17, 2024
1 parent 7d9a80c commit a7ef52c
Show file tree
Hide file tree
Showing 15 changed files with 232 additions and 169 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/functional_test_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
KUBECONFIG: /tmp/kube-config-splunk-otel-collector-chart-functional-testing
KUBE_TEST_ENV: kind
UPDATE_EXPECTED_RESULTS: ${{ github.event.inputs.UPDATE_EXPECTED_RESULTS || 'false' }}
DEBUG: ${{ github.event.inputs.DEBUG || 'false' }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -71,11 +72,25 @@ jobs:
run: |
make cert-manager
- name: run functional tests
id: run-functional-tests
env:
K8S_VERSION: ${{ matrix.k8s-version }}
run: |
cd functional_tests
TEARDOWN_BEFORE_SETUP=true UPDATE_EXPECTED_RESULTS=${{ env.UPDATE_EXPECTED_RESULTS }} go test -v -tags ${{ matrix.test-job }}
- name: Collect Kubernetes Cluster debug info on failure
if: always() && failure()
id: collect-debug-info
run: |
echo "Functional tests failed. Collecting debug info for current state of the Kubernetes cluster..."
./tools/splunk_kubernetes_debug_info.sh
- name: 'Upload Kubernetes Cluster debug info'
if: always() && steps.collect-debug-info.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: k8s-debug-info-${{ matrix.test-job }}-${{ matrix.k8s-version }}
path: splunk_kubernetes_debug_info*
retention-days: 5
- name: 'Upload test results'
if: always() && env.UPDATE_EXPECTED_RESULTS == 'true'
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -400,7 +415,6 @@ jobs:
env:
GCE_KUBECONFIG: ${{ secrets.GCE_KUBECONFIG }}
- name: run functional tests
uses: mobiledevops/secret-to-file-action@v1
env:
HOST_ENDPOINT: 0.0.0.0
KUBECONFIG: /tmp/kubeconfig
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea
*.iml
.DS_Store
*splunk_kubernetes_debug_info*

# Helm
**/charts/*.tgz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ spec:
spec:
containers:
- name: startupapicheck
image: "busybox:latest"

image: registry.access.redhat.com/ubi9/ubi
env:
- name: MANAGER_METRICS_SERVICE_CLUSTERIP
value: "default-splunk-otel-collector-operator"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ spec:
template:
spec:
containers:
- name: wget
image: "busybox:latest"
- name: startupapicheck

image: registry.access.redhat.com/ubi9/ubi
env:
- name: WEBHOOK_SERVICE_CLUSTERIP
value: "default-splunk-otel-collector-operator-webhook"
Expand Down
6 changes: 3 additions & 3 deletions functional_tests/configuration_switching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ func setupHEC(t *testing.T) (*consumertest.LogsSink, *consumertest.MetricsSink)

lc := new(consumertest.LogsSink)
mc := new(consumertest.MetricsSink)
rcvr, err := f.CreateLogsReceiver(context.Background(), receivertest.NewNopSettings(), cfg, lc)
mrcvr, err := f.CreateMetricsReceiver(context.Background(), receivertest.NewNopSettings(), mCfg, mc)
rcvr, err := f.CreateLogs(context.Background(), receivertest.NewNopSettings(), cfg, lc)
mrcvr, err := f.CreateMetrics(context.Background(), receivertest.NewNopSettings(), mCfg, mc)
require.NoError(t, err)

require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
Expand All @@ -485,7 +485,7 @@ func setupHECLogsObjects(t *testing.T) *consumertest.LogsSink {
cfg.Endpoint = fmt.Sprintf("0.0.0.0:%d", hecLogsObjectsReceiverPort)

lc := new(consumertest.LogsSink)
rcvr, err := f.CreateLogsReceiver(context.Background(), receivertest.NewNopSettings(), cfg, lc)
rcvr, err := f.CreateLogs(context.Background(), receivertest.NewNopSettings(), cfg, lc)
require.NoError(t, err)

require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
Expand Down
15 changes: 5 additions & 10 deletions functional_tests/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ func setupTraces(t *testing.T) *consumertest.TracesSink {
cfg.Protocols.GRPC.NetAddr.Endpoint = fmt.Sprintf("0.0.0.0:%d", otlpReceiverPort)
cfg.Protocols.HTTP.Endpoint = fmt.Sprintf("0.0.0.0:%d", otlpHTTPReceiverPort)

rcvr, err := f.CreateTracesReceiver(context.Background(), receivertest.NewNopSettings(), cfg, tc)
rcvr, err := f.CreateTraces(context.Background(), receivertest.NewNopSettings(), cfg, tc)
require.NoError(t, err)

require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
Expand All @@ -1420,7 +1420,7 @@ func setupSignalfxReceiver(t *testing.T, port int) *consumertest.MetricsSink {
cfg := f.CreateDefaultConfig().(*signalfxreceiver.Config)
cfg.Endpoint = fmt.Sprintf("0.0.0.0:%d", port)

rcvr, err := f.CreateMetricsReceiver(context.Background(), receivertest.NewNopSettings(), cfg, mc)
rcvr, err := f.CreateMetrics(context.Background(), receivertest.NewNopSettings(), cfg, mc)
require.NoError(t, err)

require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
Expand All @@ -1443,8 +1443,8 @@ func setupHEC(t *testing.T) (*consumertest.LogsSink, *consumertest.MetricsSink)

lc := new(consumertest.LogsSink)
mc := new(consumertest.MetricsSink)
rcvr, err := f.CreateLogsReceiver(context.Background(), receivertest.NewNopSettings(), cfg, lc)
mrcvr, err := f.CreateMetricsReceiver(context.Background(), receivertest.NewNopSettings(), mCfg, mc)
rcvr, err := f.CreateLogs(context.Background(), receivertest.NewNopSettings(), cfg, lc)
mrcvr, err := f.CreateMetrics(context.Background(), receivertest.NewNopSettings(), mCfg, mc)
require.NoError(t, err)

require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
Expand All @@ -1468,7 +1468,7 @@ func setupHECLogsObjects(t *testing.T) *consumertest.LogsSink {
cfg.Endpoint = fmt.Sprintf("0.0.0.0:%d", hecLogsObjectsReceiverPort)

lc := new(consumertest.LogsSink)
rcvr, err := f.CreateLogsReceiver(context.Background(), receivertest.NewNopSettings(), cfg, lc)
rcvr, err := f.CreateLogs(context.Background(), receivertest.NewNopSettings(), cfg, lc)
require.NoError(t, err)

require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost()))
Expand All @@ -1480,11 +1480,6 @@ func setupHECLogsObjects(t *testing.T) *consumertest.LogsSink {
return lc
}

type dimensionFilter struct {
key string
value string
}

func checkMetricsAreEmitted(t *testing.T, mc *consumertest.MetricsSink, metricNames []string, matchFn func(string, pcommon.Map) bool) {
metricsToFind := map[string]bool{}
for _, name := range metricNames {
Expand Down
78 changes: 39 additions & 39 deletions functional_tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ go 1.22.0
toolchain go1.22.5

require (
github.com/docker/docker v27.1.1+incompatible
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.106.1
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.106.2-0.20240808194002-5374bbac3595
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/signalfxreceiver v0.106.1
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/splunkhecreceiver v0.106.1
github.com/docker/docker v27.3.1+incompatible
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.115.0
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/signalfxreceiver v0.115.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/splunkhecreceiver v0.115.0
github.com/stretchr/testify v1.10.0
go.opentelemetry.io/collector/component/componenttest v0.115.0
go.opentelemetry.io/collector/consumer/consumertest v0.115.0
go.opentelemetry.io/collector/pdata v1.21.0
go.opentelemetry.io/collector/receiver/otlpreceiver v0.113.0
go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0
go.opentelemetry.io/collector/receiver/receivertest v0.115.0
gopkg.in/yaml.v3 v3.0.1
helm.sh/helm/v3 v3.16.3
Expand Down Expand Up @@ -98,7 +98,7 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/knadh/koanf v1.5.0 // indirect
github.com/knadh/koanf/v2 v2.1.1 // indirect
github.com/knadh/koanf/v2 v2.1.2 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/lib/pq v1.10.9 // indirect
Expand All @@ -117,16 +117,16 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/mostynb/go-grpc-compression v1.2.3 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/extension/ackextension v0.106.1 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.106.1 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.106.1 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.106.1 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.106.1 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/signalfx v0.106.1 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/extension/ackextension v0.115.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.115.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/signalfx v0.115.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
Expand All @@ -151,35 +151,35 @@ require (
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.opentelemetry.io/collector v0.113.0 // indirect
go.opentelemetry.io/collector/client v1.19.0 // indirect
go.opentelemetry.io/collector v0.115.0 // indirect
go.opentelemetry.io/collector/client v1.21.0 // indirect
go.opentelemetry.io/collector/component v0.115.0 // indirect
go.opentelemetry.io/collector/component/componentstatus v0.113.0 // indirect
go.opentelemetry.io/collector/config/configauth v0.113.0 // indirect
go.opentelemetry.io/collector/config/configcompression v1.19.0 // indirect
go.opentelemetry.io/collector/config/configgrpc v0.113.0 // indirect
go.opentelemetry.io/collector/config/confighttp v0.113.0 // indirect
go.opentelemetry.io/collector/config/confignet v1.19.0 // indirect
go.opentelemetry.io/collector/config/configopaque v1.19.0 // indirect
go.opentelemetry.io/collector/config/configretry v1.12.0 // indirect
go.opentelemetry.io/collector/component/componentstatus v0.115.0 // indirect
go.opentelemetry.io/collector/config/configauth v0.115.0 // indirect
go.opentelemetry.io/collector/config/configcompression v1.21.0 // indirect
go.opentelemetry.io/collector/config/configgrpc v0.115.0 // indirect
go.opentelemetry.io/collector/config/confighttp v0.115.0 // indirect
go.opentelemetry.io/collector/config/confignet v1.21.0 // indirect
go.opentelemetry.io/collector/config/configopaque v1.21.0 // indirect
go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect
go.opentelemetry.io/collector/config/configtls v1.19.0 // indirect
go.opentelemetry.io/collector/config/internal v0.113.0 // indirect
go.opentelemetry.io/collector/confmap v1.19.0 // indirect
go.opentelemetry.io/collector/config/configtls v1.21.0 // indirect
go.opentelemetry.io/collector/config/internal v0.115.0 // indirect
go.opentelemetry.io/collector/confmap v1.21.0 // indirect
go.opentelemetry.io/collector/consumer v1.21.0 // indirect
go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect
go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect
go.opentelemetry.io/collector/exporter v0.106.1 // indirect
go.opentelemetry.io/collector/extension v0.113.0 // indirect
go.opentelemetry.io/collector/extension/auth v0.113.0 // indirect
go.opentelemetry.io/collector/extension/experimental/storage v0.113.0 // indirect
go.opentelemetry.io/collector/featuregate v1.12.0 // indirect
go.opentelemetry.io/collector/internal/sharedcomponent v0.113.0 // indirect
go.opentelemetry.io/collector/exporter v0.115.0 // indirect
go.opentelemetry.io/collector/extension v0.115.0 // indirect
go.opentelemetry.io/collector/extension/auth v0.115.0 // indirect
go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect
go.opentelemetry.io/collector/featuregate v1.21.0 // indirect
go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0 // indirect
go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect
go.opentelemetry.io/collector/pipeline v0.115.0 // indirect
go.opentelemetry.io/collector/receiver v0.115.0 // indirect
go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect
go.opentelemetry.io/collector/semconv v0.106.1 // indirect
go.opentelemetry.io/collector/semconv v0.115.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
go.opentelemetry.io/otel v1.32.0 // indirect
Expand All @@ -190,13 +190,13 @@ require (
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/term v0.26.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/grpc v1.67.1 // indirect
Expand Down
Loading

0 comments on commit a7ef52c

Please sign in to comment.