Skip to content

Commit

Permalink
test that navigationTiming marks are the only ones impacted
Browse files Browse the repository at this point in the history
  • Loading branch information
graphaelli committed Jun 15, 2018
1 parent a4a1ebe commit c5c2bf8
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/data/elasticsearch/transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@
},
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"marks": {
"another_mark": {
"some_float": 10,
"some_long": 10
},
"navigationTiming": {
"appBeforeBootstrap": 608.930000,
"navigationStart": -21
Expand Down
4 changes: 4 additions & 0 deletions docs/data/intake-api/generated/transaction/payload.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@
"navigationStart": -21

},
"another_mark": {
"some_long": 10,
"some_float": 10.0
},
"performance": {}
}
},
Expand Down
2 changes: 1 addition & 1 deletion include/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@
},
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"marks": {
"another_mark": {
"some_float": 10,
"some_long": 10
},
"navigationTiming": {
"appBeforeBootstrap": 608.93,
"navigationStart": -21
Expand Down
4 changes: 4 additions & 0 deletions tests/data/valid/transaction/payload.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@
"navigationStart": -21

},
"another_mark": {
"some_long": 10,
"some_float": 10.0
},
"performance": {}
}
},
Expand Down
17 changes: 17 additions & 0 deletions tests/system/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@ def test_load_docs_with_template_and_add_transaction(self):

self.check_backend_transaction_sourcemap(count=5)

@unittest.skipUnless(INTEGRATION_TESTS, "integration test")
def test_mark_navigation_timing(self):
self.load_docs_with_template(self.get_transaction_payload_path(), self.transactions_url, 'transaction', 9)
self.assert_no_logged_warnings()
mappings = self.es.indices.get_field_mapping(index=self.index_name, fields="transaction.marks.*")
found_other = False
for name, metric in mappings[self.index_name]["mappings"]["doc"].items():
for mapping in metric["mapping"].values():
mtype = mapping["type"]
if name.startswith("transaction.marks.navigationTiming."):
assert mtype == "scaled_float", name + " mapped as " + mtype + ", not scaled_float"
else:
# only navigation timing marks are scaled floats for now
assert mtype != "scaled_float", name + " mapped as scaled_float"
found_other = True
assert found_other, "no non-scaled_float marks found"

@unittest.skipUnless(INTEGRATION_TESTS, "integration test")
def test_load_docs_with_template_and_add_error(self):
"""
Expand Down

0 comments on commit c5c2bf8

Please sign in to comment.