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

junit testcase created for empty yaml docs #45

Closed
davidholsgrove opened this issue Apr 23, 2021 · 3 comments
Closed

junit testcase created for empty yaml docs #45

davidholsgrove opened this issue Apr 23, 2021 · 3 comments

Comments

@davidholsgrove
Copy link
Contributor

Testing out the junit xml output format, I see we have empty testcases added to the report where kubeconform encounters a yaml document with no content, including where its just a comment - for example;

# https://raw.githubusercontent.com/vmware-tanzu/helm-charts/velero-2.14.7/charts/velero/crds/restores.yaml
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  labels:
    app.kubernetes.io/name: velero
  annotations:
    controller-gen.kubebuilder.io/version: v0.3.0
  name: restores.velero.io
kubeconform -strict -output junit velero/crds/restores.yaml

produces a testsuite with 2 testcases;

<testsuites name="kubeconform" time="0.3551641" tests="1" failures="0" disabled="0" errors="1">
  <testsuite name="velero/crds/restores.yaml" id="1" tests="2" failures="0" errors="1" disabled="0" skipped="0">
    <properties></properties>
    <testcase name="" classname="@"></testcase>
    <testcase name="restores.velero.io" classname="[email protected]/v1beta1">
      <error message="could not find schema for CustomResourceDefinition" type=""></error>
    </testcase>
  </testsuite>
</testsuites>
@yannh
Copy link
Owner

yannh commented May 24, 2021

Hi @davidholsgrove , It's tricky but it actually seem to work as expected... at least if my understanding of yaml is correct :) the --- is a separator, your file contains two yaml documents: one empty one, that contains only a comment - and another, normal, one.

I guess the question is what Junit output we expect for empty documents 🤔

@yannh yannh closed this as completed in 2eefa7f Aug 29, 2021
@yannh yannh reopened this Aug 29, 2021
@yannh
Copy link
Owner

yannh commented Aug 29, 2021

I have rewritten the Junit output tests, and I believe I have fixed this.

2eefa7f

I will make a new release very soon.

@yannh
Copy link
Owner

yannh commented Aug 29, 2021

Released with v0.4.10.

@yannh yannh closed this as completed Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants