Skip to content

ci(xbox): publish coverage from xemu guest tests - #388

Merged
ReenigneArcher merged 9 commits into
masterfrom
codex/xbox-xemu-coverage
Nov 28, 2026
Merged

ReenigneArcher merged 9 commits into
masterfrom
codex/xbox-xemu-coverage

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Description

Build an instrumented nxdk test ISO using the same GoogleTest entry point as the desktop suite. The Xbox target adds platform tests and streams colored GoogleTest output directly through xemu, including [ RUN ] as each test starts. It exports test results and gcov counters on COM2, pairs the counters with the matching build’s notes, and verifies execution in both Xbox timing adapters.

The Linux, Windows, and macOS Xbox jobs set up the latest xemu release before building the ISO. Each desktop and Xbox job produces its own JUnit and LCOV artifacts. A dedicated coverage workflow downloads those artifacts and publishes both reports to Codecov with per-platform flags.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Testing

  • Built SunshineTests.iso in UCRT64 and verified all 529 tests pass in local xemu. The console emits ANSI color for each [ RUN ] line. The new test covers the last representable Xbox Unix second and the compiler emits no out-of-range comparison warning.
  • Ran all 561 desktop tests with CTest. The strict api documentation build, C/C++ formatting, and workflow and CMake lint checks passed locally.
  • The hosted CI run passed. The Linux, macOS, and Windows reports each contain 529 passing tests and 37 executed lines in the Xbox timing adapters.
  • All nine coverage workflow jobs downloaded their artifacts and uploaded coverage and test results to Codecov. Codecov project and patch checks, SonarCloud, and common lint passed.

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Tests have been added or updated for new or modified functionality, including regression tests for bug fixes

AI Usage

See our AI usage policy.

  • AI tools were used while preparing this PR

Comment thread scripts/run-xbox-coverage.py Fixed
@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.73%. Comparing base (bd161df) to head (7e64f0f).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #388      +/-   ##
==========================================
- Coverage   90.95%   88.73%   -2.23%     
==========================================
  Files          81       83       +2     
  Lines        9532     9451      -81     
  Branches     4012     4062      +50     
==========================================
- Hits         8670     8386     -284     
- Misses        751      957     +206     
+ Partials      111      108       -3     
Flag Coverage Δ
Linux-aarch64 75.04% <100.00%> (-1.01%) ⬇️
Linux-x86_64 75.16% <100.00%> (+0.01%) ⬆️
Windows-AMD64 77.04% <100.00%> (+0.02%) ⬆️
Windows-ARM64 76.94% <100.00%> (+0.02%) ⬆️
Xbox-guest-xemu-Linux 71.95% <94.11%> (?)
Xbox-guest-xemu-Windows 71.95% <94.11%> (?)
Xbox-guest-xemu-macOS 71.95% <94.11%> (?)
Xbox-host-Linux ?
Xbox-host-Windows ?
Xbox-host-macOS ?
macOS-arm64 64.78% <100.00%> (+0.02%) ⬆️
macOS-x86_64 64.93% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/_nxdk_compat/include/sunshine_time.h 100.00% <100.00%> (ø)
src/network/host_pairing.cpp 77.51% <100.00%> (-1.85%) ⬇️
src/platform/filesystem_utils.cpp 94.66% <100.00%> (+4.37%) ⬆️
src/ui/shell_layout.cpp 100.00% <100.00%> (ø)

... and 41 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd161df...7e64f0f. Read the comment docs.

@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

@ReenigneArcher ReenigneArcher left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Does this run the regular tests in xemu or only the time_test.cpp?

Comment thread .github/workflows/ci-xbox-original.yml Resolved
Comment thread .github/workflows/ci-xbox-original.yml Resolved
Comment thread .github/workflows/ci-xbox-original.yml Resolved
Comment thread .github/workflows/ci-xbox-original.yml Resolved

@ReenigneArcher ReenigneArcher left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is it possible to have colored output from xemu to stdout, specifically for the gtest suite?

In file included from /home/runner/work/Sunshine-client/Sunshine-client/src/app/screenshot_library.cpp:21:
/home/runner/work/Sunshine-client/Sunshine-client/src/_nxdk_compat/include/sunshine_time.h:29:34: warning: result of comparison of constant 910692730085 with expression of type 'std::time_t' (aka 'long') is always false [-Wtautological-constant-out-of-range-compare]
29 | if (timestamp < 0 || timestamp > std::numeric_limitsstd::int64_t::max() / ticksPerSecond - epochOffset) {
| ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Should this be fixed?

Comment thread .github/workflows/ci-xbox-original.yml Resolved
Comment thread .github/workflows/ci-xbox-original.yml Resolved
Comment thread tests/main.cpp Resolved
Comment thread .github/workflows/ci-xbox-original.yml Resolved
Comment thread .github/workflows/ci-flatpak.yml Fixed
Comment thread .github/workflows/ci-macos.yml Fixed
Comment thread .github/workflows/ci-xbox-original.yml Resolved
Comment thread .github/workflows/ci-xbox-original.yml Resolved
@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher merged commit 840f674 into master Nov 28, 2026
38 checks passed
@ReenigneArcher
ReenigneArcher deleted the codex/xbox-xemu-coverage branch November 28, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants