Skip to content

Fix some code coverage issues#822

Open
skottmckay wants to merge 1 commit into
mainfrom
skottmckay/CodeCoverage
Open

Fix some code coverage issues#822
skottmckay wants to merge 1 commit into
mainfrom
skottmckay/CodeCoverage

Conversation

@skottmckay

Copy link
Copy Markdown
Collaborator

Fix issue with the script, and add coverage for FileLock.

Copilot AI review requested due to automatic review settings June 19, 2026 02:15
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Jun 19, 2026 2:15am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses C++ SDK code-coverage gaps. It corrects an incorrect progress-callback return value in the disabled download integration tests, adds a new Windows-focused unit test suite for the RAII FileLock utility, and fixes the OpenCppCoverage merge step in the coverage script so it no longer produces a misleading error and suppresses an expected benign warning.

Changes:

  • Fix the download test progress callbacks to return 0 (continue) instead of return true (which converts to 1 = cancel) per the flProgressCallback/std::function<int(float)> contract.
  • Add file_lock_test.cc with coverage for lock acquisition/release/re-acquire, parent-directory creation, contended timeout, and sequential re-lock (Windows-only by design), registered in the test CMake target.
  • Update run_coverage.ps1 to invoke the no-arg hostname.exe as the merge child process (avoiding cmd.exe /c exit 0 re-quoting issues) and filter the expected "No modules were selected" warning.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
sdk_v2/cpp/test/sdk_api/download_test.cc Corrects progress-callback return value to 0 (continue) and clarifies the contract in comments.
sdk_v2/cpp/test/internal_api/file_lock_test.cc New unit tests for FileLock covering acquire/release, parent-dir creation, timeout, and re-acquire (Windows-only).
sdk_v2/cpp/test/CMakeLists.txt Registers the new file_lock_test.cc in the foundry_local_tests target.
sdk_v2/cpp/run_coverage.ps1 Uses hostname.exe as the merge child process and filters the benign "No modules were selected" warning.

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