tests: internal: Disable cumulative delta case on Windows because of unistd.h#11588
tests: internal: Disable cumulative delta case on Windows because of unistd.h#11588
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe CMake build for tests ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1009ead47
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (NOT WIN32) | ||
| set(UNIT_TESTS_FILES | ||
| ${UNIT_TESTS_FILES} | ||
| cumulative_to_delta.c | ||
| ) |
There was a problem hiding this comment.
Guard the flb-it-cumulative_to_delta setup when skipping it
On Windows with FLB_METRICS=ON and the default FLB_PROCESSOR_CUMULATIVE_TO_DELTA=ON, this removes cumulative_to_delta.c from UNIT_TESTS_FILES, so prepare_unit_tests() never creates flb-it-cumulative_to_delta (tests/internal/CMakeLists.txt:222-263). The unconditional block at lines 265-274 still calls target_sources()/target_include_directories() for that target, and cmake --help-command target_sources requires the target to have been created by add_executable()/add_library(). In a minimal repro, CMake errors with Cannot specify sources for target ... which is not built by this project., so Windows internal-test configurations now fail at configure time instead of just skipping this test.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/internal/CMakeLists.txt`:
- Around line 122-128: The CMake configuration unconditionally references the
target flb-it-cumulative_to_delta when FLB_METRICS AND
FLB_PROCESSOR_CUMULATIVE_TO_DELTA, but that target is only added on non-Windows
platforms; wrap the block that configures/links/sets properties for
flb-it-cumulative_to_delta with the same NOT WIN32 guard used when adding
cumulative_to_delta.c so the target is only referenced when it exists (i.e.,
place the existing conditional around the configuration code that runs under the
FLB_METRICS AND FLB_PROCESSOR_CUMULATIVE_TO_DELTA check).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 66dacaeb-b7c4-48a9-84c6-66bbde92c877
📒 Files selected for processing (1)
tests/internal/CMakeLists.txt
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
d1009ea to
91eb773
Compare
|
Hi @cosmo0920, Here is another solution (because CMetrics supports Windows) of the same issue: #11589. Thank you. |
|
|
Windows does not have unistd.h.
Enter
[N/A]in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-testlabel to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit