Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestSys CLI does not return useful yaml formatting errors #517

Open
jpmcb opened this issue Aug 17, 2022 · 3 comments
Open

TestSys CLI does not return useful yaml formatting errors #517

jpmcb opened this issue Aug 17, 2022 · 3 comments
Labels
blocked This issue is blocked by something.

Comments

@jpmcb
Copy link
Contributor

jpmcb commented Aug 17, 2022

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

let crds = read_manifest(&self.path).context("Unable to read manifest")?;

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

@mjsterckx mjsterckx self-assigned this Aug 18, 2022
@mjsterckx
Copy link
Contributor

I was looking into this, but the only error message that can really "bubble up" is this: data did not match any variant of untagged enum Crd

There seems to be an open PR for the serde repo (serde-rs/serde#1544) that has not been merged yet, but it would solve this issue as well. The only other solution that I can think of for the moment is to manually parse the YAML file.

@jpmcb
Copy link
Contributor Author

jpmcb commented Aug 19, 2022

The only other solution that I can think of for the moment is to manually parse the YAML file.

Nice find! This seems like something the upstream de-serializing library should report errors back on and not something we'd want to do extra work by do an additional yaml parsing. Can keep an eye on that PR!

@ecpullen ecpullen added the blocked This issue is blocked by something. label Sep 8, 2022
@webern
Copy link
Contributor

webern commented Oct 24, 2022

It might be necessary to print anyhow::Error with debug {:?} to see the underlying error "pseudo stack trace"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This issue is blocked by something.
Projects
None yet
Development

No branches or pull requests

4 participants