Hey peeps! Any thoughts on doing integration testi...
# general
f
Hey peeps! Any thoughts on doing integration testing with Pants? I need to spin up my applications and send them each an HTTP request as a smoke test. What I've come up with thus far is to just write this process as a python script, but maybe I should look into writing a plugin? Or does pants support this somehow already?
e
Did you see
runtime_package_dependencies
on
python_test(s)
targets in your research?: https://www.pantsbuild.org/docs/reference-python_test#coderuntime_package_dependenciescode That allows a test to, for example, depend on 1 or more production PEXes which it can execute (say via the
subprocess
module) and interact with.
f
Yeah, that works! Although I now have to make my apps be able to run on different ports since I can't run these concurrently with everyone listening on 8000. Thanks!
Will probably work much better if I do this by spawning Docker containers, but it seems like the above option will work with that as well. Thank you!
e
If you dig a bit further with the new
runtime_package_dependencies
keyword ... that would be good. Docker is covered.
And, yeah. If tests don't use port 0 + discovery of the ephemeral port, they are not great tests imo.