Example #1
0
    def test_single_schema(self, main, config):
        schema = main.generate_schema(config)["main"][0].schema

        assert "environment" in schema["properties"]
        assert "payload" in schema["properties"]
        assert _get(schema, prepend_properties(("environment", "settings", "userPrefs"))) \
            == {"type": "object", "additionalProperties": {"type": "string"}}
        assert _get(schema, prepend_properties(("environment", "system", "os", "version"))) \
            == {"type": "string"}
        assert "extension" in \
            _get(schema, prepend_properties(("payload", "processes")))["properties"]
Example #2
0
    def test_single_schema(self, main, config):
        schema = main.generate_schema(config)["main"][0].schema

        assert "environment" in schema["properties"]
        assert "payload" in schema["properties"]
        assert _get(schema, prepend_properties(("environment", "settings", "userPrefs"))) \
            == {
            "type": "object",
            "description": "User preferences - limited to an allowlist defined in `toolkit/components/telemetry/app/TelemetryEnvironment.jsm`",  # NOQA
            "additionalProperties": {"type": "string"},
        }
        assert "extension" in \
            _get(schema, prepend_properties(("payload", "processes")))["properties"]
Example #3
0
    def test_single_schema(self, glean, config):
        schemas = glean.generate_schema(config, split=False)

        assert schemas.keys() == {"baseline", "events", "metrics"}

        final_schemas = {k: schemas[k][0].schema for k in schemas}
        for name, schema in final_schemas.items():
            # A few parts of the generic structure
            assert "metrics" in schema["properties"]
            assert "ping_info" in schema["properties"]

            # Client id should not be included, since it's in the ping_info
            uuids = _get(schema, prepend_properties(("metrics", "uuid")))
            assert "client_id" not in uuids.get("properties", {})

            if name == "baseline":
                # Device should be included, since it's a standard metric
                strings = _get(schema, prepend_properties(("metrics", "string")))
                assert "glean.baseline.locale" in strings["properties"]
Example #4
0
    def test_single_schema(self, glean, config):
        schemas = glean.generate_schema(config, split=False)

        assert schemas.keys() == {"baseline", "events", "metrics"}

        final_schemas = {k: schemas[k][0].schema for k in schemas}
        for name, schema in final_schemas.items():
            # A few parts of the generic structure
            assert "ping_info" in schema["properties"]
            assert "client_info" in schema["properties"]

            labeled_counters = _get(
                schema, prepend_properties(("metrics", "labeled_counter")))
            assert "glean.error.invalid_label" in labeled_counters[
                'properties']

            if name == "baseline":
                # Device should be included, since it's a standard metric
                strings = _get(schema, prepend_properties(
                    ("metrics", "string")))
                assert "glean.baseline.locale" in strings["properties"]