-
Notifications
You must be signed in to change notification settings - Fork 25
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
Pytest-bdd setup and helm_install BDD test #352
base: develop
Are you sure you want to change the base?
Conversation
And one promtail Kubernetes DaemonSet for which all replicas are Available | ||
And one etcd Kubernetes StatefulSet for which all replicas are Available | ||
And one loki Kubernetes StatefulSet for which all replicas are Available | ||
And one nats Kubernetes StatefulSet for which all replicas are Available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should use Scenario Outline
and Examples
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. We should use Scenario Outline
for these kind of test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've found it difficult to implement the feature file using 'Scenario Outline' and 'Examples'. I'd like some help in this matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an example for now: https://github.com/openebs/mayastor-control-plane/blob/c52493d5618a758b3aac6668e3d90d5f043a863d/tests/bdd/features/csi/node/parameters.feature#L7
We can sync up on monday
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, thanks.
Given: A Kubernetes cluster | ||
|
||
Scenario: Mayastor helm chart install | ||
Given worker nodes on the kubernetes cluster are labelled with the label 'openebs.io/engine=mayastor' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given worker nodes on the kubernetes cluster are labelled with the label 'openebs.io/engine=mayastor' | |
Given the worker nodes are labelled with the label 'openebs.io/engine=mayastor' |
Scenario: Mayastor helm chart install | ||
Given worker nodes on the kubernetes cluster are labelled with the label 'openebs.io/engine=mayastor' | ||
And a kubernetes namespace to install the Mayastor helm chart | ||
When the Mayastor helm chart is installed with callhome disabled and at most 3 replicas of etcd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should callhome be enabled but with sendReport false?
@given('a kubernetes namespace to install the Mayastor helm chart') | ||
def a_kubernetes_namespace_to_install_the_mayastor_helm_chart(): | ||
"""a kubernetes namespace to install the Mayastor helm chart.""" | ||
kube_config.load_kube_config() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there create_namespace, label et all be part of a common thing? Seems like we'd be doing this a lot?
Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
The set options set in these scripts may apply to other scripts when they import these ones. The importing scripts should have the freedom to decide its set options, so these scripts unset their options after their function definitions. Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
This lets the cleanup script avoid running the cleanup more than once. Also adds statuses 'Initializing', 'Ready', 'CleaningUp' and 'CleanupCompleted'. Cleanup only works on 'Ready' cleanup_config.yaml files. Also removes 'die' method and uses 'log_fatal' from scripts/utils/log.sh instead for minikube-cleanup Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
Co-authored-by: Vandana Varakantham <yvandana.varakantham@datacore.com> Co-authored-by: Tiago Castro <tiagolobocastro@gmail.com> Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
984ace6
to
307da83
Compare
And one promtail Kubernetes DaemonSet for which all replicas are Available | ||
And one etcd Kubernetes StatefulSet for which all replicas are Available | ||
And one loki Kubernetes StatefulSet for which all replicas are Available | ||
And one nats Kubernetes StatefulSet for which all replicas are Available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. We should use Scenario Outline
for these kind of test case.
def predicate() -> bool: | ||
return deployment_is_available(pytest.helm_release + "-csi-controller", pytest.helm_namespace) | ||
|
||
assert retry_predicate(predicate, pytest.max_retries, pytest.retry_seconds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: You can also use pytest modules to retry. Something like this on top of the method @retry(wait_fixed=100, stop_max_attempt_number=50)
Adds python setup for bdd tests, and adds a bdd test for testing helm install on the helm chart.
Description
Changes:
TODO:
Motivation and Context
Testing...
Regression
No