Skip to content

tests: internal: Disable cumulative delta case on Windows because of unistd.h#11588

Closed
cosmo0920 wants to merge 1 commit intomasterfrom
cosmo0920-disable-cumulative-delta-internal-test-case
Closed

tests: internal: Disable cumulative delta case on Windows because of unistd.h#11588
cosmo0920 wants to merge 1 commit intomasterfrom
cosmo0920-disable-cumulative-delta-internal-test-case

Conversation

@cosmo0920
Copy link
Copy Markdown
Contributor

@cosmo0920 cosmo0920 commented Mar 19, 2026

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:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

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

  • Tests
    • Restricts certain unit tests and related integration wiring to non-Windows platforms, ensuring platform-specific test compilation and plugin integration occur only where supported.

@cosmo0920 cosmo0920 requested a review from edsiper as a code owner March 19, 2026 15:51
@cosmo0920 cosmo0920 changed the title tests: internal: Disable cumulative delta case because of unistd.h tests: internal: Disable cumulative delta case on Windows because of unistd.h Mar 19, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a0362bc2-ba5c-4189-a4f5-39a733b7a699

📥 Commits

Reviewing files that changed from the base of the PR and between d1009ea and 91eb773.

📒 Files selected for processing (1)
  • tests/internal/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/internal/CMakeLists.txt

📝 Walkthrough

Walkthrough

The CMake build for tests (tests/internal/CMakeLists.txt) was changed so cumulative_to_delta.c and the cumulative-to-delta plugin/core integration are only included when FLB_METRICS and FLB_PROCESSOR_CUMULATIVE_TO_DELTA are enabled and the platform is not Windows (NOT WIN32).

Changes

Cohort / File(s) Summary
Build Configuration
tests/internal/CMakeLists.txt
Guard inclusion of cumulative_to_delta.c and the flb-it-cumulative_to_delta plugin/core wiring with NOT WIN32 in addition to existing FLB_METRICS and FLB_PROCESSOR_CUMULATIVE_TO_DELTA checks; removes Windows participation in those builds.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • edsiper
  • niedbalski
  • patrick-stephens

Poem

🐰 I hopped through CMake, light and spry,
I tucked a Windows check close by,
Metrics run where they should play,
Windows waits another day,
Hooray for builds that now comply!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: disabling the cumulative delta test case on Windows due to unistd.h unavailability.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cosmo0920-disable-cumulative-delta-internal-test-case
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cosmo0920 cosmo0920 added this to the Fluent Bit v5.0 milestone Mar 19, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +123 to +127
if (NOT WIN32)
set(UNIT_TESTS_FILES
${UNIT_TESTS_FILES}
cumulative_to_delta.c
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between d257e00 and d1009ea.

📒 Files selected for processing (1)
  • tests/internal/CMakeLists.txt

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@cosmo0920 cosmo0920 force-pushed the cosmo0920-disable-cumulative-delta-internal-test-case branch from d1009ea to 91eb773 Compare March 19, 2026 15:55
@mabrarov
Copy link
Copy Markdown
Contributor

Hi @cosmo0920,

Here is another solution (because CMetrics supports Windows) of the same issue: #11589.

Thank you.

@cosmo0920
Copy link
Copy Markdown
Contributor Author

cosmo0920 commented Mar 20, 2026

This PR is superseded by #11589.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants