Bug 1539240 - Slim down os data in environment of ping r=chutten

Differential Revision: https://phabricator.services.mozilla.com/D24957

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jan-Erik Rediger 2019-03-26 20:03:13 +00:00
parent d3b5c44b6b
commit ffd99e653e
2 changed files with 9 additions and 3 deletions

View File

@ -290,7 +290,11 @@ var EcosystemTelemetry = {
},
system: {
memoryMB: currentEnv.system.memoryMB,
os: currentEnv.system.os,
os: {
name: currentEnv.system.os.name,
version: currentEnv.system.os.version,
locale: currentEnv.system.os.locale,
},
cpu: {
speedMHz: currentEnv.system.cpu.speedMHz,
},

View File

@ -27,12 +27,14 @@ function checkPingStructure(ping, type, reason) {
// Check that the environment is indeed minimal
const ALLOWED_ENVIRONMENT_KEYS = ["settings", "system", "profile"];
Assert.deepEqual(ALLOWED_ENVIRONMENT_KEYS, Object.keys(environment), "Environment should only contain limited set of keys.");
Assert.deepEqual(ALLOWED_ENVIRONMENT_KEYS, Object.keys(environment), "Environment should only contain a limited set of keys.");
// Check that fields of the environment are indeed minimal
Assert.deepEqual(["locale"], Object.keys(environment.settings), "Settings environment should only contain locale");
Assert.deepEqual(["cpu", "memoryMB", "os"], Object.keys(environment.system).sort(),
"System environment should contain limit set of keys");
"System environment should contain a limited set of keys");
Assert.deepEqual(["locale", "name", "version"], Object.keys(environment.system.os).sort(),
"system.environment.os should contain a limited set of keys");
// Check the payload for required fields.
let payload = ping.payload;