Skip to content

Fixes #21: merge test coverage with e2e tests in CI#22

Open
Reactivity512 wants to merge 1 commit into
ozontech:mainfrom
Reactivity512:feature/21-merge-coverage
Open

Fixes #21: merge test coverage with e2e tests in CI#22
Reactivity512 wants to merge 1 commit into
ozontech:mainfrom
Reactivity512:feature/21-merge-coverage

Conversation

@Reactivity512

@Reactivity512 Reactivity512 commented Jun 19, 2026

Copy link
Copy Markdown

Fixes #21: merge test coverage with e2e tests in CI

@metafates metafates left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! Left some review comments

Comment thread .github/workflows/qa.yml
if: runner.os != 'Windows'
run: |
go test -race -v -coverprofile=coverage.out -coverpkg=./... ./...
make coverage-ci TEST_FLAGS="-race -v"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's inline this so that workflow won't depend on Makefile

Comment thread Makefile
go tool cover -func coverage.out

# get test coverage-ci
.PHONY: coverage-ci

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.PHONY isn't needed here because we have MAKEFLAGS += --always-make

Comment thread Makefile
coverage-ci:
go test $(TEST_FLAGS) -coverprofile=coverage.unit.out -coverpkg=./... ./...
go test $(TEST_FLAGS) -tags e2e -coverprofile=coverage.e2e.out -coverpkg=./... ./... || true
go run github.com/dlespiau/covertool@latest merge -o coverage.out coverage.unit.out coverage.e2e.out

@metafates metafates Jun 21, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If possible, I think we should avoid relying on third-party tools.

I think we can simplify this a bit.

Overall, it should look like this:

  1. go test ./... - run unit tests
  2. go test -tags e2e -count 1 ./examples_test.go - run e2e tests
  3. go test -tags example -coverprofile coverage.out -coverpkg ./... ./... || true - run both unit tests and examples (which are invoked from e2e).

@metafates metafates added the enhancement New feature or request label Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge test coverage with e2e tests in CI

2 participants