Closed Bug 1249156 Opened 9 years ago Closed 9 years ago

Write unit tests for ClientID.jsm's getClientID method

Categories

(Toolkit :: Telemetry, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mcomella, Unassigned)

References

Details

In bug 1244295, we duplicate ClientID.jsm's getClientID method on Android in order to access the functionality before Gecko is running – we do this by reading the file directly off disk. We added some tests for the client ID java code (see GeckoProfile.getClientId & TestGeckoProfile) in bug 1244295 to help prevent regressions. However, we should also write tests on the gecko side to further prevent regressions. In particular, we should ensure the method writes and reads to the file in the expected format, to ensure it doesn't change under Java: { "clientID": "<client-ID>" ... }
Blocks: core-ping
No longer blocks: ut-android
The regression warning was added in bug 1244295.
Summary: Write tests & comment file format for ClientID.jsm's getClientID method → Write tests for ClientID.jsm's getClientID method
While unit tests are ideal here, it will take a lot of time for me to 1) set up a desktop build to run the tests and 2) learn how to write tests for Gecko so I don't think it's worthwhile, given we have Java <-> JS client ID integration tests from bug 1249491. Georg, do you agree? How necessary do you think this is?
Flags: needinfo?(gfritzsche)
Summary: Write tests for ClientID.jsm's getClientID method → Writeunit tests for ClientID.jsm's getClientID method
Summary: Writeunit tests for ClientID.jsm's getClientID method → Write unit tests for ClientID.jsm's getClientID method
(In reply to Michael Comella (:mcomella) from comment #2) > While unit tests are ideal here, it will take a lot of time for me to 1) set > up a desktop build to run the tests and 2) learn how to write tests for > Gecko so I don't think it's worthwhile, given we have Java <-> JS client ID > integration tests from bug 1249491. > > Georg, do you agree? How necessary do you think this is? Do the test from bug 1249491 cover the "JS writes client id to disk, Java loads it successfully" scenario too? It seems that is the only part left to worry about here.
Flags: needinfo?(gfritzsche)
(In reply to Georg Fritzsche [:gfritzsche] from comment #3) > Do the test from bug 1249491 cover the "JS writes client id to disk, Java > loads it successfully" scenario too? > It seems that is the only part left to worry about here. Yep! https://dxr.mozilla.org/mozilla-central/rev/c4449eab07d39e20ea315603f1b1863eeed7dcfe/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testUnifiedTelemetryClientId.java#96
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.