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

[repo] Clean up codecov #2216

Merged
merged 2 commits into from
Oct 16, 2024
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
74 changes: 65 additions & 9 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,48 @@ comment:

ignore:
- "**.md"
- "src/Shared" # copied from main OTel project and has code coverage there
- "test"
- "examples"
- "build"
- ".github"
- ".vscode"

flags:
unittests-Solution:
unittests-Exporter.Geneva:
carryforward: true
paths:
- src
- src/OpenTelemetry.Exporter.Geneva

unittests-Exporter.Geneva:
unittests-Exporter.InfluxDB:
carryforward: true
paths:
- src/OpenTelemetry.Exporter.Geneva
- src/OpenTelemetry.Exporter.InfluxDB

unittests-Exporter.Instana:
carryforward: true
paths:
- src/OpenTelemetry.Exporter.Instana

unittests-Exporter.OneCollector:
carryforward: true
paths:
- src/OpenTelemetry.Exporter.OneCollector

unittests-Exporter.Stackdriver:
carryforward: true
paths:
- src/OpenTelemetry.Exporter.Stackdriver

unittests-Extensions:
carryforward: true
paths:
- src/OpenTelemetry.Extensions

unittests-Extensions.Enrichment:
carryforward: true
paths:
- src/OpenTelemetry.Extensions.Enrichment

unittests-Instrumentation.AspNet:
carryforward: true
paths:
Expand All @@ -70,26 +84,52 @@ flags:
- src/OpenTelemetry.Instrumentation.AWS
- src/OpenTelemetry.Instrumentation.AWSLambda

# Note: No unit tests currently for Cassandra being run in CI.
#unittests-Instrumentation.Cassandra:
# carryforward: true
# paths:
# - src/OpenTelemetry.Instrumentation.Cassandra

unittests-Instrumentation.ConfluentKafka:
carryforward: true
paths:
- src/OpenTelemetry.Instrumentation.ConfluentKafka

unittests-Instrumentation.ElasticsearchClient:
carryforward: true
paths:
- src/OpenTelemetry.Instrumentation.ElasticsearchClient

unittests-Instrumentation.EntityFrameworkCore:
carryforward: true
paths:
- src/OpenTelemetry.Instrumentation.EntityFrameworkCore

unittests-Instrumentation.EventCounters:
carryforward: true
paths:
- src/OpenTelemetry.Instrumentation.EventCounters

unittests-Instrumentation.Http:
unittests-Instrumentation.GrpcCore:
carryforward: true
paths:
- src/OpenTelemetry.Instrumentation.Http
- src/OpenTelemetry.Instrumentation.GrpcCore

unittests-Instrumentation.GrpcNetClient:
carryforward: true
paths:
- src/OpenTelemetry.Instrumentation.GrpcNetClient

unittests-Instrumentation.Hangfire:
carryforward: true
paths:
- src/OpenTelemetry.Instrumentation.Hangfire

unittests-Instrumentation.Http:
carryforward: true
paths:
- src/OpenTelemetry.Instrumentation.Http

unittests-Instrumentation.Owin:
carryforward: true
paths:
Expand All @@ -100,6 +140,11 @@ flags:
paths:
- src/OpenTelemetry.Instrumentation.Process

unittests-Instrumentation.Quartz:
carryforward: true
paths:
- src/OpenTelemetry.Instrumentation.Quartz

unittests-Instrumentation.Runtime:
carryforward: true
paths:
Expand Down Expand Up @@ -136,6 +181,11 @@ flags:
paths:
- src/OpenTelemetry.Resources.Azure

unittests-Resources.Container:
carryforward: true
paths:
- src/OpenTelemetry.Resources.Container

unittests-Resources.Gcp:
carryforward: true
paths:
Expand Down Expand Up @@ -166,7 +216,13 @@ flags:
paths:
- src/OpenTelemetry.Sampler.AWS

unittests-SemanticConventions:
# Note: No unit tests currently for SemanticConventions being run in CI.
#unittests-SemanticConventions:
# carryforward: true
# paths:
# - src/OpenTelemetry.SemanticConventions

unittests-Contrib.Shared.Tests:
carryforward: true
paths:
- src/OpenTelemetry.SemanticConventions
- src/Shared
10 changes: 8 additions & 2 deletions .github/workflows/Component.BuildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
project-name:
required: true
type: string
run-tests:
required: false
default: true
type: boolean
code-cov-name:
required: true
type: string
Expand Down Expand Up @@ -87,21 +91,23 @@ jobs:
run: dotnet build ${{ steps.resolve-project.outputs.project }} --configuration Release --no-restore

- name: dotnet test ${{ steps.resolve-project.outputs.title }}
if: ${{ inputs.run-tests }}
run: dotnet test ${{ steps.resolve-project.outputs.project }} --collect:"Code Coverage" --results-directory:TestResults --framework ${{ matrix.version }} --configuration Release --no-restore --no-build --logger:"console;verbosity=detailed" -- RunConfiguration.DisableAppDomain=true

- name: dotnet pack ${{ steps.resolve-project.outputs.title }}
if: ${{ matrix.os == 'windows-latest' }}
run: dotnet pack ${{ steps.resolve-project.outputs.project }} --configuration Release --no-restore --no-build -p:EnablePackageValidation=true

- name: Install coverage tool
if: ${{ inputs.run-tests }}
run: dotnet tool install -g dotnet-coverage

- name: Merging test results
if: ${{ hashFiles('./TestResults/**/*.coverage') != '' }}
if: ${{ inputs.run-tests && hashFiles('./TestResults/**/*.coverage') != '' }}
run: dotnet-coverage merge -f cobertura -o ./TestResults/Cobertura.xml ./TestResults/**/*.coverage

- name: Upload code coverage ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }}
if: ${{ hashFiles('./TestResults/Cobertura.xml') != '' }}
if: ${{ inputs.run-tests && hashFiles('./TestResults/Cobertura.xml') != '' }}
uses: codecov/codecov-action@v4
continue-on-error: true # Note: Don't fail for upload failures
env:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ jobs:
with:
project-name: Component[OpenTelemetry.Instrumentation.Cassandra]
code-cov-name: Instrumentation.Cassandra
run-tests: false
# Note: There is a unit test project for Cassandra but it only contains
# integration tests, which get skipped. This results in empty coverage
# files which messes with codecov. Enable tests if any real unit tests
# get added.

build-test-instrumentation-confluentkafka:
needs: detect-changes
Expand Down Expand Up @@ -517,6 +522,7 @@ jobs:
with:
project-name: OpenTelemetry.SemanticConventions
code-cov-name: SemanticConventions
run-tests: false # Note: No test project

build-test-contrib-shared-tests:
needs: detect-changes
Expand Down
Loading