Skip to content

Commit dbbf470

Browse files
authored
Merge pull request #160 from dmartin35/fix-issue-159
fix issue #159
2 parents 51bd292 + 5215834 commit dbbf470

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@
3838
- Optional default value for environment variable in configuration
3939
- Warn the user for an action process returning a non-zero exit code
4040
- Support for process path relative to homedir ~
41+
- Indicate path in validation when path is not found nor executable [#159][159]
4142

4243
### Changed
4344

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

48+
[159]: https://github.com/chaostoolkit/chaostoolkit-lib/issues/159
49+
4750
## [1.7.1][] - 2019-09-27
4851

4952
[1.7.1]: https://github.com/chaostoolkit/chaostoolkit-lib/compare/1.7.0...1.7.1

chaoslib/provider/process.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ def validate_process_activity(activity: Activity):
9494
name = activity["name"]
9595
provider = activity["provider"]
9696

97-
path = provider.get("path")
97+
path = raw_path = provider.get("path")
9898
if not path:
9999
raise InvalidActivity("a process activity must have a path")
100100

101101
path = shutil.which(path)
102102
if not path:
103103
raise InvalidActivity(
104104
"path '{path}' cannot be found, in activity '{name}'".format(
105-
path=path, name=name))
105+
path=raw_path, name=name))
106106

107107
if not os.access(path, os.X_OK):
108108
raise InvalidActivity(
109109
"no access permission to '{path}', in activity '{name}'".format(
110-
path=path, name=name))
110+
path=raw_path, name=name))

tests/test_probe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_process_probe_have_a_path():
7878
def test_process_probe_path_must_exist():
7979
with pytest.raises(InvalidActivity) as exc:
8080
ensure_activity_is_valid(probes.ProcessPathDoesNotExistProbe)
81-
assert "path 'None' cannot be found, in activity" in str(exc.value)
81+
assert "path 'somewhere/not/here' cannot be found, in activity" in str(exc.value)
8282

8383

8484
def test_http_probe_must_have_a_url():

0 commit comments

Comments
 (0)