kudobuilder / kuttl

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

Specified test namespace not created when running TestSuite #512

Closed Jaybee18 closed 4 months ago

Jaybee18 commented 5 months ago

What happened: The tests in a TestSuite fail, because the specified namespace does not exist.

What you expected to happen: The TestSuite should create the namespace that is specified in the YAML, as it is described in the documentation: https://kuttl.dev/docs/testing/reference.html#testsuite:~:text=%22kuttl%2Dtest%22-,namespace,-string

How to reproduce it (as minimally and precisely as possible):

# kuttl-test.yaml
apiVersion: kuttl.dev/v1beta1
kind: TestSuite
testDirs:
- ./mongodb
parallel: 1
namespace: "kuttl-tests-namespace"
# mongodb/01-install.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: demo
data:
  # property-like keys; each key maps to a simple value
  player_initial_lives: "3"
  ui_properties_file_name: "user-interface.properties"

  # file-like keys
  game.properties: |
    enemy.types=aliens,monsters
    player.maximum-lives=5    
  user-interface.properties: |
    color.good=purple
    color.bad=yellow
    allow.textmode=true  

And then run

kubectl kuttl test .

Anything else we need to know?: The logs indicate that the namespace creation was purposefully skipped:

logger.go:42: 09:30:26 | mongodb | Skipping creation of user-supplied namespace: kuttl-tests-namespace

Environment: