예제 #1
0
    def test_bug_1737656_affected(self, config):
        glean = glean_ping.GleanPing({
            # This ping exists in the static list of affected pings.
            "name": "rally-debug",
            "in-source": True,
            "app_id": "rally-debug",
        })
        schemas = glean.generate_schema(config, split=False)

        final_schemas = {k: schemas[k][0].schema for k in schemas}
        for name, schema in final_schemas.items():
            # Only this static list of pings should have the incorrect schema for text
            if name not in [
                    "deletion-request",
                    "demographics",
                    "enrollment",
                    "study-enrollment",
                    "study-unenrollment",
                    "uninstall-deletion",
            ]:
                continue

            metrics_text = schema["properties"]["metrics"]["properties"][
                "text"]

            assert metrics_text is not None
            assert type(metrics_text.get("additionalProperties")) is dict
예제 #2
0
    def test_bug_1737656_unaffected(self, config):
        glean = glean_ping.GleanPing({
            # This ping does not exist in the static list of affected pings.
            "name": "glean-core",
            "in-source": True,
            "app_id": "org-mozilla-glean",
        })
        schemas = glean.generate_schema(config, split=False)

        final_schemas = {k: schemas[k][0].schema for k in schemas}
        for name, schema in final_schemas.items():
            metrics_text = schema["properties"]["metrics"]["properties"].get(
                "text")
            assert metrics_text is None
예제 #3
0
    def test_retention_days(self, config):
        glean = glean_ping.GleanPing({
            "name": "glean",
            "app_id": "org-mozilla-glean",
            "retention_days": 90
        })
        schemas = glean.generate_schema(config,
                                        split=False,
                                        generic_schema=True)

        final_schemas = {k: schemas[k][0].schema for k in schemas}
        for name, schema in final_schemas.items():
            assert (schema["mozPipelineMetadata"]["expiration_policy"]
                    ["delete_after_days"] == 90)
예제 #4
0
    def test_rally_metadata_format(self, config):
        glean = glean_ping.GleanPing({
            "name": "rally-debug",
            "in-source": True,
            "app_id": "rally-debug",
            "encryption": {
                "use_jwk": True
            },
        })
        schemas = glean.generate_schema(config,
                                        split=False,
                                        generic_schema=True)

        final_schemas = {k: schemas[k][0].schema for k in schemas}
        for name, schema in final_schemas.items():
            metadata_format = schema["mozPipelineMetadata"][
                "bq_metadata_format"]
            assert metadata_format == "pioneer"
예제 #5
0
    def test_applying_metadata(self, config):
        glean = glean_ping.GleanPing({
            "name": "rally-debug",
            "app_id": "rally-debug",
        })
        schemas = glean.generate_schema(config,
                                        split=False,
                                        generic_schema=True)

        final_schemas = {k: schemas[k][0].schema for k in schemas}
        for name, schema in final_schemas.items():
            print(name)
            assert schema["mozPipelineMetadata"][
                "bq_dataset_family"] == "rally_debug"
            assert schema["mozPipelineMetadata"][
                "bq_metadata_format"] == "pioneer"
            assert (schema["mozPipelineMetadata"]["expiration_policy"]
                    ["delete_after_days"] == 180)
            assert (schema["mozPipelineMetadata"]["jwe_mappings"][0]
                    ["decrypted_field_path"] == "")
            assert (schema["mozPipelineMetadata"]["jwe_mappings"][0]
                    ["source_field_path"] == "/payload")
예제 #6
0
def glean():
    return glean_ping.GleanPing({
        "name": "glean-core",
        "app_id": "org-mozilla-glean"
    })
예제 #7
0
def glean():
    return glean_ping.GleanPing("glean")
예제 #8
0
def glean():
    return glean_ping.GleanPing("glean", "org-mozilla-glean")