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

purple-plastic-57801

03/20/2023, 1:07 AM
I almost certainly missed it, but how does one invoke pants on the commandline? That is to say
Copy code
pants test ::
What does
::
represent?
w

wide-midnight-78598

03/20/2023, 1:12 AM
That quote may not be precise, as it's more like, run test on all test-able targets, I guess....
As an example of running on a specific target, this is how I test my REST api
./pants test apigateway:tests
p

purple-plastic-57801

03/20/2023, 1:17 AM
I see. So it is kind of like
Copy code
pants test src/root/some/path/in/root/:target
?
e

enough-analyst-54434

03/20/2023, 1:19 AM
Yes.
*
->
:
, and
**
->
::
p

purple-plastic-57801

03/20/2023, 1:19 AM
Pardon my ignorance... I don't exactly follow that. Any chance you could explain that?
e

enough-analyst-54434

03/20/2023, 1:19 AM
Since
*
is taken by shells and
:
should feel natural
These are globs for target addresses
p

purple-plastic-57801

03/20/2023, 1:20 AM
should feel natural
It doesn't.
e

enough-analyst-54434

03/20/2023, 1:20 AM
a/b:c pick an address
p

purple-plastic-57801

03/20/2023, 1:20 AM
What is a shell equivalent with
*
?
e

enough-analyst-54434

03/20/2023, 1:20 AM
a/b: picks all addresses in that dir
a/b:: picks all addresses in that dir and descendants
The easiest way to see is using
pants list
That will list the target address verbatim if literal or else expand for globs.
p

purple-plastic-57801

03/20/2023, 1:23 AM
Oh! Okay.
Copy code
:: - Everything:ReallyEverything
foo: - ONLY thing in foo like no targets in sub-directories
foo:: - Every target in foo/ no limit of depth
Kind of similar to
*
in a gitignore format.
e

enough-analyst-54434

03/20/2023, 1:23 AM
Just like * and ** in most shells
p

purple-plastic-57801

03/20/2023, 1:24 AM
I see.
Thank you.
h

happy-kitchen-89482

03/20/2023, 11:29 AM
We can't use * because the shell would expand it, so we had to pick something shell-neutral, hence :
2 Views