Skip to content

[projmgr] make Info message under verbose and update affected unit tests#2406

Merged
brondani merged 8 commits intoOpen-CMSIS-Pack:mainfrom
jthuangarm:clean-pr
Mar 20, 2026
Merged

[projmgr] make Info message under verbose and update affected unit tests#2406
brondani merged 8 commits intoOpen-CMSIS-Pack:mainfrom
jthuangarm:clean-pr

Conversation

@jthuangarm
Copy link
Copy Markdown
Contributor

@jthuangarm jthuangarm commented Mar 19, 2026

To address #1767 .

  • Info messages are only visible when --verbose is enabled.
  • The unit test of this fix is under ProjMgrUnitTests.Validate_Logger.
  • quiet and verbose are mutually exclusive.

Update unit tests:

  • Totally 15 unit tests are affected.
  • Adding '--verbose' can resolve most failures.
  • Especially for tests related to ref/*.cbuild-idx.yml files, modification is required in those files as more info messages are generated after enabling --verbose.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 changes projmgr logging behavior so Info messages are only emitted to stdout when --verbose is enabled, and updates unit tests / reference outputs accordingly.

Changes:

  • Add a global verbose flag to ProjMgrLogger and gate Info() console output behind IsVerbose().
  • Propagate CLI --verbose state into ProjMgrLogger during command-line parsing.
  • Update affected unit tests and layer index reference YAMLs to include/expect info output only under verbose.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/projmgr/src/ProjMgrLogger.cpp Gate Info() printing behind verbose mode; add m_verbose definition.
tools/projmgr/include/ProjMgrLogger.h Expose IsVerbose() and new m_verbose flag.
tools/projmgr/src/ProjMgr.cpp Propagate parsed --verbose into ProjMgrLogger::m_verbose.
tools/projmgr/test/src/ProjMgrUnitTests.cpp Update logger/CLI tests to reflect info output requiring verbose.
tools/projmgr/test/src/ProjMgrWorkerUnitTests.cpp Ensure verbose is enabled where info output is asserted and reset afterward.
tools/projmgr/test/src/ProjMgrGeneratorUnitTests.cpp Add --verbose to runs that rely on info output.
tools/projmgr/test/data/TestLayers/ref/select.cbuild-idx.yml Update reference cbuild-idx to include generated info messages.
tools/projmgr/test/data/TestLayers/ref/no_compiler.cbuild-idx.yml Update reference cbuild-idx to include generated info messages.
tools/projmgr/test/data/TestLayers/ref/config.cbuild-idx.yml Update reference cbuild-idx to include generated info messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 19, 2026

Test Results

    3 files     21 suites   17m 15s ⏱️
  454 tests   454 ✅ 0 💤 0 ❌
1 362 runs  1 362 ✅ 0 💤 0 ❌

Results for commit 8023798.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates projmgr/csolution logging so that info messages are only printed when --verbose is enabled, and adjusts unit tests / reference outputs accordingly.

Changes:

  • Introduce a ProjMgrLogger verbose flag and gate Info() console output on it.
  • Wire CLI --verbose parsing to ProjMgrLogger so runtime behavior matches the new logging policy.
  • Update unit tests and reference .cbuild-idx.yml fixtures to account for the changed info visibility/output.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/projmgr/src/ProjMgrLogger.cpp Adds m_verbose and prints info only when --verbose is enabled.
tools/projmgr/include/ProjMgrLogger.h Declares m_verbose and IsVerbose() accessor.
tools/projmgr/src/ProjMgr.cpp Propagates CLI --verbose state into ProjMgrLogger::m_verbose.
tools/projmgr/test/src/ProjMgrWorkerUnitTests.cpp Enables m_verbose for a test that asserts info output, then resets it.
tools/projmgr/test/src/ProjMgrUnitTests.cpp Refactors logger validation expectations and adds --verbose to tests that require info output.
tools/projmgr/test/src/ProjMgrGeneratorUnitTests.cpp Adds --verbose to generator dry-run tests to keep expected stdout behavior consistent.
tools/projmgr/test/data/TestLayers/ref/select.cbuild-idx.yml Updates reference output to include stored info messages in generated idx content.
tools/projmgr/test/data/TestLayers/ref/no_compiler.cbuild-idx.yml Updates reference output to include stored info messages in generated idx content.
tools/projmgr/test/data/TestLayers/ref/config.cbuild-idx.yml Updates reference output to include stored info messages in generated idx content.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jthuangarm and others added 2 commits March 20, 2026 09:37
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jthuangarm jthuangarm marked this pull request as ready for review March 20, 2026 09:28
@jthuangarm jthuangarm requested a review from brondani March 20, 2026 09:32
Copy link
Copy Markdown
Collaborator

@brondani brondani left a comment

Choose a reason for hiding this comment

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

LGTM

@brondani brondani merged commit f6dcac3 into Open-CMSIS-Pack:main Mar 20, 2026
33 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.70%. Comparing base (5e83c84) to head (8023798).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2406   +/-   ##
=======================================
  Coverage   64.69%   64.70%           
=======================================
  Files         145      145           
  Lines       26122    26127    +5     
  Branches    15765    15767    +2     
=======================================
+ Hits        16900    16905    +5     
  Misses       7068     7068           
  Partials     2154     2154           
Flag Coverage Δ
projmgr-cov 87.72% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tools/projmgr/include/ProjMgrLogger.h 100.00% <100.00%> (ø)
tools/projmgr/src/ProjMgr.cpp 80.85% <100.00%> (+0.09%) ⬆️
tools/projmgr/src/ProjMgrLogger.cpp 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants