bottlerocket-test-system icon indicating copy to clipboard operation
bottlerocket-test-system copied to clipboard

TestSys CLI does not return useful yaml formatting errors

Open jpmcb opened this issue 1 year ago • 3 comments

Given a test yaml that looks like:

---
apiVersion: testsys.bottlerocket.aws/v1
kind: Test
metadata:
  name: hello-bones
  namespace: testsys-bottlerocket-aws
spec:
  agent:
    name: hello-agent
    image: "example-test-agent:demo"
    keep_running: false
    configuration:
      mode: Fast
      person: Bones the Cat
      helloCount: 3
      helloDurationMilliseconds: 500
  resources: []
  dependsOn: []

and attempting to run it:

❯ cli run file example_test_agent.yaml
Unable to read manifest

Note that the keep_running key should be keepRunning. The CRD key error isn't bubbled up from the underlying read_manifest

https://github.com/bottlerocket-os/bottlerocket-test-system/blob/e4c6d22e76cacde344ef0765ed5630edf15ea58e/cli/src/run_file.rs#L17

Still new to rust, but it would be great if a more descriptive error was returned.

jpmcb avatar Aug 17 '22 22:08 jpmcb