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

format issue with --cucumber-json option #409

Closed
sumitmishra opened this issue Oct 27, 2020 · 1 comment
Closed

format issue with --cucumber-json option #409

sumitmishra opened this issue Oct 27, 2020 · 1 comment

Comments

@sumitmishra
Copy link

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

[x] I have read the contributing guide lines at https://github.com/radish-bdd/radish/blob/master/.github/CONTRIBUTING.md

[x] I have read and respect the code of conduct at https://github.com/radish-bdd/radish/blob/master/.github/CODE_OF_CONDUCT.md

[x] I have searched the existing issues and I'm convinced that mine is new.

Describe the bug
This is related to this issue reported in #103 ; #103

I am using radish capability in terraform-compliance (https://github.com/eerkunt/terraform-compliance) to generate report in cucumber-json format. The output is being consumed by AWS CodeBuid to produce pretty html reporting but it doesn't like the fact that the 'duration' field in the json report has a decimal point:

        {
            "description": "",
            "id": "2",
            "keyword": "Scenario",
            "line": 10,
            "name": "Ensure that VPC flow logs are written to cloud-watch-logs and not to s3",
            "steps": [
                {
                    "keyword": "Given",
                    "line": 11,
                    "name": "Given I have aws_flow_log defined",
                    "result": {
                        "duration": 524000.00000000006,
                        "status": "passed"
                    }
                },
                {
                    "keyword": "When",
                    "line": 12,
                    "name": "When it has log_destination_type",
                    "result": {
                        "duration": 70000.0,
                        "status": "passed"
                    }
                },
                {
                    "keyword": "Then",
                    "line": 13,
                    "name": "Then its value must not be \"s3\"",
                    "result": {
                        "duration": 331000.0,
                        "status": "passed"
                    }
                }
            ],
            "tags": [],
            "type": "scenario"
        },

AWS CodeBuild error:

Error in UPLOAD_ARTIFACTS phase: [tf-compliance-html-report: [error processing report: [/codebuild/output/src276496841/src/reports/test.json: json: cannot unmarshal number 3524000.00000000006 into Go struct field Result.elements.steps.result.duration of type time.Duration]]]

there is no defined output format for cucumber-json (issue #103 mentions same), but I am wondering if there is reason for outputting the duration field with decimal point as its unit is nanoseconds?

Environment and Version

  • OS (incl. terminal and shell used): macOS Darwin kernel version18.7.0
  • Python Version: Python 3.7
  • radish Version (radish --version): 0.13.1
@timofurrer
Copy link
Member

but I am wondering if there is reason for outputting the duration field with decimal point as its unit is nanoseconds?

I don't think that there is a reason for that - we'll release v0.13.3 asap 🎉

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