kube-logging / logging-operator

Logging operator for Kubernetes
https://kube-logging.dev
Apache License 2.0
1.53k stars 326 forks source link

add coverage reporting for e2e tests #1726

Closed nak0f closed 3 weeks ago

nak0f commented 4 months ago

fixes #1533

nak0f commented 4 months ago

This works in my local but didn't work in Github CI. Most likely, kind host volume mounts don't work in here. I will try to solve this with something else.

nak0f commented 4 months ago

Below you can see output from the fist successful run:

--- E2E test coverage report
go tool covdata percent -i=/home/runner/work/logging-operator/logging-operator/build/_test_coverage/covdatafiles
    github.com/kube-logging/logging-operator        coverage: 57.7% of statements
    github.com/kube-logging/logging-operator/controllers/extensions     coverage: 5.9% of statements
    github.com/kube-logging/logging-operator/controllers/logging        coverage: 75.5% of statements
    github.com/kube-logging/logging-operator/pkg/compression        coverage: 0.0% of statements
    github.com/kube-logging/logging-operator/pkg/mirror     coverage: 65.0% of statements
    github.com/kube-logging/logging-operator/pkg/resources      coverage: 100.0% of statements
    github.com/kube-logging/logging-operator/pkg/resources/annotation       coverage: 0.0% of statements
    github.com/kube-logging/logging-operator/pkg/resources/configcheck      coverage: 76.7% of statements
    github.com/kube-logging/logging-operator/pkg/resources/eventtailer      coverage: 0.0% of statements
    github.com/kube-logging/logging-operator/pkg/resources/fluentbit        coverage: 60.5% of statements
    github.com/kube-logging/logging-operator/pkg/resources/fluentd      coverage: 62.7% of statements
    github.com/kube-logging/logging-operator/pkg/resources/hosttailer       coverage: 0.0% of statements
    github.com/kube-logging/logging-operator/pkg/resources/kubetool     coverage: 25.0% of statements
    github.com/kube-logging/logging-operator/pkg/resources/loggingdataprovider          github.com/kube-logging/logging-operator/pkg/resources/model        coverage: 68.3% of statements
    github.com/kube-logging/logging-operator/pkg/resources/nodeagent        coverage: 0.4% of statements
    github.com/kube-logging/logging-operator/pkg/resources/prometheus-operator      coverage: 0.0% of statements
    github.com/kube-logging/logging-operator/pkg/resources/syslogng     coverage: 57.1% of statements
    github.com/kube-logging/logging-operator/pkg/resources/templates        coverage: 75.0% of statements
    github.com/kube-logging/logging-operator/pkg/resources/volumepath       coverage: 0.0% of statements
    github.com/kube-logging/logging-operator/pkg/webhook/podhandler     coverage: 0.0% of statements
pepov commented 4 months ago

@nak0f this looks good, do you think this is now ready for review?

nak0f commented 4 months ago

@nak0f this looks good, do you think this is now ready for review?

I was thinking of merging these with unit test coverage. Maybe adding a CI step with a coverage check. Is it better to keep this separate and leave these for future?

pepov commented 4 months ago

whatever works for you, no hurries

nak0f commented 1 month ago

After taking a look, I think it is better to keep E2E test coverage separated as CI and E2E tests run in different Workflows.

Please leave your review when available.