Skip to content

fix(deepdoc): add cgo constraints to native configuration tests - #21837

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
QAQadws:codex/fix-native-cgo-test-constraints
Nov 2, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
QAQadws:codex/fix-native-cgo-test-constraints

Conversation

@QAQadws

@QAQadws QAQadws commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Add cgo build constraints to both DeepDoc native configuration tests to fix test compilation when CGO_ENABLED=0

@QAQadws QAQadws added the ci Continue Integration label Nov 2, 2026
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fed8dfec-58b5-4ec4-94a2-3a880f9dcd04
Commits

Reviewing files that changed from the base of the PR and between 2c8cc8a and 3aa35be.

Files selected for processing: 2
  • internal/deepdoc/native/overridable_config_test.go
  • internal/deepdoc/parser/pdf/inference/native_analyzer/overridable_config_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

Two test files now have cgo build constraints. The constraints restrict those tests to builds with cgo enabled.

Changes: Test Build Constraints

Layer / File(s) Summary
Restrict tests to cgo builds
internal/deepdoc/native/overridable_config_test.go, internal/deepdoc/parser/pdf/inference/native_analyzer/overridable_config_test.go
Both test files now include a build constraint for cgo builds.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Bug fix

Suggested reviewers: xugangqiang

Merge Risk: Minimal · up to 3aa35

The intended cgo-only test build behavior is correctly implemented, with no merge-blocking risk identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding cgo constraints to DeepDoc native configuration tests.
Description check Passed The description states the change and explains that it fixes test compilation when CGO_ENABLED=0. It omits the template's "### Summary" heading, but the required summary content is present.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the build-time gate,
And keeps non-cgo tests to wait.
With cgo on, the tests can run,
Two small constraints, their work is done.
The rabbit hops beneath the sun.

@QAQadws
QAQadws requested a review from Lynn-Inf November 2, 2026 03:11

@Harsh23Kashyap Harsh23Kashyap left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified at head 3aa35be. On main these two test files are the only Go files in their packages without cgo constraints, so CGO_ENABLED=0 fails to compile both packages (undefined: modelFileDet in internal/deepdoc/native, undefined: tsrCellsFn in native_analyzer; reproduced locally with go vet). With this change CGO_ENABLED=0 go vet is clean for both packages, and the tags match the convention every sibling source and test file already follows. LGTM.

@wangq8

wangq8 commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

LGTM

@wangq8
wangq8 merged commit d03423d into infiniflow:main Nov 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants