Skip to content

Comments

Fix unnecessary recompilation in gtest Makefile#3063

Merged
madolson merged 1 commit intovalkey-io:feature-gtestfrom
harrylin98:gtest-PR
Jan 15, 2026
Merged

Fix unnecessary recompilation in gtest Makefile#3063
madolson merged 1 commit intovalkey-io:feature-gtestfrom
harrylin98:gtest-PR

Conversation

@harrylin98
Copy link
Contributor

@harrylin98 harrylin98 commented Jan 14, 2026

This PR fixes the issue where changes to src files did not trigger a rebuild of
libvalkey.a when rerunning make test-gtest.

It also resolves the problem where unchanged .cpp test files were unnecessarily recompiled
during make test-gtest.

Now:

If nothing changed:

  • Nothing rebuilds, no relinking occurs.

If only C++ test files changed:

  • Both libvalkey.a and C++ test files recompile (because release.o changes)
  • Test executable relinks

If only src code changed:

  • Only libvalkey.a rebuilds
  • C++ test files do not recompile
  • Test executable relinks

If both changed:

  • Both libvalkey.a and C++ test files rebuild
  • Test executable relinks

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.19%. Comparing base (81bd5bd) to head (cbc5dbc).
⚠️ Report is 1 commits behind head on feature-gtest.

Additional details and impacted files
@@                Coverage Diff                @@
##           feature-gtest    #3063      +/-   ##
=================================================
- Coverage          74.33%   74.19%   -0.14%     
=================================================
  Files                129      129              
  Lines              70974    70974              
=================================================
- Hits               52756    52658      -98     
- Misses             18218    18316      +98     

see 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Harry Lin <harrylhl@amazon.com>
Copy link
Member

@JimB123 JimB123 left a comment

Choose a reason for hiding this comment

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

Looks ok. Not sure about some of the makefile intricacies, but given that this is for test build, risk is low. Further refinements are easy to make.

I expect additional changes/refinements as this is being prepared in the "feature-gtest" branch.

Copy link
Member

@madolson madolson left a comment

Choose a reason for hiding this comment

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

Sure

@madolson madolson merged commit f766e99 into valkey-io:feature-gtest Jan 15, 2026
24 checks passed
harrylin98 added a commit to harrylin98/valkey_forked that referenced this pull request Feb 19, 2026
This PR fixes the issue where changes to src files did not trigger a
rebuild of
libvalkey.a when rerunning `make test-gtest`.

It also resolves the problem where unchanged .cpp test files were
unnecessarily recompiled
during make test-gtest.

Now:

If nothing changed:
- Nothing rebuilds, no relinking occurs.

If only C++ test files changed:
- Both libvalkey.a and C++ test files recompile (because release.o
changes)
- Test executable relinks

If only src code changed:
- Only libvalkey.a rebuilds
- C++ test files do not recompile
- Test executable relinks

If both changed:
- Both libvalkey.a and C++ test files rebuild
- Test executable relinks

Signed-off-by: Harry Lin <harrylhl@amazon.com>
Co-authored-by: Harry Lin <harrylhl@amazon.com>
Signed-off-by: Harry Lin <49881386+harrylin98@users.noreply.github.com>
harrylin98 added a commit to harrylin98/valkey_forked that referenced this pull request Feb 20, 2026
This PR fixes the issue where changes to src files did not trigger a
rebuild of
libvalkey.a when rerunning `make test-gtest`.

It also resolves the problem where unchanged .cpp test files were
unnecessarily recompiled
during make test-gtest.

Now:

If nothing changed:
- Nothing rebuilds, no relinking occurs.

If only C++ test files changed:
- Both libvalkey.a and C++ test files recompile (because release.o
changes)
- Test executable relinks

If only src code changed:
- Only libvalkey.a rebuilds
- C++ test files do not recompile
- Test executable relinks

If both changed:
- Both libvalkey.a and C++ test files rebuild
- Test executable relinks

Signed-off-by: Harry Lin <harrylhl@amazon.com>
Co-authored-by: Harry Lin <harrylhl@amazon.com>
Signed-off-by: Harry Lin <49881386+harrylin98@users.noreply.github.com>
harrylin98 added a commit to harrylin98/valkey_forked that referenced this pull request Feb 20, 2026
This PR fixes the issue where changes to src files did not trigger a
rebuild of
libvalkey.a when rerunning `make test-gtest`.

It also resolves the problem where unchanged .cpp test files were
unnecessarily recompiled
during make test-gtest.

Now:

If nothing changed:
- Nothing rebuilds, no relinking occurs.

If only C++ test files changed:
- Both libvalkey.a and C++ test files recompile (because release.o
changes)
- Test executable relinks

If only src code changed:
- Only libvalkey.a rebuilds
- C++ test files do not recompile
- Test executable relinks

If both changed:
- Both libvalkey.a and C++ test files rebuild
- Test executable relinks

Signed-off-by: Harry Lin <harrylhl@amazon.com>
Co-authored-by: Harry Lin <harrylhl@amazon.com>
Signed-off-by: Harry Lin <49881386+harrylin98@users.noreply.github.com>
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.

4 participants