Skip to content

Commit

Permalink
Add elixir coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
albertored committed Aug 23, 2023
1 parent 9bbe0b5 commit aca18f2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,19 @@ jobs:
- name: Compile
run: rebar3 as test compile
- name: ExUnit
run: mix test --no-start test/otel_tests.exs test/otel_metric_tests.exs
run: mix test --no-start --cover test/otel_tests.exs test/otel_metric_tests.exs
- uses: codecov/codecov-action@v3
if: ${{ always() }}
with:
file: opentelemetry.covertool.xml
env_vars: OTP_VERSION,ELIXIR_VERSION
flags: sdk,elixir
- uses: codecov/codecov-action@v3
if: ${{ always() }}
with:
file: opentelemetry_api.covertool.xml
env_vars: OTP_VERSION,ELIXIR_VERSION
flags: api,elixir

api_tests:
runs-on: ${{ matrix.os }}
Expand Down
7 changes: 6 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ defmodule OtelElixirTests.MixProject do
app: :otel_elixir_tests,
version: "0.1.0",
deps: deps(),
elixirc_paths: elixirc_paths(Mix.env())
elixirc_paths: elixirc_paths(Mix.env()),
test_coverage: [tool: :covertool, include_apps: [:opentelemetry, :opentelemetry_api]]
]
end

def deps do
[
{:covertool,
git: "https://github.com/albertored/covertool.git",
branch: "add-include-apps-mix",
only: :test},
{:opentelemetry, path: "apps/opentelemetry", only: :test, override: true},
{:opentelemetry_api, path: "apps/opentelemetry_api", only: :test, override: true},
{:opentelemetry_semantic_conventions,
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

{cover_enabled, true}.
{cover_export_enabled, true}.
{covertool, [{coverdata_files, ["ct.coverdata"]}]}.
{covertool, [{coverdata_files, ["ct.coverdata", "eunit.coverdata"]}]}.
{cover_excl_apps, [opentelemetry_api_experimental, opentelemetry_experimental]}.
{cover_excl_mods, [opentelemetry_exporter_trace_service_pb, opentelemetry_trace_service,
opentelemetry_zipkin_pb, opentelemetry_exporter_metrics_service_pb,
Expand Down

0 comments on commit aca18f2

Please sign in to comment.