Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add context switching in TestStep #560

Merged
merged 6 commits into from
Sep 11, 2024

Conversation

kumar-mallikarjuna
Copy link
Contributor

@kumar-mallikarjuna kumar-mallikarjuna commented Sep 6, 2024

What this PR does / why we need it:

Fixes #558

Testing
Files

.
├── e2e
│   └── case
│       ├── 00-teststep.yaml
│       └── ns.yaml
├── kubeconfig
└── kuttl-test.yaml
# 00-teststep.yaml

apiVersion: kuttl.dev/v1beta1
kind: TestStep
apply:
- ns.yaml
kubeconfig: ~/.kube/config
context: kind-data-plane-aws
# ns.yaml

apiVersion: v1
kind: Namespace
metadata:
  name: test-ns
# kuttl-test.yaml

apiVersion: kuttl.dev/v1beta1
kind: TestSuite
testDirs:
- ./e2e
timeout: 2400
startControlPlane: false

Contexts

k config get-contexts
CURRENT   NAME                    CLUSTER                 AUTHINFO                NAMESPACE
          cluster                 cluster                 user
          kind-data-plane-aws     kind-data-plane-aws     kind-data-plane-aws
          kind-data-plane-aws-2   kind-data-plane-aws-2   kind-data-plane-aws-2
*         kind-data-plane-gcp     kind-data-plane-gcp     kind-data-plane-gcp

Namespace Created in the specified (non-default) context

$ k --context kind-data-plane-aws get ns -w
NAME                 STATUS   AGE
default              Active   20h
kube-node-lease      Active   20h
kube-public          Active   20h
kube-system          Active   20h
local-path-storage   Active   20h
pd-hcomp-1           Active   20h
kuttl-test-pleasant-duckling   Active   0s
test-ns                        Active   0s
test-ns                        Terminating   0s
kuttl-test-pleasant-duckling   Terminating   0s
test-ns                        Terminating   5s
kuttl-test-pleasant-duckling   Terminating   5s
test-ns                        Terminating   5s
kuttl-test-pleasant-duckling   Terminating   5s

Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
Copy link
Member

@porridge porridge left a comment

Choose a reason for hiding this comment

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

Thanks, this looks nice!
Can you please add this new setting to docs/? And also see a nitpick inline.

pkg/test/case.go Outdated Show resolved Hide resolved
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
@kumar-mallikarjuna
Copy link
Contributor Author

Hi @porridge , thanks for the review. I've incorporated the comments. Could you please take a look?

Copy link
Member

@porridge porridge left a comment

Choose a reason for hiding this comment

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

😍

@porridge porridge merged commit 2cb230f into kudobuilder:main Sep 11, 2024
5 checks passed
This pull request was closed.
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.

Allow specifying Kubeconfig contexts in the TestSteps
2 participants