Skip to content
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
eae4c99
Add inferencepool_lifecycle test.
SinaChavoshi May 1, 2025
404f522
Resolve setup issues and enable InferencePool test
SinaChavoshi May 2, 2025
d396ecb
correct Lint error Multiplication of durations
SinaChavoshi May 5, 2025
0455c47
Fix missing containerPort, is missing
SinaChavoshi May 5, 2025
b531e66
change gateway name from "gateway-conformance-app" to "conformance-ga…
SinaChavoshi May 5, 2025
5510e69
clarify why K8s types are needed.
SinaChavoshi May 5, 2025
04c9798
Update conformance/conformance.go
SinaChavoshi May 5, 2025
9427f31
Update conformance/conformance.go
SinaChavoshi May 5, 2025
093d3ad
remove for loop when adding SupportedFeatures
SinaChavoshi May 5, 2025
e3c8381
remove exessive logging
SinaChavoshi May 5, 2025
c9a8f77
Update conformance/conformance.go
SinaChavoshi May 5, 2025
5ac19ff
move excess debug logs behind debug flag.
SinaChavoshi May 5, 2025
3b8df3b
remove CONFORMANCE.GO prefix from logs.
SinaChavoshi May 5, 2025
bde61b8
change the pull logic and use default value from GatewayMustHaveAddress
SinaChavoshi May 5, 2025
57d68fd
fix mt.Sprintf can be replaced with string concatenation
SinaChavoshi May 6, 2025
fa93b15
add a function for logDebug
SinaChavoshi May 7, 2025
06f29cc
factor out ensureGatewayAvailableAndReady
SinaChavoshi May 7, 2025
da2e9ef
removed todo comment in helper.go
SinaChavoshi May 7, 2025
5e1d8e9
remove CONFORMANCE.GO from log
SinaChavoshi May 7, 2025
f424464
Add InferencePoolLifecycle test
SinaChavoshi May 8, 2025
84d1ba2
update comments in helper.go
SinaChavoshi May 8, 2025
5ad31cb
Initial commit for InferencePoolNoMatchingPodsRouteStatus test
SinaChavoshi May 9, 2025
738089b
resolve lint issue.
SinaChavoshi May 9, 2025
d8577b0
error messages, should not be capitalized or end with punctuation
SinaChavoshi May 9, 2025
0af3cb6
Merge branch 'inf_pool_tests' into inf_pool_tests_3
SinaChavoshi May 9, 2025
63a82ed
Merge branch 'inf_pool_tests_3' into inf_pool_tests_5
SinaChavoshi May 9, 2025
fc3ee1e
Add inferencepool_lifecycle test.
SinaChavoshi May 1, 2025
ba677ac
Resolve setup issues and enable InferencePool test
SinaChavoshi May 2, 2025
3ff24a1
removed todo comment in helper.go
SinaChavoshi May 7, 2025
2dad18d
Add InferencePoolLifecycle test
SinaChavoshi May 8, 2025
0052a23
update comments in helper.go
SinaChavoshi May 8, 2025
ebfe6df
Merge branch 'inf_pool_tests_3' into inf_pool_tests_5
SinaChavoshi May 9, 2025
b419259
remove Conformanc.go from log message
SinaChavoshi May 12, 2025
08ca992
Merge branch 'inf_pool_tests_3' into inf_pool_tests_5
SinaChavoshi May 12, 2025
f54b575
Remove lifecycle test.
SinaChavoshi May 12, 2025
731f734
Merge branch 'inf_pool_tests_3' into inf_pool_tests_5
SinaChavoshi May 12, 2025
91b053b
Removed unused helper methods ( inference pool must have selector & m…
SinaChavoshi May 12, 2025
d441791
Merge branch 'inf_pool_tests_3' into inf_pool_tests_5
SinaChavoshi May 12, 2025
3a98b84
add back HTTPRouteMustHaveParentStatusConditions
SinaChavoshi May 12, 2025
e4c18d5
Set timeout values as constant
SinaChavoshi May 12, 2025
a07874b
Merge branch 'inf_pool_tests_3' into inf_pool_tests_5
SinaChavoshi May 12, 2025
36073dd
Merge branch 'main' into inf_pool_tests_3
SinaChavoshi May 12, 2025
cd042fe
change timeout.go to timing.go
SinaChavoshi May 13, 2025
c99b24c
Merge branch 'inf_pool_tests_3' into inf_pool_tests_5
SinaChavoshi May 13, 2025
8c7470c
Merge branch 'main' into inf_pool_tests_5
SinaChavoshi May 13, 2025
482103c
remove duplicate log
SinaChavoshi May 13, 2025
3259e0f
remove excess comments and logs
SinaChavoshi May 13, 2025
8f3c119
add comment / todo for Reconciled
SinaChavoshi May 15, 2025
9324f23
Update conformance/utils/kubernetes/helpers.go
SinaChavoshi May 16, 2025
50130f1
change test to HTTPRouteInvalidInferencePoolRef
SinaChavoshi May 17, 2025
53325d9
Merge branch 'inf_pool_tests_5' of https://github.com/SinaChavoshi/ga…
SinaChavoshi May 17, 2025
63c80aa
use TODO: instead of TODO()
SinaChavoshi May 19, 2025
851f989
yaml and todos based on code review
SinaChavoshi May 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions conformance/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,18 @@ const (
// Future profiles will cover EPP and ModelServer layers.
const GatewayLayerProfileName confsuite.ConformanceProfileName = "Gateway"

// TODO() create a dedicated share location for feature names similar to
// sigs.k8s.io/gateway-api/pkg/features and change the tests from
// string casting the feature name to referencing the shared feature names.

// Conformance specific features
const SupportInferencePool features.FeatureName = "SupportInferencePool"

// InferenceCoreFeatures defines the core features that implementations
// of the "Gateway" profile for the Inference Extension MUST support.
var InferenceCoreFeatures = sets.New(
features.SupportGateway, // This is needed to ensure manifest gets applied during setup.
SupportInferencePool,
)

var GatewayLayerProfile = confsuite.ConformanceProfile{
Expand Down
74 changes: 74 additions & 0 deletions conformance/tests/basic/httproute_invalid_inferencepool_ref.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
Copyright 2025 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// TODO() refactor the structure to put all tests directly under tests instead of creating subfolders.
package basic

import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
"sigs.k8s.io/gateway-api/conformance/utils/kubernetes"
"sigs.k8s.io/gateway-api/conformance/utils/suite"
"sigs.k8s.io/gateway-api/pkg/features"

"sigs.k8s.io/gateway-api-inference-extension/conformance/tests"
)

func init() {
tests.ConformanceTests = append(tests.ConformanceTests, HTTPRouteInvalidInferencePoolRef)
}

var HTTPRouteInvalidInferencePoolRef = suite.ConformanceTest{
ShortName: "HTTPRouteInvalidInferencePoolRef",
Description: "Tests HTTPRoute status when it references an InferencePool that does not exist.",
Manifests: []string{"tests/basic/httproute_invalid_inferencepool_ref.yaml"},
Features: []features.FeatureName{
features.FeatureName("SupportInferencePool"),
features.SupportGateway,
},
Test: func(t *testing.T, s *suite.ConformanceTestSuite) {
const (
appBackendNamespace = "gateway-conformance-app-backend"
infraNamespace = "gateway-conformance-infra"
routeName = "httproute-to-non-existent-pool"
gatewayName = "conformance-gateway"
)
routeNN := types.NamespacedName{Name: routeName, Namespace: appBackendNamespace}
gatewayNN := types.NamespacedName{Name: gatewayName, Namespace: infraNamespace}

t.Run("HTTPRoute should have Accepted=True and ResolvedRefs=False for non-existent InferencePool", func(t *testing.T) {
acceptedCondition := metav1.Condition{
Type: string(gatewayv1.RouteConditionAccepted),
Status: metav1.ConditionTrue,
Reason: string(gatewayv1.RouteReasonAccepted),
}
kubernetes.HTTPRouteMustHaveCondition(t, s.Client, s.TimeoutConfig, routeNN, gatewayNN, acceptedCondition)

resolvedRefsCondition := metav1.Condition{
Type: string(gatewayv1.RouteConditionResolvedRefs),
Status: metav1.ConditionFalse,
Reason: string(gatewayv1.RouteReasonBackendNotFound),
}
kubernetes.HTTPRouteMustHaveCondition(t, s.Client, s.TimeoutConfig, routeNN, gatewayNN, resolvedRefsCondition)

t.Logf("Successfully verified HTTPRoute %s has conditions: Accepted=True and ResolvedRefs=False (Reason: BackendNotFound) for Gateway %s",
routeNN.String(), gatewayNN.String())
})
},
}
31 changes: 31 additions & 0 deletions conformance/tests/basic/httproute_invalid_inferencepool_ref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# httproute_invalid_inferencepool_ref.yaml
# This manifest defines an HTTPRoute that references an InferencePool
# by name ("non-existent-inference-pool") which is intentionally NOT defined.
# The test will verify that the HTTPRoute reflects an appropriate
# failure status because the referenced InferencePool backend cannot be found.

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
# This name must match the 'routeNN.Name' in the Go test file.
name: httproute-to-non-existent-pool
# This namespace should be one created by the base manifests,
# typically where backend applications and their routes reside.
namespace: gateway-conformance-app-backend
spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: conformance-gateway # Name of the shared Gateway from base manifests
namespace: gateway-conformance-infra # Namespace of the shared Gateway
sectionName: http
rules:
- backendRefs:
- group: inference.networking.x-k8s.io
kind: InferencePool
name: non-existent-inference-pool # Intentionally Non-Existing
port: 8080
matches:
- path:
type: PathPrefix
value: /test-non-existent-pool
4 changes: 2 additions & 2 deletions conformance/tests/basic/inferencepool_accepted.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

// Import the tests package to append to ConformanceTests
"sigs.k8s.io/gateway-api-inference-extension/conformance/tests"
infrakubernetes "sigs.k8s.io/gateway-api-inference-extension/conformance/utils/kubernetes"
k8sutils "sigs.k8s.io/gateway-api-inference-extension/conformance/utils/kubernetes"
)

func init() {
Expand All @@ -54,7 +54,7 @@ var InferencePoolAccepted = suite.ConformanceTest{
Status: metav1.ConditionTrue,
Reason: "", // "" means we don't strictly check the Reason for this basic test.
}
infrakubernetes.InferencePoolMustHaveCondition(t, s.Client, poolNN, acceptedCondition)
k8sutils.InferencePoolMustHaveCondition(t, s.Client, poolNN, acceptedCondition)
})
},
}