happy-kitchen-89482
03/22/2022, 9:25 PMNo applicable files or targets matched.
WARN log:
Today when you do things like ./pants test ::
or ./pants --changed-since=main --changed-dependees=transitive test
and no test files match, you get a WARN log along the lines of
17:18:14.39 [WARN] No applicable files or targets matched. The `test` goal works with these target types:
* go_package
* junit_test
* python_test
* scala_junit_test
* scalatest_test
* shunit2_test
However, you only specified targets with these target types:
* python_source
Please specify relevant files and/or targets. Run `./pants filter --target-type=go_package,junit_test,python_test,scala_junit_test,scalatest_test,shunit2_test ::` to find all applicable targets in your project, or run `./pants filter --target-type=go_package,junit_test,python_test,scala_junit_test,scalatest_test,shunit2_test :: | xargs ./pants filedeps` to find all applicable files.
I am currently wondering whether this warning is desirable.
• Arguments for it include that it may help catch cases where your Pants command did not match your intent.
• Arguments against it include that the empty set is not a special case, so if "run all tests that match this spec" ends up being fulfilled vacuously then so be it. This is particularly salient for --changed-*
or when generating command specs from other data.happy-kitchen-89482
03/22/2022, 9:25 PMhappy-kitchen-89482
03/22/2022, 9:28 PMenough-analyst-54434
03/22/2022, 9:28 PM./pants --change-since=upstream/main fmt lint check test
works, I have to 2>/dev/null
to avoid being nannied.bitter-ability-32190
03/22/2022, 9:30 PMenough-analyst-54434
03/22/2022, 9:30 PM--player-level={beginner,tradesman,aggro}
~paraphrasing.bitter-ability-32190
03/22/2022, 9:31 PMcurved-television-6568
03/22/2022, 9:41 PMbitter-ability-32190
03/22/2022, 10:01 PMbitter-ability-32190
03/22/2022, 10:02 PMbitter-ability-32190
03/24/2022, 4:10 PMcli.alias
to do the silencing so we can control when it gets silenced, but I can't seem to get it working:
[cli.alias]
ignore-no-targets-warning = '--ignore-warnings="No files or targets specified"'
...
joshuacannon@CEPHANDRIUS:~/work/techlabs$ ./pants --changed-since=master test ignore-no-targets-warning
Unknown goal: ignore-no-targets-warning
joshuacannon@CEPHANDRIUS:~/work/techlabs$ ./pants ignore-no-targets-warning --changed-since=master test
Unknown goal: ignore-no-targets-warning
joshuacannon@CEPHANDRIUS:~/work/techlabs$ ./pants --changed-since=master ignore-no-targets-warning test
Unknown goal: ignore-no-targets-warning
bitter-ability-32190
03/24/2022, 4:16 PM11:14:50.99 [WARN] No applicable files or targets matched. The `test` goal works with these target types
vs
11:15:27.02 [WARN] No files or targets specified. The `test` goal works with these target types:
bitter-ability-32190
03/24/2022, 4:17 PMbitter-ability-32190
03/24/2022, 4:40 PMfmt
happy-kitchen-89482
03/24/2022, 6:44 PMcurved-television-6568
03/25/2022, 9:44 AM.pants.rc
files in $HOME
or .
that trips up your configuration?
$ ./pants ignore-no-targets-warning test
$ ./pants test ignore-no-targets-warning
Unknown flag --ignore-warnings on test scope
Did you mean to use the global --ignore-warnings? Global options must come before any goals, or after any file/target arguments.
[...]
bitter-ability-32190
03/25/2022, 10:17 AM-ldebug
as wellcurved-television-6568
03/25/2022, 11:54 AM-ldebug
for me too…