Ray's Knowledge Base
Unlock

Test a library against its downstream consumer in CI by patching the consumer's dependency pin to the commit under test

RecipeVerified 13 Oct 2026Holds anywhere
Recipe. When to use it, the steps, and what showed that they work.

When to use#

The library has no unit tests of its own, or a change can only be shown to work inside a downstream consumer. Example: cpp-logger's libc bypass under the dftracer GOTCHA preload. Also use it to catch ABI or header breaks before the consumer notices.

Steps#

  1. Put the logic in scripts under test/integration/. Run them by hand on a real host first, so the workflow only calls them.
  2. Use a separate workflow that is not a required check. Trigger it on PRs that touch src/, include/, cmake/ or CMakeLists.txt, plus manual runs. Add a cancel-in-progress concurrency group.
  3. Run it in the same base image as the release wheels (quay.io/pypa/manylinux_2_28_x86_64, glibc 2.28). Install git before the checkout steps so the checkout keeps its .git directory.
  4. Check out the consumer (dftracer develop) and this repo at ${{ github.sha }}.
  5. Patch the consumer's pin (dependency/manifest.txt and dependency/CMakeLists.txt) to a local file://<checkout> path. Stop the job if either patch does not apply. A local path works for fork PRs and needs no push.
  6. Build the consumer's dependencies, build it with tests on, and run ctest. Skip the test_py_* tests.
  7. Add a probe that fails on the specific bug. Example: log 20 lines through the library under the preload. Fail if the trace holds any logger fputs or fflush events, and also fail if the consumer did not trace the probe at all.
  8. In bash probe scripts, guard every grep -c or grep | wc count. grep exits 1 on no match, so under set -e with pipefail a zero count kills the script silently. Use || true.
  9. Run a negative control of the probe against the old library version. This was not done in this session.

Evidence#

"The commit comes from the local checkout, so it works for PRs from forks too and needs no push first." Run on lemur: 63 of 63 dftracer tests passed, and the probe printed log lines=20 traced fopen=1 fputs=0 fflush=0 then OK: logger output bypasses GOTCHA. The first probe version "exited silently when a count was 0, because grep returns 1 on no match and pipefail made that fatal." The job takes about 10 minutes, and a break in consumer develop can fail it. It had not run on GitHub when this was written.