Closed Bug 1251643 Opened 6 years ago Closed 6 years ago
Investigate validating "core" pings against schemas in tests
We are adding a "core" ping schema in bug 1249925. We should see whether we can add validation against this in existing or new tests. This helps us testing the client implementation and keeping the schema up to date.
Michael, do you know if we have existing tests for the "core" pings that we could add ping validation to?
(In reply to Georg Fritzsche [:gfritzsche] from comment #1) > Michael, do you know if we have existing tests for the "core" pings that we > could add ping validation to? There are no existing tests for the "core" pings. fwiw, my current implementation thoughts for bug 1243585 are to rework the TelemetryPingGenerator into the "Builder" pattern, which would throw if the core ping is constructed without necessary fields. We could write a test against this builder object to provide validation for the schema on the client side. As such, it may be pertinent to wait for bug 1243585 to land before we invest in writing a schema validation test on the client.
Thanks, that sounds good.
Depends on: 1243585
Actually, the builder landed in bug 1247489 and does validation against the required fields . We then have tests to make sure the mandatory fields functionality is correct.  Georg, do you see other opportunities for testing? This seems adequate to me. : https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/telemetry/pings/TelemetryCorePingBuilder.java#74 : https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/telemetry/pings/TelemetryPingBuilder.java#53 : https://mxr.mozilla.org/mozilla-central/source/mobile/android/tests/background/junit4/src/org/mozilla/gecko/telemetry/pings/TestTelemetryPingBuilder.java#19
I think the schema integration would be great to ensure that the client conforms to the schema and that we update the schema regularly (we currently don't since i pushed the first schema). Would it be hard to integrate this? If not this would probably be really useful, especially longer-term once we are integrating validation better in the data pipeline.
(In reply to Georg Fritzsche [:gfritzsche] from comment #5) > I think the schema integration would be great to ensure that the client > conforms to the schema and that we update the schema regularly (we currently > don't since i pushed the first schema). > > Would it be hard to integrate this? Actually, I don't understand what we're looking for here – from "ensure... that we update the schema regularly", do you mean we should check the json output and make sure it contains all of the required fields, possibly optional fields, and nothing else? That way when we add a field and run the test on the client, it will contain the new field and break the test if the schema version is not updated?
6 years ago
Assignee: nobody → michael.l.comella
The schema versioning situation is a bit undefined on the pipeline side right now. I'll see that i get the current schema updated, but this bug doesn't seem too useful right now. Let's close this for now and revisit later when its needed.
6 years ago
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.