Hello, I would appreciate your help. I am somewha...
# general
t
Hello, I would appreciate your help. I am somewhat of a beginner in Pants. I am using pants 2.16 and have read the manual. I want to run a python_test() - target. This target depends on another python module (lets call it “abc_service.py”) running. This python module is defined in the same project. I thought to use this setup in my BUILD: 1. define python module in a
python_source(name="abc_module",source="/path/to/abc_service.py")
- target 2. create a pex binary using
pex_binary(name="abc",dependencies=":abc_module")
3. run the binary using
shell_command(name="run_abc",command="pants run project:abc",tools=["pants"])
However, this gives the following error:
192536.03 [INFO] Completed: Running the
shell_command
at
project:run_abc
192536.04 [ERROR] 1 Exception encountered:
Engine traceback:
in
test
goal
ProcessExecutionFailure: Process ‘the
shell_command
at `project:run_abc`’ failed with exit code 1.
stdout:
Would you like to configure /tmp/pants-sandbox-CZRboR/pants as a Pants project? (Y/n):
stderr:
No Pants configuration was found at or above /tmp/pants-sandbox-CZRboR/project.
Thanks. 👋
👋 3
e
Is there any reason you don't want the test to spin up the service in a fixture? This would de-couple the test working from the build system it is run in. I like to do this in general whenever possible regardless of the language in question.
t
Thank you. I am fine with the test spinning up the service in a fixture. I will have a go at that.