diff --git a/e2e/binary/zsh/BUILD.bazel b/e2e/binary/zsh/BUILD.bazel index 8616cbc11afbf62bb84a246d7307f7dbb2d24eba..b39676ab4c3cf84f36cda17b36b634d0782c21e6 100644 --- a/e2e/binary/zsh/BUILD.bazel +++ b/e2e/binary/zsh/BUILD.bazel @@ -1,11 +1,30 @@ -load("@bazel_skylib//rules:build_test.bzl", "build_test") +load("@rules_python_pytest//python_pytest:defs.bzl", "py_pytest_test") +load("@bazel_skylib//rules:native_binary.bzl", "native_test") -# TODO: write an _actual_ test for `zsh` +py_pytest_test( + name = "pytest", + size = "small", + srcs = ["print.py"], + data = [ + "@ape//ape:zsh", + ], + deps = [ + "//binary:pytest", + ], +) -build_test( - name = "zsh", +native_test( + name = "version", size = "small", - tags = ["stub"], - targets = ["@ape//ape:zsh"], + src = "@ape//ape:zsh", + args = ["--version"], +) + +test_suite( + name = "zsh", + tests = [ + "pytest", + "version", + ], visibility = ["//:__subpackages__"], ) diff --git a/e2e/binary/zsh/print.py b/e2e/binary/zsh/print.py new file mode 100644 index 0000000000000000000000000000000000000000..7b417c1ba588b1f01fab18b6772fa16cb2a7b2e6 --- /dev/null +++ b/e2e/binary/zsh/print.py @@ -0,0 +1,12 @@ +from __future__ import annotations +from subprocess import run + +from binary import Tool + + +def test_echo(tool: Tool) -> None: + binary = tool("zsh") + + cmd = [binary, "-c", "echo hello"] + result = run(cmd, check=True, timeout=30, capture_output=True, text=True) + assert "hello\n" == result.stdout