diff --git a/test/integration/dra/all/all_test.go b/test/integration/dra/all/all_test.go new file mode 100644 index 00000000000..a047461b410 --- /dev/null +++ b/test/integration/dra/all/all_test.go @@ -0,0 +1,27 @@ +/* +Copyright 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. +*/ + +package all + +import ( + "testing" + + "k8s.io/kubernetes/test/integration/dra" +) + +func TestDRA(t *testing.T) { + dra.Run(t, "^all$") +} diff --git a/test/integration/dra/main_test.go b/test/integration/dra/all/main_test.go similarity index 92% rename from test/integration/dra/main_test.go rename to test/integration/dra/all/main_test.go index 8be01afe495..e9b09128827 100644 --- a/test/integration/dra/main_test.go +++ b/test/integration/dra/all/main_test.go @@ -1,5 +1,5 @@ /* -Copyright 2025 The Kubernetes Authors. +Copyright 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. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package dra +package all import ( "testing" diff --git a/test/integration/dra/api/api_test.go b/test/integration/dra/api/api_test.go new file mode 100644 index 00000000000..980ed2fb162 --- /dev/null +++ b/test/integration/dra/api/api_test.go @@ -0,0 +1,28 @@ +/* +Copyright 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. +*/ + +package api + +import ( + "testing" + + "k8s.io/kubernetes/test/integration/dra" +) + +func TestDRA(t *testing.T) { + // Various special configurations with few tests. + dra.Run(t, "^(disabled|v1beta1|v1beta2|slice-taints|GA-opt-out)$") +} diff --git a/test/integration/dra/api/main_test.go b/test/integration/dra/api/main_test.go new file mode 100644 index 00000000000..a1836055644 --- /dev/null +++ b/test/integration/dra/api/main_test.go @@ -0,0 +1,27 @@ +/* +Copyright 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. +*/ + +package api + +import ( + "testing" + + "k8s.io/kubernetes/test/integration/framework" +) + +func TestMain(m *testing.M) { + framework.EtcdMain(m.Run) +} diff --git a/test/integration/dra/binding_conditions_test.go b/test/integration/dra/binding_conditions.go similarity index 100% rename from test/integration/dra/binding_conditions_test.go rename to test/integration/dra/binding_conditions.go diff --git a/test/integration/dra/default/default_test.go b/test/integration/dra/default/default_test.go new file mode 100644 index 00000000000..9bb27e52cca --- /dev/null +++ b/test/integration/dra/default/default_test.go @@ -0,0 +1,27 @@ +/* +Copyright 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. +*/ + +package def + +import ( + "testing" + + "k8s.io/kubernetes/test/integration/dra" +) + +func TestDRA(t *testing.T) { + dra.Run(t, "^default$") +} diff --git a/test/integration/dra/default/main_test.go b/test/integration/dra/default/main_test.go new file mode 100644 index 00000000000..6a6b449320b --- /dev/null +++ b/test/integration/dra/default/main_test.go @@ -0,0 +1,27 @@ +/* +Copyright 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. +*/ + +package def + +import ( + "testing" + + "k8s.io/kubernetes/test/integration/framework" +) + +func TestMain(m *testing.M) { + framework.EtcdMain(m.Run) +} diff --git a/test/integration/dra/device_taints_test.go b/test/integration/dra/device_taints.go similarity index 100% rename from test/integration/dra/device_taints_test.go rename to test/integration/dra/device_taints.go diff --git a/test/integration/dra/dra_test.go b/test/integration/dra/dra.go similarity index 99% rename from test/integration/dra/dra_test.go rename to test/integration/dra/dra.go index 05999f8db9b..77c12e28a2a 100644 --- a/test/integration/dra/dra_test.go +++ b/test/integration/dra/dra.go @@ -23,6 +23,7 @@ import ( "errors" "fmt" "math/rand/v2" + "regexp" "sort" "strings" "sync" @@ -116,8 +117,13 @@ const ( schedulingTimeout = time.Minute ) -func TestDRA(t *testing.T) { testDRA(ktesting.Init(t)) } -func testDRA(tCtx ktesting.TContext) { +func Run(t *testing.T, whatRE string) { run(ktesting.Init(t), whatRE) } +func run(tCtx ktesting.TContext, whatRE string) { + re, err := regexp.Compile(whatRE) + if err != nil { + tCtx.Fatalf("%s: %v", whatRE, err) + } + // Each sub-test brings up the API server in a certain // configuration. These sub-tests must run sequentially because they // change the global DefaultFeatureGate. For each configuration, @@ -265,6 +271,10 @@ func testDRA(tCtx ktesting.TContext) { }, }, } { + if !re.MatchString(name) { + continue + } + tCtx.Run(name, func(tCtx ktesting.TContext) { var entries []string for key, value := range tc.features { diff --git a/test/integration/dra/ga/ga_test.go b/test/integration/dra/ga/ga_test.go new file mode 100644 index 00000000000..d53c4f362ac --- /dev/null +++ b/test/integration/dra/ga/ga_test.go @@ -0,0 +1,27 @@ +/* +Copyright 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. +*/ + +package ga + +import ( + "testing" + + "k8s.io/kubernetes/test/integration/dra" +) + +func TestDRA(t *testing.T) { + dra.Run(t, "^GA$") +} diff --git a/test/integration/dra/ga/main_test.go b/test/integration/dra/ga/main_test.go new file mode 100644 index 00000000000..261cea03967 --- /dev/null +++ b/test/integration/dra/ga/main_test.go @@ -0,0 +1,27 @@ +/* +Copyright 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. +*/ + +package ga + +import ( + "testing" + + "k8s.io/kubernetes/test/integration/framework" +) + +func TestMain(m *testing.M) { + framework.EtcdMain(m.Run) +} diff --git a/test/integration/dra/helpers_test.go b/test/integration/dra/helpers.go similarity index 100% rename from test/integration/dra/helpers_test.go rename to test/integration/dra/helpers.go diff --git a/test/integration/dra/partitionable_devices_test.go b/test/integration/dra/partitionable_devices.go similarity index 100% rename from test/integration/dra/partitionable_devices_test.go rename to test/integration/dra/partitionable_devices.go diff --git a/test/integration/dra/resourceclaim_test.go b/test/integration/dra/resourceclaim.go similarity index 100% rename from test/integration/dra/resourceclaim_test.go rename to test/integration/dra/resourceclaim.go diff --git a/test/integration/dra/uses_all_resources_test.go b/test/integration/dra/uses_all_resources.go similarity index 100% rename from test/integration/dra/uses_all_resources_test.go rename to test/integration/dra/uses_all_resources.go