kudobuilder / kuttl

KUbernetes Test TooL (kuttl)
https://kuttl.dev
Apache License 2.0
661 stars 86 forks source link

kuttl assert can't handle TestAssert #221

Open hassenius opened 3 years ago

hassenius commented 3 years ago

Background: I have a 00-assert.yaml looking like this:

apiVersion: kudo.dev/v1alpha1
kind: TestAssert
timeout: 600
---
apiVersion: orchestrator.management.ibm.com/v1alpha1
kind: Installation
metadata:
  name: management-installation
  namespace: cp4m
status:
  phase: Running

kubectl kuttl test <path> yields the desired result of setting a custom timeout for the state to be reached for the specific assertion (at least it appears like it is, and the test case completes successfully without timing out after the default 30 seconds)

However, I would also like to use the same declared assets to "point" at an existing environment, so I would have expected to be able to just do kubectl kuttl assert <path>/test-*/*-assert.yaml

What happened: kubectl kuttl assert <path>/test-*/*-assert.yaml yields

object does not implement the Object interfaces
Error: asserts not valid

if I remove

apiVersion: kudo.dev/v1alpha1
kind: TestAssert
timeout: 600
---

from *-assert.yaml files I get the expected result:

assert is valid

or

resource Installation:cp4m/management-installation: .status.phase: value mismatch, expected: Foobar != actual: Running
Error: asserts not valid

What you expected to happen: kubectl kuttl assert to be able to handle kind: TestAssert in the same way kubectl kuttl test does

How to reproduce it (as minimally and precisely as possible): Create a 00-assert.yaml with a

apiVersion: kudo.dev/v1alpha1
kind: TestAssert
timeout: 600
---

Anything else we need to know?:

Environment:

zulhfreelancer commented 3 years ago

I'm facing this problem too

kensipe commented 3 years ago

thanks for the heads up... I will look into this in the next couple of days!

kensipe commented 2 years ago

well... I obviously meant in the next couple of years :). This is old and expected to still be an issue. Working for inclusion for next month.