Fix minimal_test: wire up str_replace from util.h instead of stdlib#22
Draft
Fix minimal_test: wire up str_replace from util.h instead of stdlib#22
Conversation
- Add `-not -empty` to `find` in the lcov→Cobertura conversion step so that zero-byte coverage.dat files (produced by targets like minimal_test that have no project source files) are not converted; lcov_cobertura would otherwise emit `<packages/>` (empty), causing irongut/CodeCoverageSummary to fail with "No package data found". - Add a "Check for Cobertura XML files" step (id: check_cobertura) that sets `found=true/false` output so downstream steps can skip cleanly instead of failing when no XML was produced. - Gate "Code Coverage Report", "Post coverage report as comment", and "Add coverage report to job summary" on `steps.check_cobertura.outputs.found == 'true'` so they are skipped (not failed) when there is nothing to summarise. Co-authored-by: ivucica <477596+ivucica@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Install lcov_cobertura version 2.0.2
ci: skip empty LCOV files to prevent CodeCoverageSummary parse failure
Mar 19, 2026
When all coverage.dat files are empty (e.g. minimal_test has no project sources and produces a 0-byte coverage.dat), the -not -empty filter means no coverage.dat.xml files are produced. The upload step would otherwise implicitly rely on the default if-no-files-found behaviour; make the intent explicit with if-no-files-found: warn. Co-authored-by: ivucica <477596+ivucica@users.noreply.github.com>
Copilot
AI
changed the title
ci: skip empty LCOV files to prevent CodeCoverageSummary parse failure
ci: fix CodeCoverageSummary failure for tests with no instrumented sources
Mar 19, 2026
minimal_test.cpp was using stdlib haystack.replace() instead of the project's str_replace() from util.h. As a result it never needed :util as a dep; the BUILD comment "This test intentionally links nothing except gtest" described this incorrect state. Consequences: - The test never exercised any project code - bazel coverage produced an empty coverage.dat (no workspace sources were instrumented), causing irongut/CodeCoverageSummary to fail with "No package data found" Changes: - minimal_test.cpp: add #include "util.h", WinMain shim (same as util_test.cpp), and update StrReplaceTest to call str_replace() - BUILD: add :util dep and same linkopts as util_test; remove the misleading "intentionally links nothing" comment - ci-bazel-testreports.yml: update comments that cited minimal_test as an example of a target with no project sources (now hypothetical) Co-authored-by: ivucica <477596+ivucica@users.noreply.github.com>
Copilot
AI
changed the title
ci: fix CodeCoverageSummary failure for tests with no instrumented sources
Fix minimal_test: wire up str_replace from util.h instead of stdlib
Mar 19, 2026
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.
minimal_testwas calling stdlibstd::string::replaceinstead of the project'sstr_replace(), so it never needed:util— producing a 0-bytecoverage.datand breakingirongut/CodeCoverageSummary("No package data found"). The BUILD comment# This test intentionally links nothing except gtestdescribed this wrong state.minimal_test.cpphaystack.replace(…)withstr_replace()fromutil.h#include "util.h"and theWinMainshim (already present inutil_test.cppfor the same reason::util→ SDL →SUBSYSTEM:WINDOWSon Windows)BUILD:utildep and the samelinkoptsblock asutil_test# This test intentionally links nothing except gtestcommentci-bazel-testreports.ymlminimal_testas the example of a no-project-sources target (now phrased hypothetically, sinceminimal_testnow instrumentsutil.cpp)💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.