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

reportFormat in TestSuite #449

Open
blezoray opened this issue Dec 29, 2022 · 2 comments · May be fixed by #464
Open

reportFormat in TestSuite #449

blezoray opened this issue Dec 29, 2022 · 2 comments · May be fixed by #464

Comments

@blezoray
Copy link

blezoray commented Dec 29, 2022

Hello,

I have the following TestSuite file:

apiVersion: kuttl.dev/v1beta1
kind: TestSuite
testDirs:
- ./tests/e2e
reportFormat: XML
namespace: mpms-tests-auto

The execution works fine but Kuttl continues to generate the report in JSON format.
Could you check that point ?

I use the version 0.14.0.

Rgds.

@rishinair11
Copy link
Contributor

rishinair11 commented Mar 11, 2023

Please use lowercase xml or json for the reportFormat field. That should fix your issue.
But there seems to be a bug here.
Investigating...

rishinair11 pushed a commit to rishinair11/kuttl that referenced this issue Mar 11, 2023
Fixes issue kudobuilder#449

When reportFormat in `kuttl-test.yaml` is specified in uppercase,
it is passed as it is to report.Report func in harness.go.
It needs to be passed as lowercase so that
the `switch` compares against valid report format types (`ftype`)
rishinair11 pushed a commit to rishinair11/kuttl that referenced this issue Mar 11, 2023
Fixes issue kudobuilder#449

When reportFormat in `kuttl-test.yaml` is specified in uppercase,
it is passed as it is to report.Report func in harness.go.
It needs to be passed as lowercase so that
the `switch` compares against valid report format types (`ftype`)

Also added unit tests

List of tests added:

- should_create_an_XML_report_when_format_is_XML
- should_create_an_XML_report_when_format_is_xml
- should_create_an_JSON_report_when_format_is_JSON
- should_create_an_JSON_report_when_format_is_json
- should_not_create_any_report_when_format_is_empty

Signed-off-by: Rishikesh Nair <[email protected]>
rishinair11 pushed a commit to rishinair11/kuttl that referenced this issue Mar 11, 2023
Fixes issue kudobuilder#449

When reportFormat in `kuttl-test.yaml` is specified in uppercase,
it is passed as it is to report.Report func in harness.go.
It needs to be passed as lowercase so that
the `switch` compares against valid report format types (`ftype`)

Also added unit tests

List of tests added:

- should_create_an_XML_report_when_format_is_XML
- should_create_an_XML_report_when_format_is_xml
- should_create_an_JSON_report_when_format_is_JSON
- should_create_an_JSON_report_when_format_is_json
- should_not_create_any_report_when_format_is_empty

Signed-off-by: Rishikesh Nair <[email protected]>
Signed-off-by: Rishi <[email protected]>
rishinair11 pushed a commit to rishinair11/kuttl that referenced this issue Mar 11, 2023
Fixes issue kudobuilder#449

When reportFormat in `kuttl-test.yaml` is specified in uppercase,
it is passed as it is to report.Report func in harness.go.
It needs to be passed as lowercase so that
the `switch` compares against valid report format types (`ftype`)

Also added unit tests

List of tests added:

- should_create_an_XML_report_when_format_is_XML
- should_create_an_XML_report_when_format_is_xml
- should_create_an_JSON_report_when_format_is_JSON
- should_create_an_JSON_report_when_format_is_json
- should_not_create_any_report_when_format_is_empty

Signed-off-by: Rishikesh Nair <[email protected]>
Signed-off-by: Rishi <[email protected]>
Signed-off-by: Rishikesh Nair <[email protected]>
rishinair11 pushed a commit to rishinair11/kuttl that referenced this issue Mar 11, 2023
Fixes issue kudobuilder#449

When reportFormat in `kuttl-test.yaml` is specified in uppercase,
it is passed as it is to report.Report func in harness.go.
It needs to be passed as lowercase so that
the `switch` compares against valid report format types (`ftype`)

Also added unit tests

List of tests added:

- should_create_an_XML_report_when_format_is_XML
- should_create_an_XML_report_when_format_is_xml
- should_create_an_JSON_report_when_format_is_JSON
- should_create_an_JSON_report_when_format_is_json
- should_not_create_any_report_when_format_is_empty
rishinair11 pushed a commit to rishinair11/kuttl that referenced this issue Mar 11, 2023
Fixes issue kudobuilder#449

When reportFormat in `kuttl-test.yaml` is specified in uppercase,
it is passed as it is to report.Report func in harness.go.
It needs to be passed as lowercase so that
the `switch` compares against valid report format types (`ftype`)

Also added unit tests

List of tests added:

- should_create_an_XML_report_when_format_is_XML
- should_create_an_XML_report_when_format_is_xml
- should_create_an_JSON_report_when_format_is_JSON
- should_create_an_JSON_report_when_format_is_json
- should_not_create_any_report_when_format_is_empty

Signed-off-by: Rishikesh Nair <[email protected]>
@rishinair11
Copy link
Contributor

There was a bug that I have fixed, regarding how the reportFormat was being passed to the Harness package.
This should fix it.

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

Successfully merging a pull request may close this issue.

2 participants