Skip to content

Commit

Permalink
feat: add e2e tests for tailing-sidecar-otel
Browse files Browse the repository at this point in the history
  • Loading branch information
kasia-kujawa committed Dec 13, 2023
1 parent 4da64f9 commit 9610fdd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ NAMESPACE ?= tailing-sidecar-system
RELEASE ?= tailing-sidecar
HELM_CHART ?= helm/tailing-sidecar-operator
KUTTL_CONFIG ?= kuttl-test.yaml
TAILING_SIDECAR ?= fluentbit

all: markdownlint yamllint

Expand All @@ -26,7 +27,7 @@ login-ecr:
e2e: IMG="registry.localhost:5000/sumologic/tailing-sidecar-operator:test"
e2e: TAILING_SIDECAR_IMG = "registry.localhost:5000/sumologic/tailing-sidecar:test"
e2e:
$(MAKE) -C ./sidecar/fluentbit build TAG=$(TAILING_SIDECAR_IMG)
$(MAKE) -C ./sidecar/$(TAILING_SIDECAR) build-test-image TAG=$(TAILING_SIDECAR_IMG)
$(MAKE) -C ./operator docker-build IMG=$(IMG) TAILING_SIDECAR_IMG=$(TAILING_SIDECAR_IMG)
kubectl-kuttl test --config $(KUTTL_CONFIG)

Expand Down
2 changes: 2 additions & 0 deletions sidecar/fluentbit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ all: build push
build:
docker build --tag $(TAG) --file Dockerfile .

build-test-image: build

run: build
docker run --rm -it \
-v $(DIR_TO_TAIL):/tmp/host \
Expand Down
8 changes: 7 additions & 1 deletion sidecar/otelcol/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GO ?= go

OS ?= $(shell uname -s | tr A-Z a-z)
ARCH ?= $(shell uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)
LOCALBIN ?= ./bin
LOCALBIN ?= $(shell pwd)/bin

GORELEASER ?= $(LOCALBIN)/goreleaser

Expand All @@ -15,6 +15,8 @@ BUILDER=$(BUILDER_BIN_PATH)/$(BUILDER_BIN_NAME)

INSTALLED_VERSION := $(shell $(BUILDER) version 2>&1)

CONTAINER_REGISTRY := ghcr.io/sumologic/tailing-sidecar-otel

# go-get-tool will 'go get' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
Expand Down Expand Up @@ -57,6 +59,10 @@ endif
build: ensure-correct-builder-version install-goreleaser
@$(GORELEASER) release --snapshot --clean

.PHONY: build-test-image
build-test-image: build
docker tag $(CONTAINER_REGISTRY):latest-$(ARCH) $(TAG)

.PHONY: generate-sources
generate-sources:
$(BUILDER_BIN_NAME) \
Expand Down

0 comments on commit 9610fdd

Please sign in to comment.