kudobuilder / kudobuilder/kudo
kudo test asserts that do not include name list all resources in the namespace when they do not match
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 105
- PR merge metrics
- No merged PRs in 30d
Description
**What happened**:
Currently, if you use the [resource listing feature in kudo test asserts](https://kudo.dev/docs/testing/asserts.html#listing-resources-in-the-cluster) and your assert does not match any resources, kudo test will list all resources in the namespace that have the same kind.
E.g., if the following assert does not match any pods all pods in the test namespace will be output in the test failure output which can be overwhelming:
```
apiVersion: v1
kind: Pod
metadata:
labels:
app: hello
status:
phase: Successful
```
It would be better to only output resources that have metadata that matches the assert's metadata. The downside here is, if the user is testing the metadata itself, it may make debugging _harder_.
Contributor guide
Research direction
Start with the resource-listing behavior described in the kudo test asserts documentation and reproduce it with the Pod assert shown. Trace the kudo test assert implementation, then add a regression check showing that unmatched results are filtered by assert metadata while preserving the documented failure output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- cli, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100