WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@vivekr-splunk
Copy link
Collaborator

Description

Related Issues

  • Related to #

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test improvement
  • CI/CD improvement
  • Chore (dependency updates, etc.)

Changes Made

Testing Performed

  • Unit tests pass (make test)
  • Linting passes (make lint)
  • Integration tests pass (if applicable)
  • E2E tests pass (if applicable)
  • Manual testing performed

Test Environment

  • Kubernetes Version:
  • Cloud Provider:
  • Deployment Method:

Test Steps

Documentation

  • Updated inline code comments
  • Updated README.md (if adding features)
  • Updated API documentation
  • Updated deployment guides
  • Updated CHANGELOG.md
  • No documentation needed

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have updated the Helm chart version (if applicable)
  • I have updated CRD schemas (if applicable)

Breaking Changes

Impact:

Migration Path:

Screenshots/Recordings

Additional Notes

Reviewer Notes

Please pay special attention to:


Commit Message Convention: This PR follows Conventional Commits

Copilot AI review requested due to automatic review settings December 11, 2025 06:49
@coveralls
Copy link

coveralls commented Dec 11, 2025

Pull Request Test Coverage Report for Build 20159311071

Details

  • 12 of 21 (57.14%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 36.839%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/ai/sidecars/builder.go 12 21 57.14%
Totals Coverage Status
Change from base Build 20110660898: 0.02%
Covered Lines: 2340
Relevant Lines: 6352

💛 - Coveralls

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a comprehensive KUTTL (Kubernetes Test Tool) test suite for the Splunk AI Operator, enabling end-to-end integration testing of various AIPlatform scenarios. The test suite includes configuration for automated testing, test execution utilities via Makefile, and six distinct test cases covering core operator functionality.

Key changes:

  • Added KUTTL test framework configuration and execution infrastructure
  • Implemented six test scenarios: basic platform creation, ingress configuration, SAIA feature, resource updates, deletion/finalizers, and webhook validation
  • Provided Makefile with targets for running individual or complete test suites

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
test/kuttl/kuttl-test.yaml Main KUTTL test suite configuration with timeouts, parallelism, and CRD loading
test/kuttl/Makefile Test execution targets and KUTTL installation automation
test/kuttl/setup/00-namespace.yaml Common setup resources for all test cases
test/kuttl/tests/aiplatform-basic/* Basic AIPlatform creation test with Splunk Standalone dependencies
test/kuttl/tests/aiplatform-with-ingress/* Ingress configuration and IngressReady condition validation
test/kuttl/tests/aiplatform-with-saia/* SAIA feature deployment with API and data loader components
test/kuttl/tests/aiplatform-update/* Resource update behavior and observedGeneration tracking
test/kuttl/tests/aiplatform-deletion/* Deletion workflow with finalizer handling
test/kuttl/tests/webhook-validation/* Validation webhook testing for missing required fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +9
# KUTTL will check that the previous resource fails to create
# This is done by checking for specific error patterns

# Expected error: objectStorage is required
# Expected error: splunkConfiguration is required

# Note: KUTTL automatically fails the test if resources in XX-*.yaml
# are successfully created. For webhook tests, we want creation to fail.
# Use TestStep with expectedFailures in kuttl-test.yaml or use commands
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The errors.yaml file only contains comments about expected behavior but lacks actual KUTTL test assertions or commands. KUTTL needs explicit test step configuration (via kuttl-test.yaml TestSteps) or commands to verify that the resource creation actually failed. Simply placing a comment won't cause the test to validate the webhook rejection. Consider either adding a TestStep with 'expectedFailures' in a kuttl-test.yaml for this test case, or using a command-based approach with 'kubectl apply' and checking for expected exit codes.

Suggested change
# KUTTL will check that the previous resource fails to create
# This is done by checking for specific error patterns
# Expected error: objectStorage is required
# Expected error: splunkConfiguration is required
# Note: KUTTL automatically fails the test if resources in XX-*.yaml
# are successfully created. For webhook tests, we want creation to fail.
# Use TestStep with expectedFailures in kuttl-test.yaml or use commands
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl apply -f 00-errors-resource.yaml
ignoreFailure: true
# The test will pass if the apply fails (as expected)
# Optionally, you can add 'expectedStdErr' to match error output

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +9
# Step 3: Delete the AIPlatform
# KUTTL will apply this deletion

apiVersion: ai.splunk.com/v1
kind: AIPlatform
metadata:
name: test-deletion-platform
# This file triggers deletion via kubectl delete
# The resource should be marked for deletion with deletionTimestamp
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The deletion test approach appears incomplete. KUTTL doesn't support triggering deletions by simply applying a resource manifest without content. To properly test deletion, you should either use a TestStep with a 'delete' command in a per-test kuttl-test.yaml file, or use a commands section. The current approach of having a nearly empty YAML file won't actually trigger the deletion of the resource.

Suggested change
# Step 3: Delete the AIPlatform
# KUTTL will apply this deletion
apiVersion: ai.splunk.com/v1
kind: AIPlatform
metadata:
name: test-deletion-platform
# This file triggers deletion via kubectl delete
# The resource should be marked for deletion with deletionTimestamp
# This file is intentionally left empty.
# Deletion should be performed using a kuttl-test.yaml file with a delete command.

Copilot uses AI. Check for mistakes.
storage:
vectorDB:
size: 10Gi
storageClassName: standard
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The AIPlatform resource definition appears incomplete. The 'storage' section is started but ends without proper completion, making this invalid YAML that will fail during test execution.

Copilot uses AI. Check for mistakes.
endpoint: http://test-splunk.default.svc.cluster.local:8088
secretRef:
name: test-splunk-secret

Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

Trailing whitespace detected at the end of the file. This should be removed for consistency and to follow YAML best practices.

Suggested change

Copilot uses AI. Check for mistakes.
metadata:
name: test-deletion-platform
# If this resource exists, the test fails
# KUTTL interprets this as "resource should NOT exist"
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The comment on line 10 is misleading. In KUTTL, an assert file that matches a resource by metadata typically expects that resource to exist and match the specified fields. To assert that a resource does NOT exist, you need to use TestAssert with 'errors' field or use a command-based approach. Simply placing an empty resource spec won't verify non-existence. Consider using a command like 'kubectl get' with expected failure, or restructuring the assertion approach.

Suggested change
# KUTTL interprets this as "resource should NOT exist"
# NOTE: KUTTL expects this resource to exist and match the fields above.
# To assert non-existence, use a TestAssert with 'errors' or a command-based assertion.

Copilot uses AI. Check for mistakes.
endpoint: http://test-splunk.default.svc.cluster.local:8088
secretRef:
name: test-splunk-secret

Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

Trailing whitespace detected at the end of the file. This should be removed for consistency and to follow YAML best practices.

Suggested change

Copilot uses AI. Check for mistakes.
endpoint: http://test-splunk.default.svc.cluster.local:8088
secretRef:
name: test-splunk-secret

Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

Trailing whitespace detected at the end of the file. This should be removed for consistency and to follow YAML best practices.

Suggested change

Copilot uses AI. Check for mistakes.
endpoint: http://test-splunk.default.svc.cluster.local:8088
secretRef:
name: test-splunk-secret

Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

Trailing whitespace detected at the end of the file. This should be removed for consistency and to follow YAML best practices.

Suggested change

Copilot uses AI. Check for mistakes.
endpoint: http://test-splunk.default.svc.cluster.local:8088
secretRef:
name: test-splunk-secret

Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

Trailing whitespace detected at the end of the file. This should be removed for consistency and to follow YAML best practices.

Suggested change

Copilot uses AI. Check for mistakes.
# Control plane config
controlPlaneArgs:
- --service-cluster-ip-range=10.96.0.0/12
# Apply CRDs before tests
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The 'crdDir' path references '../../helm-chart/splunk-ai-operator/crds'. This relative path should be verified to ensure it correctly resolves from the kuttl test execution context. If KUTTL is executed from the test/kuttl directory, this path would need to go up two levels to the repository root and then down to the helm-chart directory. Consider adding a comment to clarify that this path is relative to where KUTTL is executed from, or use an absolute path approach.

Suggested change
# Apply CRDs before tests
# Apply CRDs before tests
# NOTE: The following path is relative to the directory from which KUTTL is executed.
# It assumes KUTTL is run from the 'test/kuttl' directory, so '../../helm-chart/splunk-ai-operator/crds'
# resolves to the CRDs directory in the repository. Update this path if your execution context changes.

Copilot uses AI. Check for mistakes.
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.

2 participants