google-nomulus/javatests/google/registry/flows/BUILD
nickfelt a4091594d0 Add new JSON logging to FlowRunner for EPP activity reporting
We've been using the very fragile newline-delimited legacy logging
statement in FlowRunner for ICANN reporting for a long time.  While
this is bad in a few ways, the worst is that the parsing of this
logging statement is extremely fragile (e.g. adding/removing fields
can easily break the parsing).  This is in fact part of what broke the
ExportLogsServlet parsing last fall ([] and forced us to
recover by manually parsing the log statement (and its XML) in
BigQuery.  It also broke again in [] where we were relying
on matching the logging classname, since matching on 'EPP Command'
was considered insufficiently narrow.

This introduces a new JSON-format logging statement to FlowRunner
that fixes both of these problems:

 1) it replaces the newline-delimited "format" with a JSON-based
    format, so that we can add new fields much more easily and
    reliably support logging more structured data

 2) it replaces the short 'EPP Command' signature with a much more
    targeted 'EPP-REPORTING-LOG-SIGNATURE' signature so that we can
    use that alone for matching, rather than relying on the class
    name in the log message

What this doesn't fix is the fact that we still need to parse the
XML in BigQuery; we should fix this by logging the parts of the XML
that ICANN reporting needs explicitly, but that'll be a subsequent
change, since while the existing approach is gross, it's actually
much less fragile than just matching the log statement itself.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125902976
2016-06-27 16:45:55 -04:00

79 lines
2.5 KiB
Text

package(
default_testonly = 1,
default_visibility = ["//java/google/registry:registry_project"],
)
licenses(["notice"]) # Apache 2.0
load("//java/com/google/testing/builddefs:GenTestRules.bzl", "GenTestRules")
# Needed for the documentation tests
filegroup(
name = "flows_files",
srcs = glob([
"*.java",
"**/*.java",
]),
)
java_library(
name = "flows",
srcs = glob([
"*.java",
"**/*.java",
]),
resources = glob(["**/testdata/*.xml"]),
deps = [
"//java/com/google/common/base",
"//java/com/google/common/collect",
"//java/com/google/common/io",
"//java/com/google/common/net",
"//java/com/google/common/testing",
"//third_party/java/appengine:appengine-api-testonly",
"//third_party/java/appengine:appengine-testing",
"//third_party/java/dagger",
"//third_party/java/joda_money",
"//third_party/java/joda_time",
"//third_party/java/json_simple",
"//third_party/java/jsr305_annotations",
"//third_party/java/junit",
"//third_party/java/mockito",
"//third_party/java/objectify:objectify-v4_1",
"//third_party/java/re2j",
"//third_party/java/servlet/servlet_api",
"//third_party/java/truth",
"//java/google/registry/config",
"//java/google/registry/dns",
"//java/google/registry/flows",
"//java/google/registry/mapreduce",
"//java/google/registry/model",
"//java/google/registry/monitoring/whitebox",
"//java/google/registry/pricing",
"//java/google/registry/request",
"//java/google/registry/tmch",
"//java/google/registry/util",
"//java/google/registry/xml",
"//javatests/google/registry/model",
"//javatests/google/registry/testing",
"//javatests/google/registry/testing/mapreduce",
"//javatests/google/registry/xml",
],
)
# If the flows tests should grow again to the point that they last longer than
# sixty seconds, then shard_count should be tuned. You can binary search for a
# good value that balances time reduction with environmental impact. However,
# any unit test that contains fewer @Test methods than the shard count will
# If you grep for testNothing you can find the existing dummy methods.
GenTestRules(
name = "GeneratedTestRules",
default_test_size = "medium",
jvm_flags = ["-XX:MaxPermSize=256m"],
shard_count = 4,
test_files = glob([
"*Test.java",
"*/*Test.java",
]),
deps = [":flows"],
)