gorgeous-winter-99296
03/16/2023, 9:12 AMrun_pants
to add some tests for some of my plugins to start squashing bugs (thanks @bitter-ability-32190 for the push!). However; when I use it in my package repo I hit the following:
pants.base.build_root.BuildRoot.NotFoundError: No build root detected. Pants detects the build root by looking for at least one file from ['pants', 'BUILDROOT', 'BUILD_ROOT'] in the cwd and its ancestors. If you have none of these files, you can create an empty file in your build root.
The full code is here; but what I've got is pretty much:
def test_run_oci_container() -> None:
build_inputs = {
"BUILD_ROOT": "",
"oci/BUILD": dedent(...),
"oci/example.py": dedent(...),
}
with setup_tmpdir(build_inputs) as tmpdir:
result = run_pants(
[
"--backend-packages=pants_backend_oci",
"run",
f"{tmpdir}/oci:oci",
]
)
assert result.stdout == "Hello world!\n"
assert result.exit_code == 0
The BUILD_ROOT I've added to see if it's required but no dice. Currently testing on 2.14.enough-analyst-54434
03/16/2023, 9:22 AMenough-analyst-54434
03/16/2023, 9:24 AMgorgeous-winter-99296
03/16/2023, 9:40 AMgorgeous-winter-99296
03/16/2023, 9:44 AMenough-analyst-54434
03/16/2023, 10:12 AMenough-analyst-54434
03/16/2023, 10:12 AMgorgeous-winter-99296
03/16/2023, 10:30 AM//BUILD_ROOT:files
target in my python_test.