Skip to content

Commit

Permalink
Revert "[Bug 1898073] Change creationDate in telemetry.crash to date-…
Browse files Browse the repository at this point in the history
…time format (#816)"

This reverts commit a69d990.
  • Loading branch information
BenWu committed Jun 7, 2024
1 parent a69d990 commit 4720cad
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 452 deletions.
2 changes: 0 additions & 2 deletions requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
pytest
pytest-xdist
jsonschema
validator
rfc3339-validator # needed to validate date-time format with jsonschema
pyjnius
72 changes: 19 additions & 53 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,63 +1,29 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile requirements-dev.in
#
apipkg==1.5
# via execnet
attrs==20.2.0
# via
# jsonschema
# pytest
cython==0.29.21
# via pyjnius
execnet==1.7.1
# via pytest-xdist
iniconfig==1.0.1
# via pytest
apipkg==1.5 # via execnet
attrs==20.2.0 # via jsonschema, pytest
cython==0.29.21 # via pyjnius
execnet==1.7.1 # via pytest-xdist
importlib-metadata==2.0.0 # via jsonschema, pluggy, pytest
iniconfig==1.0.1 # via pytest
jsonschema==3.2.0
# via -r requirements-dev.in
more-itertools==8.5.0
# via pytest
packaging==20.4
# via pytest
pluggy==0.13.1
# via pytest
py==1.9.0
# via
# pytest
# pytest-forked
more-itertools==8.5.0 # via pytest
packaging==20.4 # via pytest
pluggy==0.13.1 # via pytest
py==1.9.0 # via pytest, pytest-forked
pyjnius==1.3.0.0
# via -r requirements-dev.in
pyparsing==2.4.7
# via packaging
pyrsistent==0.17.3
# via jsonschema
pytest==6.0.2
# via
# -r requirements-dev.in
# pytest-forked
# pytest-xdist
pytest-forked==1.3.0
# via pytest-xdist
pyparsing==2.4.7 # via packaging
pyrsistent==0.17.3 # via jsonschema
pytest-forked==1.3.0 # via pytest-xdist
pytest-xdist==2.1.0
# via -r requirements-dev.in
python-dateutil==2.9.0.post0
# via validator
rfc3339-validator==0.1.4
# via -r requirements-dev.in
six==1.15.0
# via
# jsonschema
# packaging
# pyjnius
# python-dateutil
# rfc3339-validator
toml==0.10.1
# via pytest
validator==0.7.1
# via -r requirements-dev.in
pytest==6.0.2
six==1.15.0 # via jsonschema, packaging, pyjnius
toml==0.10.1 # via pytest
zipp==3.2.0 # via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# setuptools
2 changes: 1 addition & 1 deletion schemas/telemetry/crash/crash.4.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"type": "string"
},
"creationDate": {
"format": "date-time",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$",
"type": "string"
},
"environment": {
Expand Down
4 changes: 0 additions & 4 deletions templates/include/telemetry/crashCreationDate.1.schema.json

This file was deleted.

2 changes: 1 addition & 1 deletion templates/telemetry/crash/crash.4.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"properties": {
@TELEMETRY_APPLICATION_1_JSON@,
@TELEMETRY_CLIENTID_1_JSON@,
@TELEMETRY_CRASHCREATIONDATE_1_JSON@,
@TELEMETRY_CREATIONDATE_1_JSON@,
@TELEMETRY_ENVIRONMENT_1_JSON@,
@TELEMETRY_ID_1_JSON@,
"payload": {
Expand Down
5 changes: 2 additions & 3 deletions tests/test_validation_python.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import pytest
from jsonschema import validate
from jsonschema._format import draft4_format_checker
from jsonschema.exceptions import ValidationError


def test_validation_pass_python(schemas, qualifier, passing_example):
assert qualifier in schemas, f"{qualifier} missing from schemas"
validate(passing_example, schemas[qualifier], format_checker=draft4_format_checker)
validate(passing_example, schemas[qualifier])
# TODO: raise all validation errors for debugging, using IValidator
# interface. This requires knowing the JSON Schema spec ahead of time, for
# example by ensuring $schema is set.
Expand All @@ -15,4 +14,4 @@ def test_validation_pass_python(schemas, qualifier, passing_example):
def test_validation_fail_python(schemas, qualifier, failing_example):
assert qualifier in schemas, f"{qualifier} missing from schemas"
with pytest.raises(ValidationError):
validate(failing_example, schemas[qualifier], format_checker=draft4_format_checker)
validate(failing_example, schemas[qualifier])
194 changes: 0 additions & 194 deletions validation/telemetry/crash.4.creationdatedatetime.fail.json

This file was deleted.

Loading

0 comments on commit 4720cad

Please sign in to comment.