chaostoolkit / chaostoolkit

Chaos Engineering Toolkit & Orchestration for Developers

Home Page:https://chaostoolkit.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chaostoolkit-reporting error

guerrerojc8862 opened this issue · comments

Describe the bug
I got the an Attribute error message after running a reporting command with chaostoolkit-reporting lib. This never happenned to me before. I was a running an experiment on s3 bucket that I always run to show my coworkers how chaostoolkit can create reporting formats after realizing executions of chaos, but then I got the error.

(.venv) C:\Users\CarlosGuerrero\Desktop\SRE\Cloud_ops0038001_sre_chaos>chaos report --export-format=html5 journal.json report.html
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CarlosGuerrero\Desktop\SRE\Cloud_ops0038001_sre_chaos\.venv\Lib\site-packages\chaosreport\cli.py", line 36, in report
    reports.append(generate_report(journal, export_format))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CarlosGuerrero\Desktop\SRE\Cloud_ops0038001_sre_chaos\.venv\Lib\site-packages\chaosreport\__init__.py", line 270, in generate_report
    template = get_report_template(journal["chaoslib-version"])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CarlosGuerrero\Desktop\SRE\Cloud_ops0038001_sre_chaos\.venv\Lib\site-packages\chaosreport\__init__.py", line 368, in get_report_template
    "<={v}".format(v=semver.format_version(**vinfo._asdict())),
                                             ^^^^^^^^^^^^^
AttributeError: 'Version' object has no attribute '_asdict'

Runtime versions

Python 3.11.1

NAME    VERSION
CLI         1.15.1
Core library        1.33.1

chaostoolkit-aws                        0.21.2    Apache License Version 2.0    AWS
chaostoolkit-kubernetes                 0.26.3    Apache License Version 2.0    Kubernetes
chaostoolkit-reporting                  0.14.2    Apache License Version 2.0    Chaos engineering toolkit reporting library

To Reproduce
Steps to reproduce the behavior.

  1. After defining the AWS Credentials, execute the experiment.json template using chaos run --rollback-strategy=always experiment.json
{
    "version": "1.0.0",
    "title": "verify s3 existence",
    "description": "Verifying the existence of an s3 bucket",
    "configuration": {
        "aws_region": "us-east-1"
    },
    "steady-state-hypothesis": {
        "title": "s3 existence",
        "probes": [
            {
                "name": "bucket-exists",
                "type": "probe",
                "tolerance": true,
                "provider": {
                  "type": "python",
                  "module": "chaosaws.s3.probes",
                  "func": "bucket_exists",
                  "arguments": {
                    "bucket_name": "pruebasdesre"
                  }
                }
              }
        ]
    },
    "method": [],
    "rollbacks": []
}
  1. After that, execute the reporting command chaos report --export-format=html5 journal.json report.html

Expected behavior
I expect to the command to create a report in html format containing the results of the chaos execution (information about the probe method in this case).

Additional context
Nothing else to add

Hello @guerrerojc8862. Sorry, I'm noticing this one only now. I'll be looking into it end of the week. Ping me otherwise.

This has been fixed in chaostoolkit-reporting 0.14.3