Statsd test mapping
Makes a test mapping for statsd so that unit tests run on presubmit.
Changes to make the tests pass:
1. Require root. This is needed to write to disk, since the tests don't
run as statsd's uid
2. Remove AndroidTest.xml file in favor of the autogenerated one.
3. Remove a check in StatsService.test for getUidFromArgs. The test
checked a failure case where we passed a number bigger than INT32_MAX.
However, on a 32 bit device, strtol will return INT32_MAX when an
overflow happens, since it returns a 32 bit number on a 32 bit device.
4. Refactor a lot of e2e tests to sort dimensions, ensuring that the
dimensions are always in order, instead of relying on implicit ordering
of hashing, which can change.
5. Change a long to an int64 in TestActivationsPersistAcrossSystemServerRestart
Test: statsd_test
Bug: 129613474
Change-Id: I80dfa3bfd50ebe6d2c8c0c3ba201f3ad06b68910
diff --git a/cmds/statsd/Android.bp b/cmds/statsd/Android.bp
index 65061d0..b357904 100644
--- a/cmds/statsd/Android.bp
+++ b/cmds/statsd/Android.bp
@@ -301,6 +301,8 @@
"-Wno-unused-parameter",
],
+ require_root: true,
+
srcs: [
// atom_field_options.proto needs field_options.proto, but that is
// not included in libprotobuf-cpp-lite, so compile it here.
@@ -373,10 +375,6 @@
include_dirs: ["external/protobuf/src"],
},
- shared_libs: [
- "libprotobuf-cpp-lite",
- ],
-
}
//#############################