Skip to content

test: characterize the obs-service getters before the Rust port (#1899) - #1901

Merged
zackees merged 3 commits into
masterfrom
test/1899-service-getters
Oct 23, 2026
Merged

zackees merged 3 commits into
masterfrom
test/1899-service-getters

Conversation

@zackees

@zackees zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member

Refs #1899 (#1846 unit 8, slice 1).

This is the characterization that lands before the port (testing-policy.md, "Characterization tests for units without C tests"). There is no Rust here. test/cmocka/test_service_getters.c pins the current C behavior of the nine service capability and connect-info getters through the public API only. That way the same test runs on libobs, the hybrid libobs and libobs-c-reference, and it will see the later swap.

The test registers two service types. "full" has every optional callback and "bare" has only the required ones. Each case checks that the getter forwards the service's own data pointer, and checks the value returned with and without a callback and with a NULL service. Two cases are characterized, not endorsed:

  • obs_service_get_max_bitrate zeroes both out-parameters before it validates the service, so a NULL service still writes them. get_max_fps validates first.
  • The codec-list getters don't check for a NULL service, so the test doesn't call them with one.

It is registered in build/test-graph.json with the optional xvfb prefix, like the other obs_startup tests. The obs-build graph contract's core count goes from 141 to 142, and native_test_graph_replaces_legacy_utility_definitions passes. ./lint passes, including clang-format on the new file.

Not run locally: the Tier 2 Docker lane couldn't configure in my clone, because the clone borrows git objects from a path that isn't mounted in Docker. PR CI's Tier 2 is the evidence.

@zackees

zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

The first CI run passed, but in 0.03 s (test_context_names takes 1.39 s), so every case probably skipped: each case restarted libobs under xvfb-run -a without -noreset. Fixed in 6aba7fc. libobs now starts once for the whole group. A failed obs_startup with DISPLAY or WAYLAND_DISPLAY set now fails the test instead of skipping it. The xvfb prefix adds -noreset, matching the other startup tests. I'll queue this only after a Tier 2 run with a realistic duration.

@zackees

zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Evidence that the cases ran: rust/tools/linux-validate/validate.sh runs all of ctest under xvfb-run, so DISPLAY is set. Since 6aba7fc, a failed obs_startup with a display set fails the test instead of skipping it. Run 39909702163 (tests ON) passed test_service_getters, so libobs started and all 8 cases ran. 0.03 s fits one libobs startup (test_context_names: 15 startups in 1.19 s).

@zackees
zackees added this pull request to the merge queue Oct 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 23, 2026
@zackees
zackees force-pushed the test/1899-service-getters branch from 6aba7fc to 284223b Compare October 23, 2026 06:56
@zackees

zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Rebased. #1875 merged its own core test and also set the obs-build graph count to 142, so the merge result needs 143. 284223b sets 143, and native_test_graph_replaces_legacy_utility_definitions passes locally. #1904's Fast Gate caught this (run 39912871864: left 143, right 142).

@zackees

zackees commented Oct 23, 2026 •

Copy link
Copy Markdown
Member Author

Coordinator: the 06:33 merge group failed in native_test_graph_replaces_legacy_utility_definitions (left 143, right 142). @zackees had already fixed it in 284223b, which sets the count to 143, and the test passes locally on master. I pushed nothing. Auto-merge is now on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant