Skip to content

Commit

Permalink
test (kubernetes-client-api) : Remove redundant methods and nested cl…
Browse files Browse the repository at this point in the history
…asses in ConfigTest

- Remove `@Nested` class BuildConfigured as it doesn’t have any common setup, teardown blocks
- Remove these tests as they were already covered by ConfigSourcePrecedenceTest:
  - `testOverrideViaSystemProperties`
  - `testSystemPropertiesAndBuilderGetMorePrecedenceOverKubeconfig`
- Rename tests with legacy names starting with `testXXXX`
- Add `@DisplayName` annotation for tests wherever applicable
- Remove `assertConfig` method and inline assertions in tests wherever it’s getting used
- Remove abstract test class introduced in #6157 `AutoConfiguredDisabledScenarios`, duplicate tests so that it’s more clear in case of failure
  - Move this test outside of ConfigTest as a separate test class
    `ConfigDisableAutoConfigurationTest`

Signed-off-by: Rohan Kumar <[email protected]>
  • Loading branch information
rohanKanojia committed Jul 25, 2024
1 parent b270347 commit 2468d52
Show file tree
Hide file tree
Showing 6 changed files with 841 additions and 326 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v1
clusters:
- cluster:
certificate-authority: ca.crt
extensions:
- extension:
last-update: Mon, 22 Jul 2024 15:23:30 IST
provider: test.sigs.k8s.io
version: v1.33.1
name: cluster_info
server: https://172.28.128.4:8443
name: test
contexts:
- context:
cluster: test
extensions:
- extension:
last-update: Mon, 22 Jul 2024 15:23:30 IST
provider: test.sigs.k8s.io
version: v1.33.1
name: context_info
namespace: namespace-from-kubeconfig
user: test
name: test
current-context: test
kind: Config
preferences: {}
users:
- name: test
user:
client-certificate: client.crt
client-key: client.key
token: token-from-kubeconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
namespace-from-mounted-serviceaccount
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
token-from-mounted-serviceaccount

This file was deleted.

0 comments on commit 2468d52

Please sign in to comment.