Skip to content

Commit

Permalink
🍱 Add example regex for Java test DEPS.
Browse files Browse the repository at this point in the history
Java tests are split into unit and instrumentation tests, which will
require different dependencies. Previously these tests lived in
different directories, but with modularisation they will live alongside
each other.

It seems reasonable change the naming convention to *Test.java for
instrumentation tests and UnitTest.java for unit tests. This change
provides an example in the checkdeps README of specific_include_rules
with the correct regular expressions to provide different DEPS for
unit and instrumentation tests.

Change-Id: Ia3c49c3d82100a3c9404d5b663cc1a8998e8bb59
Bug: 1164866
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2648674
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Peter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#847523}
  • Loading branch information
Peter E Conn authored and Chromium LUCI CQ committed Jan 27, 2021
1 parent 686cdc2 commit 9db1d2e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions buildtools/checkdeps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ specific_include_rules = {
}
```

To add different dependencies for Java instrumentation and unit tests, the
following regular expressions may be useful:

```
specific_include_rules = {
'.*UnitTest\.java': [
# Rules for unit tests.
],
'.*(?<!Unit)Test\.java': [
# Rules for instrumentation tests.
],
}
```

You can optionally ignore the rules inherited from parent directories, similar
to "set noparent" in OWNERS files. For example, adding `noparent = True` in
//ash/components/DEPS will cause rules from //ash/DEPS to be ignored, thereby
Expand Down

0 comments on commit 9db1d2e

Please sign in to comment.