Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@
- Optional default value for environment variable in configuration
- Warn the user for an action process returning a non-zero exit code
- Support for process path relative to homedir ~
- Indicate path in validation when path is not found nor executable [#159][159]

### Changed

- Changed the method's one-step minimum requirement.
An experiment with an empty method (without any activities) is now valid.

[159]: https://github.com/chaostoolkit/chaostoolkit-lib/issues/159

## [1.7.1][] - 2019-09-27

[1.7.1]: https://github.com/chaostoolkit/chaostoolkit-lib/compare/1.7.0...1.7.1
Expand Down
6 changes: 3 additions & 3 deletions chaoslib/provider/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ def validate_process_activity(activity: Activity):
name = activity["name"]
provider = activity["provider"]

path = provider.get("path")
path = raw_path = provider.get("path")
if not path:
raise InvalidActivity("a process activity must have a path")

path = shutil.which(path)
if not path:
raise InvalidActivity(
"path '{path}' cannot be found, in activity '{name}'".format(
path=path, name=name))
path=raw_path, name=name))

if not os.access(path, os.X_OK):
raise InvalidActivity(
"no access permission to '{path}', in activity '{name}'".format(
path=path, name=name))
path=raw_path, name=name))
2 changes: 1 addition & 1 deletion tests/test_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_process_probe_have_a_path():
def test_process_probe_path_must_exist():
with pytest.raises(InvalidActivity) as exc:
ensure_activity_is_valid(probes.ProcessPathDoesNotExistProbe)
assert "path 'None' cannot be found, in activity" in str(exc.value)
assert "path 'somewhere/not/here' cannot be found, in activity" in str(exc.value)


def test_http_probe_must_have_a_url():
Expand Down