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

Revert "[chore] cache telemetrygen image to avoid test flakiness" #25853

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 4 additions & 23 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,15 @@ jobs:
run: make -j2 gomoddownload
- name: Build Docker Image
run: |
make docker-otelcontribcol docker-telemetrygen
- name: export otelcontribcol image to tar
make docker-otelcontribcol
- name: export image to tar
run: |
docker save otelcontribcol:latest > /tmp/otelcontribcol.tar
- name: export telemetrygen image to tar
run: |
docker save telemetrygen:latest > /tmp/telemetrygen.tar
- name: Upload otelcontribcol artifact
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: otelcontribcol
path: /tmp/otelcontribcol.tar
- name: Upload telemetrygen artifact
uses: actions/upload-artifact@v3
with:
name: telemetrygen
path: /tmp/telemetrygen.tar
kubernetes-test:
env:
KUBECONFIG: /tmp/kube-config-otelcol-e2e-testing
Expand Down Expand Up @@ -89,23 +81,12 @@ jobs:
with:
name: otelcontribcol
path: /tmp
- name: Load otelcontribcol Docker image
- name: Load Docker image
run: |
docker load --input /tmp/otelcontribcol.tar
- name: Kind load image
run: |
kind load docker-image otelcontribcol:latest --name kind
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: telemetrygen
path: /tmp
- name: Load telemetrygen Docker image
run: |
docker load --input /tmp/telemetrygen.tar
- name: Kind load image
run: |
kind load docker-image telemetrygen:latest --name kind
- name: run k8sclusterreceiver e2e tests
run: |
cd receiver/k8sclusterreceiver
Expand Down
27 changes: 13 additions & 14 deletions processor/k8sattributesprocessor/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ func newExpectedValue(mode int, value string) *expectedValue {
// `/tmp/kube-config-otelcol-e2e-testing`. Run the following command prior to running the test locally:
//
// kind create cluster --kubeconfig=/tmp/kube-config-otelcol-e2e-testing
// make docker-otelcontribcol docker-telemetrygen
// make docker-otelcontribcol
// KUBECONFIG=/tmp/kube-config-otelcol-e2e-testing kind load docker-image otelcontribcol:latest
// KUBECONFIG=/tmp/kube-config-otelcol-e2e-testing kind load docker-image telemetrygen:latest
func TestE2E(t *testing.T) {
kubeConfig, err := clientcmd.BuildConfigFromFlags("", testKubeConfig)
require.NoError(t, err)
Expand Down Expand Up @@ -105,7 +104,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-job"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand All @@ -127,7 +126,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-statefulset"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand All @@ -151,7 +150,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-deployment"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand All @@ -173,7 +172,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-daemonset"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand All @@ -195,7 +194,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-job"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand All @@ -217,7 +216,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-statefulset"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand All @@ -241,7 +240,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-deployment"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand All @@ -263,7 +262,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-daemonset"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand All @@ -285,7 +284,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-job"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand All @@ -307,7 +306,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-statefulset"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand All @@ -331,7 +330,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-deployment"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand All @@ -353,7 +352,7 @@ func TestE2E(t *testing.T) {
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-daemonset"),
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
"k8s.cluster.uid": newExpectedValue(exist, ""),
"container.image.name": newExpectedValue(equal, "telemetrygen"),
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
"container.image.tag": newExpectedValue(equal, "latest"),
"container.id": newExpectedValue(exist, ""),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ spec:
- --rate=1
- --otlp-attributes=service.name="test-{{ .DataType }}-daemonset"
- --otlp-attributes=k8s.container.name="telemetrygen"
image: telemetrygen:latest
imagePullPolicy: Never
image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest
name: telemetrygen
restartPolicy: Always
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
- --rate=1
- --otlp-attributes=service.name="test-{{ .DataType }}-deployment"
- --otlp-attributes=k8s.container.name="telemetrygen"
image: telemetrygen:latest
imagePullPolicy: Never
image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest
imagePullPolicy: IfNotPresent
name: telemetrygen
restartPolicy: Always
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ spec:
- --duration=36000s
- --otlp-attributes=service.name="test-{{ .DataType }}-job"
- --otlp-attributes=k8s.container.name="telemetrygen"
image: telemetrygen:latest
imagePullPolicy: Never
image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest
name: telemetrygen
restartPolicy: OnFailure
restartPolicy: Never
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ spec:
- --rate=1
- --otlp-attributes=service.name="test-{{ .DataType }}-statefulset"
- --otlp-attributes=k8s.container.name="telemetrygen"
image: "telemetrygen:latest"
imagePullPolicy: Never
image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest
name: telemetrygen
restartPolicy: Always
3 changes: 1 addition & 2 deletions receiver/k8sclusterreceiver/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ const testKubeConfig = "/tmp/kube-config-otelcol-e2e-testing"
// `/tmp/kube-config-otelcol-e2e-testing`. Run the following command prior to running the test locally:
//
// kind create cluster --kubeconfig=/tmp/kube-config-otelcol-e2e-testing
// make docker-otelcontribcol docker-telemetrygen
// make docker-otelcontribcol
// KUBECONFIG=/tmp/kube-config-otelcol-e2e-testing kind load docker-image otelcontribcol:latest
// KUBECONFIG=/tmp/kube-config-otelcol-e2e-testing kind load docker-image telemetrygen:latest
func TestE2E(t *testing.T) {
var expected pmetric.Metrics
expectedFile := filepath.Join("testdata", "e2e", "expected.yaml")
Expand Down