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

Configuration files require the main experiment file to have the keys from the configurations. #203

Closed
WixoLeo opened this issue Jan 10, 2021 · 4 comments · May be fixed by chaostoolkit/chaostoolkit-lib#229
Labels

Comments

@WixoLeo
Copy link

WixoLeo commented Jan 10, 2021

Fantastic day!

There is a little issue with the configurations.

For example I have this experiment.json

{
  "version": "1.0.0",
  "title": "test",
  "description": "test",
  "configuration": {
    "myarg": "exp.json",
    "another_arg": "" // Must be included to work
  },
  "tags": [
    "network",
    "lala"
  ],
  "steady-state-hypothesis": {
    "title": "Check something",
    "probes": [
      {
        "name": "My probe",
        "description": "My best probe",
        "tolerance": {
          "type": "regex",
          "pattern": "exp.json",
          "target": "stdout"
        },
        "type": "probe",
        "provider": {
          "type": "process",
          "path": "echo",
          "arguments": "${myarg}"
        }
      },
      {
        "name": "My probe",
        "description": "My best probe",
        "tolerance": {
          "type": "regex",
          "pattern": "another.json",
          "target": "stdout"
        },
        "type": "probe",
        "provider": {
          "type": "process",
          "path": "echo",
          "arguments": "${another_arg}"
        }
      }
    ]
  },
  "method": [],
  "rollbacks": []
}

And var-file:

{
  "configuration": {
    "another_arg": "another.json"
  }
}

Launching via chaos run exp.json --var-file config.json
So the experiment works right now, but when you have a big configuration, it's quite annoying have to place empty values to the config keys. Why not to just exclude them? So that if I provide "another_arg" from config.json, I don't have to place an empty one in the experiment.json.

Our suggestion: If none of the configurations contain such attribute, only then raise an error.

@Lawouach
Copy link
Contributor

Hey there,

I can the issue with large configuration indeed. I think the rationale was to ensure the experiment documents clearly its expectations. I need to check but it would be good if the ctk validation could say "hey you're using a var that was not never found neither in the inlined configuration section nor from a config var". So at least we get notified about this.

@WixoLeo
Copy link
Author

WixoLeo commented Jan 12, 2021

Hey there,

I can the issue with large configuration indeed. I think the rationale was to ensure the experiment documents clearly its expectations. I need to check but it would be good if the ctk validation could say "hey you're using a var that was not never found neither in the inlined configuration section nor from a config var". So at least we get notified about this.

Of course, that would be great!

@github-actions
Copy link

This Issue has not been active in 365 days. To re-activate this Issue, remove the Stale label or comment on it. If not re-activated, this Issue will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 16, 2022
@github-actions
Copy link

This Issue was closed because it was not reactivated after 7 days of being marked Stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants