chaostoolkit / chaostoolkit-lib

The Chaos Toolkit core library
https://chaostoolkit.org/
Apache License 2.0
77 stars 46 forks source link

Allow configuration substitution on jsonpath expect #267

Closed silvan02 closed 1 year ago

silvan02 commented 1 year ago

Is your feature request related to a problem? Please describe.

configuration:
  env:
    type: env
    key: ENV
    default: dev

steady-state-hypothesis:
  title: Check DNS Domains
  probes:
    - type: probe
      name: get-dns-cname
      provider:
        type: python
        module: chaosaws.route53.probes
        func: get_dns_answer
        arguments:
          zone_id: XXXX
          record_type: CNAME
          record_name: api.${env}.mysite.com
      tolerance:
        type: jsonpath
        path: $.RecordData[0]
        expect: my-other-cname.${env}.mysite.com

I need a test where the expected result could be configurable by a configuration as the example above.

Describe the solution you'd like Allow to replace configurations on jsonpath expect as it was done for path on the release below https://github.com/chaostoolkit/chaostoolkit-lib/compare/1.6.0...1.7.0

Describe alternatives you've considered Cannot think on any alternative

Additional context N/A

Lawouach commented 1 year ago

That sounds like a good idea.

I'll move this issue to the chaostoolkit-lib` repo.

Lawouach commented 1 year ago

Available in 1.38.0