devopsspiral / KubeLibrary

Kubernetes library for Robot Framework
MIT License
139 stars 38 forks source link

Failing when I run the example pod status #120

Closed wmariuss closed 1 year ago

wmariuss commented 1 year ago

Cluster:

NAME                        READY   STATUS    RESTARTS   AGE
getquota-6b85cd9c49-4mjdb   1/1     Running   0          2d
traefik-6cd978c459-2l7rw    1/1     Running   0          2d3h

KubeLibrary:

Library  KubeLibrary

***Test Cases***

Pods in kube-system are ok
    [Documentation]  Test if all pods in kube-system initiated correctly and are running or succeeded
    [Tags]    cluster    smoke
    Given kubernetes API responds
    When getting all pods in  "kube-system"
    Then all pods in "kube-system" are running or succeeded

Results:

poetry run robot --outputdir reports testcases
==============================================================================
Testcases
==============================================================================
Testcases.Kubernetes
==============================================================================
Testcases.Kubernetes.Pods
==============================================================================
Pods in kube-system are ok :: Test if all pods in kube-system init... | FAIL |
No keyword with name 'Given kubernetes API responds' found.
------------------------------------------------------------------------------
Testcases.Kubernetes.Pods                                             | FAIL |
1 test, 0 passed, 1 failed
==============================================================================
Testcases.Kubernetes                                                  | FAIL |
1 test, 0 passed, 1 failed
==============================================================================
Testcases                                                             | FAIL |
1 test, 0 passed, 1 failed
==============================================================================
Output:  /Users/mariuss/work/robotest/reports/output.xml
Log:     /Users/mariuss/work/robotest/reports/log.html
Report:  /Users/mariuss/work/robotest/reports/report.html

Versions:

KubeLibrary: 0.8.0
Python: 3.9.15
Kubernetes: 1.22
wmariuss commented 1 year ago

I am closing the issue. I figured out what is missing.

But i think the documentation should be clear enough. The way is pointing the example in README file is not enough and not for people who did not used RobotFramework before.

m-wcislo commented 1 year ago

Hi, so what was missing? I can add whatever needed.

wmariuss commented 1 year ago

So, you have an example, a good example: Pods in kube-system are ok. But when you try to add it, it is going to fail (of course, is normal), because the keywords missing and there is no way to find and add them. I know there is a dir with all the test casses, but does not give a real example from start to end. I think is good if we have:

  1. One basic example of test case, explain all the lines
  2. What you need in order to have a complete up and running test execution (including keywords)
  3. All in one section of README file

After you have this, you can jump quickly on the testcasses examples.

m-wcislo commented 1 year ago

Is this better? https://github.com/devopsspiral/KubeLibrary/pull/121

wmariuss commented 1 year ago

Nice