diff --git a/e2e/binary/false/BUILD.bazel b/e2e/binary/false/BUILD.bazel index 8301ea9d44d03c5abce2626b8b290971c6f7984f..9363703997a9c351491906544c43a1ad4dbf980c 100644 --- a/e2e/binary/false/BUILD.bazel +++ b/e2e/binary/false/BUILD.bazel @@ -1,11 +1,30 @@ -load("@bazel_skylib//rules:build_test.bzl", "build_test") +load("@bazel_skylib//rules:native_binary.bzl", "native_test") +load("@rules_python_pytest//python_pytest:defs.bzl", "py_pytest_test") -# TODO: write an _actual_ test for `false` +py_pytest_test( + name = "pytest", + size = "small", + srcs = ["false.py"], + data = [ + "@ape//ape:false", + ], + deps = [ + "//binary:pytest", + ], +) -build_test( - name = "false", +native_test( + name = "native", size = "small", - tags = ["stub"], - targets = ["@ape//ape:false"], + src = "@ape//ape:false", + args = ["hello"], +) + +test_suite( + name = "false" + tests = [ + "native", + "pytest", + ], visibility = ["//:__subpackages__"], ) diff --git a/e2e/binary/false/false.py b/e2e/binary/false/false.py new file mode 100644 index 0000000000000000000000000000000000000000..45ff0b5157cc12477fd4a0ab49d7025576209e5c --- /dev/null +++ b/e2e/binary/false/false.py @@ -0,0 +1,13 @@ +from __future__ import annotations + +from subprocess import run, CalledProcessError +import pytest + +from binary.tool import Tool + +def test_false(tool:Tool) -> None: + binary = tool("false") + + cmd = (binary, 'hello', '=', 'goodbye') + with pytest.raises(CalledProcessError): + run(cmd, check=True, timeout=30)