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

fix: runCommand returns non-zero exit code for non-existing exes #256

Merged
merged 2 commits into from
Mar 27, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
installed. Previously, any chalk sub-scan such as
during `chalk exec` had misleading error logs.
[#248](https://github.com/crashappsec/chalk/pull/248)
- `chalk docker ...` did not exit with non-zero exit code
when `docker` is not installed.
[#256](https://github.com/crashappsec/chalk/pull/256)
- Fixed parsing CLI params when wrapping `docker`
(rename `chalk` exe to `docker`) and a docker command
had a "docker" param.
Expand Down
2 changes: 1 addition & 1 deletion chalk.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bin = @["chalk"]

# Dependencies
requires "nim >= 2.0.0"
requires "https://github.com/crashappsec/con4m#23309b7c4ad492576509b84f6969a1a43c862057"
requires "https://github.com/crashappsec/con4m#973bb0a8bfc0745a30f6f6285a9fd81e6196b647"
requires "https://github.com/viega/zippy == 0.10.7" # MIT

# this allows us to get version externally
Expand Down
11 changes: 11 additions & 0 deletions tests/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ def run_container(*args, **kwargs):
Docker.remove_images(list(images))


def test_no_docker(chalk: Chalk):
_, build = chalk.docker_build(
context=DOCKERFILES / "valid" / "sample_1",
env={"PATH": ""},
expected_success=False,
# dont run sanity docker subcommand
run_docker=False,
)
assert build.exit_code > 0


@pytest.mark.parametrize("buildkit", [True, False])
@pytest.mark.parametrize(
"cwd, dockerfile, tag",
Expand Down