grafana / chaostoolkit-k6

https://chaostoolkit.org/drivers/k6
Apache License 2.0
13 stars 12 forks source link

enhancement: better messaging for K6 not installed #6

Open askalik opened 2 years ago

askalik commented 2 years ago

Improve the message for when the k6 binary isn't found in the PATH, used try, except to handle exception.

I think this should resolve issue #4

Lawouach commented 2 years ago

Thanks @askalik

I think this time I prefer asking permission than forgiveness. So I would have added the following snippet here:

    path = shutil.which('k6')
    if not path:
        raise ActivityFailed("the 'k6' binary cannot be found")

It uses this module. Then use the path variable in the subprocess call to use the absolute path of the k6 binary.

CLAassistant commented 2 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.