Fix some code coverage issues#822
Open
skottmckay wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
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 ofreturn true(which converts to1= cancel) per theflProgressCallback/std::function<int(float)>contract. - Add
file_lock_test.ccwith 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.ps1to invoke the no-arghostname.exeas the merge child process (avoidingcmd.exe /c exit 0re-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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix issue with the script, and add coverage for FileLock.