Skip to content

Friendlier loadTestConfig() error, point to example.json, gtest behind vcpkg feature - #118

Merged
TuxedoFish merged 1 commit into
mainfrom
fix/loadtestconfig-error-and-gtest-feature
Sep 7, 2026
Merged

Friendlier loadTestConfig() error, point to example.json, gtest behind vcpkg feature#118
TuxedoFish merged 1 commit into
mainfrom
fix/loadtestconfig-error-and-gtest-feature

Conversation

@TuxedoFish

Copy link
Copy Markdown
Owner

Summary

Closes out the two remaining items from #113 that weren't fully addressed in #115/#116: the loadTestConfig() error message itself, and the packaging note about gtest.

  • Friendlier loadTestConfig() error message - v0.1.0 review: correctness issues and onboarding gaps #113 specifically called this out as "the single biggest barrier to picking the project up": the exception thrown when examples/test.json is missing was a bare Could not open config file: <path> with zero guidance. It now explains the file is gitignored/not shipped, points at the existing examples/example.json template, and links the docs.
  • Point the docs at examples/example.json - this template file already existed in the repo but neither the README nor docs/examples.md referenced it; both now point at it as the thing to copy.
  • gtest behind an opt-in vcpkg feature - previously an unconditional vcpkg.json dependency, so every downstream consumer built it even with HYPERLIQUID_BUILD_TESTS=OFF. Moved into a "tests" manifest feature, only requested when HYPERLIQUID_BUILD_TESTS=ON. This requires HYPERLIQUID_BUILD_TESTS's option() to be declared before project() in CMakeLists.txt, since VCPKG_MANIFEST_FEATURES has to be set before the toolchain's manifest-install step runs (which happens as part of project()) - the duplicate later declaration was removed.

Test plan

  • -DHYPERLIQUID_BUILD_TESTS=OFF: confirmed via find build/vcpkg_installed -iname "*gtest*" that gtest is never installed.
  • -DHYPERLIQUID_BUILD_TESTS=ON (both manually and via cmake --preset default): confirmed gtest is installed, and ctest reports 28/28 passing.
  • Clean build with -DHYPERLIQUID_WARNINGS_AS_ERRORS=ON in both configurations - no warnings/errors.
  • Actually reproduced the old failure mode (removed examples/test.json, ran rest_orders) and confirmed the new message prints as intended before the process aborts.
  • mkdocs build --strict still passes clean after the docs/examples.md edit.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Le73N2EZjGLsCqmCScAse

…d vcpkg feature

- examples/test_config.h: loadTestConfig() threw a bare "Could not
  open config file" with no guidance when examples/test.json is
  missing - the single biggest first-run barrier per issue #113. Now
  explains it's gitignored/not shipped, points at examples/example.json
  as the template, and links the docs.
- README/docs/examples.md: point the test.json section at the existing
  examples/example.json template instead of only showing a fresh JSON
  block.
- vcpkg.json/CMakeLists.txt: move gtest behind an opt-in "tests"
  manifest feature instead of an unconditional dependency, so
  HYPERLIQUID_BUILD_TESTS=OFF consumers (the default) never install or
  build it. Requires HYPERLIQUID_BUILD_TESTS's option() to be declared
  before project() so VCPKG_MANIFEST_FEATURES is set before the
  toolchain's manifest-install step runs.

Verified: HYPERLIQUID_BUILD_TESTS=OFF never installs gtest;
HYPERLIQUID_BUILD_TESTS=ON (both manually and via the "default" preset)
installs it and all 28 tests pass; loadTestConfig()'s new message
confirmed by actually running an example with test.json removed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Le73N2EZjGLsCqmCScAse
@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.53%. Comparing base (678c335) to head (e7dba4b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #118   +/-   ##
=======================================
  Coverage   69.53%   69.53%           
=======================================
  Files          53       53           
  Lines        8219     8219           
  Branches      513      513           
=======================================
  Hits         5715     5715           
  Misses       2501     2501           
  Partials        3        3           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot added the ready for review CI passed; ready to be reviewed label Sep 7, 2026
@TuxedoFish
TuxedoFish merged commit ff69900 into main Sep 7, 2026
12 checks passed
@TuxedoFish
TuxedoFish deleted the fix/loadtestconfig-error-and-gtest-feature branch September 7, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review CI passed; ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant