Skip to content

Commit

Permalink
tests: integration e2e tests results in coverage data
Browse files Browse the repository at this point in the history
  • Loading branch information
turtleDev committed Sep 5, 2024
1 parent 713f7c2 commit fa3d4c5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ jobs:
- name: Start raccoon
run: make docker-run
- name: Run tests
run: go test ./... -v -coverprofile=coverage.out
run: go test ./... -v -cover -test.gocoverdir=$PWD/raccoon-coverage/
env:
INTEGTEST_BOOTSTRAP_SERVER: 'localhost:9094'
INTEGTEST_HOST: 'localhost:8080'
INTEGTEST_TOPIC_FORMAT: 'clickstream-%s-log'
GRPC_SERVER_ADDR: 'localhost:8081'
PUBSUB_EMULATOR_HOST: 'localhost:8085'
LOCALSTACK_HOST: 'http://localhost:4566'
- name: Merge coverage data
run: go tool covdata -i=raccoon-coverage -o coverage.out
- name: Upload coverage data
uses: shogo82148/actions-goveralls@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN PROTOC_ZIP=protoc-3.17.3-linux-x86_64.zip && \
unzip -o $PROTOC_ZIP -d /usr/local 'include/*' && \
rm -f $PROTOC_ZIP
COPY . .
RUN make build
RUN make build-cov


FROM debian:bookworm-slim
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ build: ## Build the raccoon binary
go build ${BUILD_FLAGS} ${LD_FLAGS} ${NAME}
@echo "Build complete"

build-cov: ## Build raccoon with coverage instrumentation
@echo "Building raccoon version ${VERSION}..."
go build -cover ${BUILD_FLAGS} ${LD_FLAGS} ${NAME}
@echo "Build complete"

install:
@echo "Installing Raccoon to ${GOBIN}..."
go install ${BUILD_FLAGS} ${LD_FLAGS} ${NAME}
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,14 @@ services:
METRIC_STATSD_ADDRESS: "telegraf:8125"
METRIC_STATSD_FLUSH_PERIOD_MS: 100
LOG_LEVEL: "info"
GOCOVERDIR: /app/raccoon-coverage
ports:
- "8080:8080"
- "8081:8081"
networks:
- cs-network
volumes:
- ./raccoon-coverage/:/app/raccoon-coverage
# telegraf:
# image: telegraf
# volumes:
Expand Down

0 comments on commit fa3d4c5

Please sign in to comment.