Skip to content

Test Kibana managed network validation without Docker - #12072

Open
manduinca wants to merge 1 commit into
testcontainers:mainfrom
manduinca:test/kibana-network-validation
Open

Test Kibana managed network validation without Docker#12072
manduinca wants to merge 1 commit into
testcontainers:mainfrom
manduinca:test/kibana-network-validation

Conversation

@manduinca

@manduinca manduinca commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Part of #12070: make Kibana's managed-mode network validation tests independent of Docker.

The two negative tests currently call kibana.start(), which starts the Elasticsearch dependency before reaching the network validation. Extract the existing validation into a package-private static helper accepting the two network instances, and exercise it directly. configureManagedElasticsearch() still invokes the same checks in the same order.

Simply avoiding start() is insufficient: constructing KibanaContainer(es) resolves the Elasticsearch image name and can initialize Docker. These tests now need only uninitialized Network objects, with no container construction, image resolution, or startup.

Coverage includes both valid configurations (neither network explicit, or the same explicit network) and all three invalid configurations (only Elasticsearch explicit, only Kibana explicit, or different networks). Existing happy-path integration tests are unchanged. This does not attempt the other CI/matrix optimizations proposed in #12070.

Validation

  • Five network validation tests pass in 0.621 s total test time, with no Docker/Ryuk initialization in test output.
  • For context, the original two tests took 174.259 s locally, and one failed during Elasticsearch startup before reaching network validation. This is not a clean passing-baseline benchmark or a claim about total CI savings.
  • Module checkstyleMain, checkstyleTest, spotlessApply, and spotlessCheck pass.
  • The repository's current Spotless version needs an older npm CLI; formatting was run with temporary npm 10, without changing build files.
  • The full Elasticsearch integration suite was not run.

Summary by CodeRabbit

  • Bug Fixes

    • Improved validation of network configuration for managed Kibana and Elasticsearch setups.
    • Ensured invalid configurations are rejected consistently, including cases where only Kibana is assigned to an explicit network.
  • Tests

    • Expanded coverage for valid and invalid managed-mode network configurations.
    • Simplified validation tests for faster, more direct verification.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 146e71d3-815e-4705-9bbb-55e5dc59c109

📥 Commits

Reviewing files that changed from the base of the PR and between 8e54951 and 3803d1c.

📒 Files selected for processing (2)
  • modules/elasticsearch/src/main/java/org/testcontainers/elasticsearch/KibanaContainer.java
  • modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/KibanaContainerTest.java

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The managed-mode network validator now receives both network values explicitly. Tests call the validator directly and cover missing, shared, and differing explicit networks.

Changes

Managed network validation

Layer / File(s) Summary
Network validation contract and tests
modules/elasticsearch/src/main/java/org/testcontainers/elasticsearch/KibanaContainer.java, modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/KibanaContainerTest.java
ensureCorrectNetworkSetupForManagedMode is now a static package-private method with explicit Elasticsearch and Kibana network arguments. Tests cover accepted network configurations and rejected mismatches directly.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested reviewers: pioorg

Merge Risk: ⚪ Minimal · up to 3803d

The refactor preserves managed-network validation behavior while making its tests Docker-independent. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: testing Kibana managed network validation without Docker.
Description check ✅ Passed The description explains the context, implementation, test coverage, validation results, and limitations. It also references the related issue.
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.
  • Fix all pre-merge checks with AI

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.

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.

1 participant