Skip to content
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
65 changes: 60 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -466,17 +466,19 @@ jobs:

# ============================================================================
# Code Coverage (Linux only)
# Runs a debug build through gcov/lcov and generates an inline action summary
# alongside an HTML report of unit test coverage.
# Runs a debug build through gcov and generates an inline action summary
# alongside an HTML report. Unit and integration tests both execute against
# that build so their .gcda data is included in the same report.
# ============================================================================
coverage:
name: Code Coverage
if: inputs.run_coverage
runs-on: ubuntu-latest
# A debug build instrumented with --coverage is far heavier (RAM + disk)
# than the release builds. Cap the wall-clock so a stuck/OOM build fails
# fast and visibly instead of hanging toward the 6h default.
timeout-minutes: 45
# fast and visibly instead of hanging toward the 6h default. The extra
# time beyond the build covers the integration server and test run.
timeout-minutes: 60

steps:
- name: Checkout (with submodules)
Expand Down Expand Up @@ -583,13 +585,64 @@ jobs:
- name: Build
run: cmake --build build-debug --parallel 2

# ---------- Run unit tests ----------
# ---------- Run unit and integration tests ----------
# Both binaries write .gcda for the instrumented liblivekit, so running
# them in sequence produces one combined coverage report.
- name: Run unit tests
timeout-minutes: 5
run: |
build-debug/bin/livekit_unit_tests \
--gtest_output=xml:build-debug/unit-test-results.xml

- name: Start livekit-server
if: inputs.integration_repeat > 0
id: livekit_server
uses: livekit/dev-server-action@5d4d5337a875e2d1afd37bed03c601d159dab002 # v1.1.1
with:
github-token: ${{ github.token }}
version: v1.13.3
config: |
enable_participant_data_blob: true

- name: Install livekit-cli
if: inputs.integration_repeat > 0
run: |
set -euxo pipefail
curl -sSL https://get.livekit.io/cli | bash
lk --version

- name: Start token server
if: inputs.integration_repeat > 0
id: token_server
uses: livekit/token-server-action@a1e42c649a1998d5b224f5102f252c07762024f0 # v0.0.1
with:
livekit-url: ws://localhost:7880
api-key: devkey
api-secret: secret

- name: Run integration tests
if: inputs.integration_repeat > 0
timeout-minutes: ${{ inputs.integration_timeout_minutes }}
Comment thread
alan-george-lk marked this conversation as resolved.
env:
RUST_LOG: "metrics=debug"
LIVEKIT_CREATE_TOKEN_URL: ${{ steps.token_server.outputs.token-url }}
run: |
set -euo pipefail
source scripts/set-test-tokens.sh
# TODO(BOT-477) Temporarily disable platform audio integration tests in CI until instability is resolved

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should this be

# TODO(BOT-477) enable platform audio integration tests in CI when stable

?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The comment is old, just showing up because of the changes, it meant disable platform audio tests via the GTest arg below until it works, which there is a fix in rust-sdks for (waiting on user-contributor to resolve devin flags)

bash scripts/run-with-backtrace.sh \
build-debug/bin/livekit_integration_tests \
--gtest_filter='-PlatformAudioIntegrationTest.*' \
--gtest_output=xml:build-debug/integration-test-results.xml
Comment thread
alan-george-lk marked this conversation as resolved.

- name: Dump livekit-server log on failure
if: failure() && steps.livekit_server.outputs.log-path != ''
run: tail -n 500 "${{ steps.livekit_server.outputs.log-path }}" || true

- name: Dump token server log on failure
if: failure() && steps.token_server.outputs.log-path != ''
run: tail -n 200 "${{ steps.token_server.outputs.log-path }}" || true

# Make resource-exhaustion failures visible instead of silent. Runs only
# if an earlier step failed (e.g. OOM during Build).
- name: Diagnostics on failure
Expand All @@ -602,6 +655,7 @@ jobs:

# ---------- Generate coverage reports ----------
- name: Generate coverage reports
if: (success() || failure()) && hashFiles('build-debug/**/*.gcda') != ''
run: |
mkdir -p coverage-html
gcovr build-debug \
Expand All @@ -619,6 +673,7 @@ jobs:
--txt coverage-summary.txt

- name: Add coverage summary to job
if: (success() || failure()) && hashFiles('coverage-summary.txt') != ''
run: |
{
echo '## Code Coverage Summary'
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ cmake_install.cmake
out
build.log
build/
build-debug/
build-release/
build-*/
local-install/
release/
vcpkg_installed/
Expand Down
Loading