Description
This is part of open-telemetry/sig-contributor-experience#31
The goal is to clarify Run/build prerequisites, testing and address common build issues to make it easier for first-time contributors to get started with opentelemetry-erlang.
I'd like to verify these info before adding to the proposed PR for fixing:
Local Run/Build
Setting Up and Running the Project Locally
To run the project locally, follow these steps:
Start required services:
docker compose up -d
Set up Erlang/OTP and Rebar3 and Verify setup (Ensure you have the correct versions as specified in the prerequisites):
Run the compilation step to check for errors:
rebar3 compile
Testing
To execute tests, use the following commands:
Unit Tests (EUnit):
rebar3 eunit
Integration and Functional Tests (Common Test):
rebar3 ct
Test results and logs can be viewed in a browser by opening:
build/test/logs/index.html
Elixir Tests
Elixir tests are run in two places:
- Inside apps/opentelemetry_api/:
mix test
- At the top level:
mix test --no-start test/otel_tests.exs test/otel_metric_tests.exs
Troubleshooting Guide
Debugging Common Failures
-
Test Failures: Check the test logs in _build/test/logs/.
-
Compilation Issues: Ensure correct OTP and Rebar3 versions are installed.
-
Dialyzer Warnings: Ensure rebar3 compile completes successfully.
Developer Setup and Language Servers
For improved development experience, consider using the following Language Server Protocols (LSPs):
-
Erlang LSP: Erlang Language Platform
-
Installing it removes the need for an additional type-checking step:
elp eqwalize-all
-
Install from: Erlang Language Platform Releases
-
Elixir LSP: Elixir LS
Feedback are welcome to ensure all info here are correct
Ongoing PR: #825
CC: @tsloughter