https://pantsbuild.org/ logo
#general
Title
# general
b

brief-engineer-67497

07/16/2019, 8:19 AM
Hi is there a way to have a resource prepared before some targets and clean up afterwards ? the use case is our integration tests. Before each suite we start progammatically a docker and stop it afterwards. It take ages. A quick win would be to use one docker for all suite. However we would like to have it drove by pants. I can see how to do a start before all : have a task inheriting from junit_test requiring an artifact provided by the task that start the docker. but how to stop it at the end ? we cannot use the same trick because if tests fails, the docker won't be stopped …
p

purple-oil-45048

07/17/2019, 4:28 AM
Interesting you mention this .. I’ve been wanting to raise this for a while. There is a
prep_command
that allows you to setup things before other targets. https://www.pantsbuild.org/build_dictionary.html actually mentions about integration tests. At my work I have implemented a
post_command
and recently a coworker mentioned why not contributing it back. I was wondering if there was any interest in this?
b

brief-engineer-67497

07/17/2019, 11:28 AM
well sure there is interest here !
is it publicly available ?
p

purple-oil-45048

07/17/2019, 2:20 PM
Not yet 😅 I will create an issue tomorrow with some more details .. then follow up with the code later
b

brief-engineer-67497

07/17/2019, 2:23 PM
great !
thank you very much
p

purple-oil-45048

07/18/2019, 9:02 AM
5 Views