Stealth extension #1029
test/test_[i-o,q-r,t-z]* ❌
❌ junit-report.xml
39 tests were completed in 80s with 24 passed, 15 failed and 0 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 24✅ | 15❌ | 80s |
❌ pytest
test.test_js_instrument.TestJSInstrumentNonExistingWindowProperty
❌ test_instrument_object
self = <test.test_js_instrument.TestJSInstrumentNonExistingWindowProperty object at 0x7fc9e298fa40>
test.test_js_instrument.TestJSInstrumentExistingWindowProperty
❌ test_instrument_object
self = <test.test_js_instrument.TestJSInstrumentExistingWindowProperty object at 0x7fc9e1e69970>
test.test_js_instrument.TestJSInstrumentByPython
❌ test_instrument_object
self = <test.test_js_instrument.TestJSInstrumentByPython object at 0x7fc9e1e69ca0>
test.test_js_instrument.TestJSInstrumentMockWindowProperty
❌ test_instrument_object
self = <test.test_js_instrument.TestJSInstrumentMockWindowProperty object at 0x7fc9e1e6ae10>
test.test_js_instrument.TestJSInstrument
❌ test_instrument_object
self = <test.test_js_instrument.TestJSInstrument object at 0x7fc9e1e6b2f0>
test.test_js_instrument.TestJSInstrumentRecursiveProperties
❌ test_instrument_object
self = <test.test_js_instrument.TestJSInstrumentRecursiveProperties object at 0x7fc9e1e6b5c0>
test.test_js_instrument_py
✅ test_validate_good
✅ test_validate_bad__log_settings_missing
✅ test_validate_bad__log_settings_invalid
✅ test_validate_bad__not_a_list
✅ test_validate_bad__missing_object
✅ test_validated_bad__missing_instrumentedName
❌ test_merge_and_validate_multiple_overlap_properties_to_instrument_properties_to_exclude
default_log_settings = {'depth': 5, 'excludedProperties': ['name'], 'logCallStack': False, 'logFunctionGets': False, ...}
✅ test_merge_and_validate_multiple_overlap_properties
✅ test_merge_when_log_settings_is_null
✅ test_merge_diff_instrumented_names
✅ test_merge_multiple_duped_properties
✅ test_merge_multiple_duped_properties_different_log_settings
✅ test_api_whole_module
✅ test_api_two_keys_in_shortcut
✅ test_api_instances_on_window
✅ test_api_instances_on_window_with_properties
✅ test_api_module_specific_properties
✅ test_api_passing_partial_log_settings
❌ test_api_collection_fingerprinting
def test_api_collection_fingerprinting():
✅ test_complete_pass
test.test_mp_logger
✅ test_multiprocess
✅ test_multiple_instances
✅ test_child_process_with_exception
✅ test_child_process_logging
test.test_task_manager
✅ test_failure_limit_value
❌ test_failure_limit_exceeded
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7fc9e0c6f060>
❌ test_failure_limit_reset
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7fc9e0c6e480>
❌ test_assertion_error_propagation[False-expectation0]
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7fc9e0c6f6a0>
❌ test_assertion_error_propagation[True-expectation1]
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7fc9e0c6d260>
test.test_timer
❌ test_command_duration
default_params = (ManagerParams(data_directory=PosixPath('/tmp/pytest-of-runner/pytest-0/test_command_duration0'), log_path=PosixPath('...'/tmp'), maximum_profile_size=None, recovery_tar=None, donottrack=False, tracking_protection=False, custom_params={})])
test.test_webdriver_utils
✅ test_parse_neterror
❌ test_parse_neterror_integration
default_params = (ManagerParams(data_directory=PosixPath('/tmp/pytest-of-runner/pytest-0/test_parse_neterror_integratio0'), log_path=Po...'/tmp'), maximum_profile_size=None, recovery_tar=None, donottrack=False, tracking_protection=False, custom_params={})])
test.test_xvfb_browser
❌ test_display_shutdown
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7fc9e0c6f920>
Annotations
Check failure on line 0 in junit-report.xml
github-actions / test/test_[i-o,q-r,t-z]*
pytest ► test.test_js_instrument.TestJSInstrumentNonExistingWindowProperty ► test_instrument_object
Failed test found in:
junit-report.xml
Error:
self = <test.test_js_instrument.TestJSInstrumentNonExistingWindowProperty object at 0x7fc9e298fa40>
Raw output
self = <test.test_js_instrument.TestJSInstrumentNonExistingWindowProperty object at 0x7fc9e298fa40>
def test_instrument_object(self):
"""Ensure instrumentObject logs all property gets, sets, and calls"""
> db = self.visit("/js_instrument/%s" % self.TEST_PAGE)
/home/runner/work/OpenWPM/OpenWPM/test/test_js_instrument.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/OpenWPM/OpenWPM/test/openwpmtest.py:42: in visit
manager = task_manager.TaskManager(
/home/runner/work/OpenWPM/OpenWPM/openwpm/task_manager.py:99: in __init__
cleaned_js_settings = clean_js_instrumentation_settings(js_settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:245: in clean_js_instrumentation_settings
_validate(settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:27: in _validate
jsonschema.validate(instance=python_list_to_validate, schema=schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instance = [{'instrumentedName': 'ScriptProcessorNode', 'logSettings': {'depth': 5, 'excludedProperties': [], 'logCallStack': Fal...erties': [], 'logCallStack': False, 'logFunctionGets': False, ...}, 'object': "window['AudioContext'].prototype"}, ...]
schema = {'$id': 'http://example.com/js-instrument-settings.schema', '$schema': 'http://json-schema.org/draft-07/schema#', 'des... 'type': 'string'}}, 'required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}
cls = <class 'jsonschema.validators.Draft7Validator'>, args = (), kwargs = {}
validator = Draft7Validator(schema={'$id': 'http://examp...ttings.schema', '$schema': 'http://json-...ft-07/schema#', 'description...required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}, format_checker=None)
error = <ValidationError: "'name' is not of type 'object'">
def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
"""
Validate an instance under the given schema.
>>> validate([2, 3, 4], {"maxItems": 2})
Traceback (most recent call last):
...
ValidationError: [2, 3, 4] is too long
:func:`~jsonschema.validators.validate` will first verify that the
provided schema is itself valid, since not doing so can lead to less
obvious error messages and fail in less obvious or consistent ways.
If you know you have a valid schema already, especially
if you intend to validate multiple instances with
the same schema, you likely would prefer using the
`jsonschema.protocols.Validator.validate` method directly on a
specific validator (e.g. ``Draft202012Validator.validate``).
Arguments:
instance:
The instance to validate
schema:
The schema to validate with
cls (jsonschema.protocols.Validator):
The class that will be used to validate the instance.
If the ``cls`` argument is not provided, two things will happen
in accordance with the specification. First, if the schema has a
:kw:`$schema` keyword containing a known meta-schema [#]_ then the
proper validator will be used. The specification recommends that
all schemas contain :kw:`$schema` properties for this reason. If no
:kw:`$schema` property is found, the default validator class is the
latest released draft.
Any other provided positional and keyword arguments will be passed
on when instantiating the ``cls``.
Raises:
`jsonschema.exceptions.ValidationError`:
if the instance is invalid
`jsonschema.exceptions.SchemaError`:
if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with
`jsonschema.validators.validates`
"""
if cls is None:
cls = validator_for(schema)
cls.check_schema(schema)
validator = cls(schema, *args, **kwargs)
error = exceptions.best_match(validator.iter_errors(instance))
if error is not None:
> raise error
E jsonschema.exceptions.ValidationError: 'name' is not of type 'object'
E
E Failed validating 'type' in schema['items']['properties']['logSettings']['properties']['propertiesToInstrument']['items']:
E {'properties': {'depth': {'type': 'integer'},
E 'propertyNames': {'items': {'type': 'string'},
E 'type': 'array'}},
E 'type': 'object'}
E
E On instance[11]['logSettings']['propertiesToInstrument'][0]:
E 'name'
/home/runner/mamba/envs/openwpm/lib/python3.12/site-packages/jsonschema/validators.py:1312: ValidationError
Check failure on line 0 in junit-report.xml
github-actions / test/test_[i-o,q-r,t-z]*
pytest ► test.test_js_instrument.TestJSInstrumentExistingWindowProperty ► test_instrument_object
Failed test found in:
junit-report.xml
Error:
self = <test.test_js_instrument.TestJSInstrumentExistingWindowProperty object at 0x7fc9e1e69970>
Raw output
self = <test.test_js_instrument.TestJSInstrumentExistingWindowProperty object at 0x7fc9e1e69970>
def test_instrument_object(self):
"""Ensure instrumentObject logs all property gets, sets, and calls"""
> db = self.visit("/js_instrument/%s" % self.TEST_PAGE)
/home/runner/work/OpenWPM/OpenWPM/test/test_js_instrument.py:77:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/OpenWPM/OpenWPM/test/openwpmtest.py:42: in visit
manager = task_manager.TaskManager(
/home/runner/work/OpenWPM/OpenWPM/openwpm/task_manager.py:99: in __init__
cleaned_js_settings = clean_js_instrumentation_settings(js_settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:245: in clean_js_instrumentation_settings
_validate(settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:27: in _validate
jsonschema.validate(instance=python_list_to_validate, schema=schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instance = [{'instrumentedName': 'ScriptProcessorNode', 'logSettings': {'depth': 5, 'excludedProperties': [], 'logCallStack': Fal...erties': [], 'logCallStack': False, 'logFunctionGets': False, ...}, 'object': "window['AudioContext'].prototype"}, ...]
schema = {'$id': 'http://example.com/js-instrument-settings.schema', '$schema': 'http://json-schema.org/draft-07/schema#', 'des... 'type': 'string'}}, 'required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}
cls = <class 'jsonschema.validators.Draft7Validator'>, args = (), kwargs = {}
validator = Draft7Validator(schema={'$id': 'http://examp...ttings.schema', '$schema': 'http://json-...ft-07/schema#', 'description...required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}, format_checker=None)
error = <ValidationError: "'name' is not of type 'object'">
def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
"""
Validate an instance under the given schema.
>>> validate([2, 3, 4], {"maxItems": 2})
Traceback (most recent call last):
...
ValidationError: [2, 3, 4] is too long
:func:`~jsonschema.validators.validate` will first verify that the
provided schema is itself valid, since not doing so can lead to less
obvious error messages and fail in less obvious or consistent ways.
If you know you have a valid schema already, especially
if you intend to validate multiple instances with
the same schema, you likely would prefer using the
`jsonschema.protocols.Validator.validate` method directly on a
specific validator (e.g. ``Draft202012Validator.validate``).
Arguments:
instance:
The instance to validate
schema:
The schema to validate with
cls (jsonschema.protocols.Validator):
The class that will be used to validate the instance.
If the ``cls`` argument is not provided, two things will happen
in accordance with the specification. First, if the schema has a
:kw:`$schema` keyword containing a known meta-schema [#]_ then the
proper validator will be used. The specification recommends that
all schemas contain :kw:`$schema` properties for this reason. If no
:kw:`$schema` property is found, the default validator class is the
latest released draft.
Any other provided positional and keyword arguments will be passed
on when instantiating the ``cls``.
Raises:
`jsonschema.exceptions.ValidationError`:
if the instance is invalid
`jsonschema.exceptions.SchemaError`:
if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with
`jsonschema.validators.validates`
"""
if cls is None:
cls = validator_for(schema)
cls.check_schema(schema)
validator = cls(schema, *args, **kwargs)
error = exceptions.best_match(validator.iter_errors(instance))
if error is not None:
> raise error
E jsonschema.exceptions.ValidationError: 'name' is not of type 'object'
E
E Failed validating 'type' in schema['items']['properties']['logSettings']['properties']['propertiesToInstrument']['items']:
E {'properties': {'depth': {'type': 'integer'},
E 'propertyNames': {'items': {'type': 'string'},
E 'type': 'array'}},
E 'type': 'object'}
E
E On instance[11]['logSettings']['propertiesToInstrument'][0]:
E 'name'
/home/runner/mamba/envs/openwpm/lib/python3.12/site-packages/jsonschema/validators.py:1312: ValidationError
Check failure on line 0 in junit-report.xml
github-actions / test/test_[i-o,q-r,t-z]*
pytest ► test.test_js_instrument.TestJSInstrumentByPython ► test_instrument_object
Failed test found in:
junit-report.xml
Error:
self = <test.test_js_instrument.TestJSInstrumentByPython object at 0x7fc9e1e69ca0>
Raw output
self = <test.test_js_instrument.TestJSInstrumentByPython object at 0x7fc9e1e69ca0>
def test_instrument_object(self):
"""Ensure instrumentObject logs all property gets, sets, and calls"""
> db = self.visit("/js_instrument/%s" % self.TEST_PAGE)
/home/runner/work/OpenWPM/OpenWPM/test/test_js_instrument.py:134:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/OpenWPM/OpenWPM/test/openwpmtest.py:42: in visit
manager = task_manager.TaskManager(
/home/runner/work/OpenWPM/OpenWPM/openwpm/task_manager.py:99: in __init__
cleaned_js_settings = clean_js_instrumentation_settings(js_settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:245: in clean_js_instrumentation_settings
_validate(settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:27: in _validate
jsonschema.validate(instance=python_list_to_validate, schema=schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instance = [{'instrumentedName': 'window.document', 'logSettings': {'depth': 5, 'excludedProperties': [], 'logCallStack': False, ...gs': {'depth': 5, 'excludedProperties': [], 'logCallStack': False, 'logFunctionGets': False, ...}, 'object': 'window'}]
schema = {'$id': 'http://example.com/js-instrument-settings.schema', '$schema': 'http://json-schema.org/draft-07/schema#', 'des... 'type': 'string'}}, 'required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}
cls = <class 'jsonschema.validators.Draft7Validator'>, args = (), kwargs = {}
validator = Draft7Validator(schema={'$id': 'http://examp...ttings.schema', '$schema': 'http://json-...ft-07/schema#', 'description...required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}, format_checker=None)
error = <ValidationError: "'cookie' is not of type 'object'">
def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
"""
Validate an instance under the given schema.
>>> validate([2, 3, 4], {"maxItems": 2})
Traceback (most recent call last):
...
ValidationError: [2, 3, 4] is too long
:func:`~jsonschema.validators.validate` will first verify that the
provided schema is itself valid, since not doing so can lead to less
obvious error messages and fail in less obvious or consistent ways.
If you know you have a valid schema already, especially
if you intend to validate multiple instances with
the same schema, you likely would prefer using the
`jsonschema.protocols.Validator.validate` method directly on a
specific validator (e.g. ``Draft202012Validator.validate``).
Arguments:
instance:
The instance to validate
schema:
The schema to validate with
cls (jsonschema.protocols.Validator):
The class that will be used to validate the instance.
If the ``cls`` argument is not provided, two things will happen
in accordance with the specification. First, if the schema has a
:kw:`$schema` keyword containing a known meta-schema [#]_ then the
proper validator will be used. The specification recommends that
all schemas contain :kw:`$schema` properties for this reason. If no
:kw:`$schema` property is found, the default validator class is the
latest released draft.
Any other provided positional and keyword arguments will be passed
on when instantiating the ``cls``.
Raises:
`jsonschema.exceptions.ValidationError`:
if the instance is invalid
`jsonschema.exceptions.SchemaError`:
if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with
`jsonschema.validators.validates`
"""
if cls is None:
cls = validator_for(schema)
cls.check_schema(schema)
validator = cls(schema, *args, **kwargs)
error = exceptions.best_match(validator.iter_errors(instance))
if error is not None:
> raise error
E jsonschema.exceptions.ValidationError: 'cookie' is not of type 'object'
E
E Failed validating 'type' in schema['items']['properties']['logSettings']['properties']['propertiesToInstrument']['items']:
E {'properties': {'depth': {'type': 'integer'},
E 'propertyNames': {'items': {'type': 'string'},
E 'type': 'array'}},
E 'type': 'object'}
E
E On instance[0]['logSettings']['propertiesToInstrument'][0]:
E 'cookie'
/home/runner/mamba/envs/openwpm/lib/python3.12/site-packages/jsonschema/validators.py:1312: ValidationError
Check failure on line 0 in junit-report.xml
github-actions / test/test_[i-o,q-r,t-z]*
pytest ► test.test_js_instrument.TestJSInstrumentMockWindowProperty ► test_instrument_object
Failed test found in:
junit-report.xml
Error:
self = <test.test_js_instrument.TestJSInstrumentMockWindowProperty object at 0x7fc9e1e6ae10>
Raw output
self = <test.test_js_instrument.TestJSInstrumentMockWindowProperty object at 0x7fc9e1e6ae10>
def test_instrument_object(self):
"""Ensure instrumentObject logs all property gets, sets, and calls"""
> db = self.visit("/js_instrument/%s" % self.TEST_PAGE)
/home/runner/work/OpenWPM/OpenWPM/test/test_js_instrument.py:203:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/OpenWPM/OpenWPM/test/openwpmtest.py:42: in visit
manager = task_manager.TaskManager(
/home/runner/work/OpenWPM/OpenWPM/openwpm/task_manager.py:99: in __init__
cleaned_js_settings = clean_js_instrumentation_settings(js_settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:245: in clean_js_instrumentation_settings
_validate(settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:27: in _validate
jsonschema.validate(instance=python_list_to_validate, schema=schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instance = [{'instrumentedName': 'ScriptProcessorNode', 'logSettings': {'depth': 5, 'excludedProperties': [], 'logCallStack': Fal...erties': [], 'logCallStack': False, 'logFunctionGets': False, ...}, 'object': "window['AudioContext'].prototype"}, ...]
schema = {'$id': 'http://example.com/js-instrument-settings.schema', '$schema': 'http://json-schema.org/draft-07/schema#', 'des... 'type': 'string'}}, 'required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}
cls = <class 'jsonschema.validators.Draft7Validator'>, args = (), kwargs = {}
validator = Draft7Validator(schema={'$id': 'http://examp...ttings.schema', '$schema': 'http://json-...ft-07/schema#', 'description...required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}, format_checker=None)
error = <ValidationError: "'name' is not of type 'object'">
def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
"""
Validate an instance under the given schema.
>>> validate([2, 3, 4], {"maxItems": 2})
Traceback (most recent call last):
...
ValidationError: [2, 3, 4] is too long
:func:`~jsonschema.validators.validate` will first verify that the
provided schema is itself valid, since not doing so can lead to less
obvious error messages and fail in less obvious or consistent ways.
If you know you have a valid schema already, especially
if you intend to validate multiple instances with
the same schema, you likely would prefer using the
`jsonschema.protocols.Validator.validate` method directly on a
specific validator (e.g. ``Draft202012Validator.validate``).
Arguments:
instance:
The instance to validate
schema:
The schema to validate with
cls (jsonschema.protocols.Validator):
The class that will be used to validate the instance.
If the ``cls`` argument is not provided, two things will happen
in accordance with the specification. First, if the schema has a
:kw:`$schema` keyword containing a known meta-schema [#]_ then the
proper validator will be used. The specification recommends that
all schemas contain :kw:`$schema` properties for this reason. If no
:kw:`$schema` property is found, the default validator class is the
latest released draft.
Any other provided positional and keyword arguments will be passed
on when instantiating the ``cls``.
Raises:
`jsonschema.exceptions.ValidationError`:
if the instance is invalid
`jsonschema.exceptions.SchemaError`:
if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with
`jsonschema.validators.validates`
"""
if cls is None:
cls = validator_for(schema)
cls.check_schema(schema)
validator = cls(schema, *args, **kwargs)
error = exceptions.best_match(validator.iter_errors(instance))
if error is not None:
> raise error
E jsonschema.exceptions.ValidationError: 'name' is not of type 'object'
E
E Failed validating 'type' in schema['items']['properties']['logSettings']['properties']['propertiesToInstrument']['items']:
E {'properties': {'depth': {'type': 'integer'},
E 'propertyNames': {'items': {'type': 'string'},
E 'type': 'array'}},
E 'type': 'object'}
E
E On instance[11]['logSettings']['propertiesToInstrument'][0]:
E 'name'
/home/runner/mamba/envs/openwpm/lib/python3.12/site-packages/jsonschema/validators.py:1312: ValidationError
Check failure on line 0 in junit-report.xml
github-actions / test/test_[i-o,q-r,t-z]*
pytest ► test.test_js_instrument.TestJSInstrument ► test_instrument_object
Failed test found in:
junit-report.xml
Error:
self = <test.test_js_instrument.TestJSInstrument object at 0x7fc9e1e6b2f0>
Raw output
self = <test.test_js_instrument.TestJSInstrument object at 0x7fc9e1e6b2f0>
def test_instrument_object(self):
"""Ensure instrumentObject logs all property gets, sets, and calls"""
> db = self.visit("/js_instrument/instrument_object.html")
/home/runner/work/OpenWPM/OpenWPM/test/test_js_instrument.py:292:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/OpenWPM/OpenWPM/test/openwpmtest.py:42: in visit
manager = task_manager.TaskManager(
/home/runner/work/OpenWPM/OpenWPM/openwpm/task_manager.py:99: in __init__
cleaned_js_settings = clean_js_instrumentation_settings(js_settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:245: in clean_js_instrumentation_settings
_validate(settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:27: in _validate
jsonschema.validate(instance=python_list_to_validate, schema=schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instance = [{'instrumentedName': 'ScriptProcessorNode', 'logSettings': {'depth': 5, 'excludedProperties': [], 'logCallStack': Fal...erties': [], 'logCallStack': False, 'logFunctionGets': False, ...}, 'object': "window['AudioContext'].prototype"}, ...]
schema = {'$id': 'http://example.com/js-instrument-settings.schema', '$schema': 'http://json-schema.org/draft-07/schema#', 'des... 'type': 'string'}}, 'required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}
cls = <class 'jsonschema.validators.Draft7Validator'>, args = (), kwargs = {}
validator = Draft7Validator(schema={'$id': 'http://examp...ttings.schema', '$schema': 'http://json-...ft-07/schema#', 'description...required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}, format_checker=None)
error = <ValidationError: "'name' is not of type 'object'">
def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
"""
Validate an instance under the given schema.
>>> validate([2, 3, 4], {"maxItems": 2})
Traceback (most recent call last):
...
ValidationError: [2, 3, 4] is too long
:func:`~jsonschema.validators.validate` will first verify that the
provided schema is itself valid, since not doing so can lead to less
obvious error messages and fail in less obvious or consistent ways.
If you know you have a valid schema already, especially
if you intend to validate multiple instances with
the same schema, you likely would prefer using the
`jsonschema.protocols.Validator.validate` method directly on a
specific validator (e.g. ``Draft202012Validator.validate``).
Arguments:
instance:
The instance to validate
schema:
The schema to validate with
cls (jsonschema.protocols.Validator):
The class that will be used to validate the instance.
If the ``cls`` argument is not provided, two things will happen
in accordance with the specification. First, if the schema has a
:kw:`$schema` keyword containing a known meta-schema [#]_ then the
proper validator will be used. The specification recommends that
all schemas contain :kw:`$schema` properties for this reason. If no
:kw:`$schema` property is found, the default validator class is the
latest released draft.
Any other provided positional and keyword arguments will be passed
on when instantiating the ``cls``.
Raises:
`jsonschema.exceptions.ValidationError`:
if the instance is invalid
`jsonschema.exceptions.SchemaError`:
if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with
`jsonschema.validators.validates`
"""
if cls is None:
cls = validator_for(schema)
cls.check_schema(schema)
validator = cls(schema, *args, **kwargs)
error = exceptions.best_match(validator.iter_errors(instance))
if error is not None:
> raise error
E jsonschema.exceptions.ValidationError: 'name' is not of type 'object'
E
E Failed validating 'type' in schema['items']['properties']['logSettings']['properties']['propertiesToInstrument']['items']:
E {'properties': {'depth': {'type': 'integer'},
E 'propertyNames': {'items': {'type': 'string'},
E 'type': 'array'}},
E 'type': 'object'}
E
E On instance[11]['logSettings']['propertiesToInstrument'][0]:
E 'name'
/home/runner/mamba/envs/openwpm/lib/python3.12/site-packages/jsonschema/validators.py:1312: ValidationError
Check failure on line 0 in junit-report.xml
github-actions / test/test_[i-o,q-r,t-z]*
pytest ► test.test_js_instrument.TestJSInstrumentRecursiveProperties ► test_instrument_object
Failed test found in:
junit-report.xml
Error:
self = <test.test_js_instrument.TestJSInstrumentRecursiveProperties object at 0x7fc9e1e6b5c0>
Raw output
self = <test.test_js_instrument.TestJSInstrumentRecursiveProperties object at 0x7fc9e1e6b5c0>
def test_instrument_object(self):
"""Ensure instrumentObject logs all property gets, sets, and calls"""
> db = self.visit("/js_instrument/%s" % self.TEST_PAGE)
/home/runner/work/OpenWPM/OpenWPM/test/test_js_instrument.py:389:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/OpenWPM/OpenWPM/test/openwpmtest.py:42: in visit
manager = task_manager.TaskManager(
/home/runner/work/OpenWPM/OpenWPM/openwpm/task_manager.py:99: in __init__
cleaned_js_settings = clean_js_instrumentation_settings(js_settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:245: in clean_js_instrumentation_settings
_validate(settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:27: in _validate
jsonschema.validate(instance=python_list_to_validate, schema=schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instance = [{'instrumentedName': 'ScriptProcessorNode', 'logSettings': {'depth': 5, 'excludedProperties': [], 'logCallStack': Fal...erties': [], 'logCallStack': False, 'logFunctionGets': False, ...}, 'object': "window['AudioContext'].prototype"}, ...]
schema = {'$id': 'http://example.com/js-instrument-settings.schema', '$schema': 'http://json-schema.org/draft-07/schema#', 'des... 'type': 'string'}}, 'required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}
cls = <class 'jsonschema.validators.Draft7Validator'>, args = (), kwargs = {}
validator = Draft7Validator(schema={'$id': 'http://examp...ttings.schema', '$schema': 'http://json-...ft-07/schema#', 'description...required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}, format_checker=None)
error = <ValidationError: "'name' is not of type 'object'">
def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
"""
Validate an instance under the given schema.
>>> validate([2, 3, 4], {"maxItems": 2})
Traceback (most recent call last):
...
ValidationError: [2, 3, 4] is too long
:func:`~jsonschema.validators.validate` will first verify that the
provided schema is itself valid, since not doing so can lead to less
obvious error messages and fail in less obvious or consistent ways.
If you know you have a valid schema already, especially
if you intend to validate multiple instances with
the same schema, you likely would prefer using the
`jsonschema.protocols.Validator.validate` method directly on a
specific validator (e.g. ``Draft202012Validator.validate``).
Arguments:
instance:
The instance to validate
schema:
The schema to validate with
cls (jsonschema.protocols.Validator):
The class that will be used to validate the instance.
If the ``cls`` argument is not provided, two things will happen
in accordance with the specification. First, if the schema has a
:kw:`$schema` keyword containing a known meta-schema [#]_ then the
proper validator will be used. The specification recommends that
all schemas contain :kw:`$schema` properties for this reason. If no
:kw:`$schema` property is found, the default validator class is the
latest released draft.
Any other provided positional and keyword arguments will be passed
on when instantiating the ``cls``.
Raises:
`jsonschema.exceptions.ValidationError`:
if the instance is invalid
`jsonschema.exceptions.SchemaError`:
if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with
`jsonschema.validators.validates`
"""
if cls is None:
cls = validator_for(schema)
cls.check_schema(schema)
validator = cls(schema, *args, **kwargs)
error = exceptions.best_match(validator.iter_errors(instance))
if error is not None:
> raise error
E jsonschema.exceptions.ValidationError: 'name' is not of type 'object'
E
E Failed validating 'type' in schema['items']['properties']['logSettings']['properties']['propertiesToInstrument']['items']:
E {'properties': {'depth': {'type': 'integer'},
E 'propertyNames': {'items': {'type': 'string'},
E 'type': 'array'}},
E 'type': 'object'}
E
E On instance[11]['logSettings']['propertiesToInstrument'][0]:
E 'name'
/home/runner/mamba/envs/openwpm/lib/python3.12/site-packages/jsonschema/validators.py:1312: ValidationError
Check failure on line 0 in junit-report.xml
github-actions / test/test_[i-o,q-r,t-z]*
pytest ► test.test_js_instrument_py ► test_merge_and_validate_multiple_overlap_properties_to_instrument_properties_to_exclude
Failed test found in:
junit-report.xml
Error:
default_log_settings = {'depth': 5, 'excludedProperties': ['name'], 'logCallStack': False, 'logFunctionGets': False, ...}
Raw output
default_log_settings = {'depth': 5, 'excludedProperties': ['name'], 'logCallStack': False, 'logFunctionGets': False, ...}
def test_merge_and_validate_multiple_overlap_properties_to_instrument_properties_to_exclude(
default_log_settings,
): # noqa
log_settings_1 = default_log_settings.copy()
log_settings_2 = default_log_settings.copy()
log_settings_1["propertiesToInstrument"] = ["name", "place"]
log_settings_2["excludedProperties"] = ["name"]
dupe_input = [
{
"object": "window",
"instrumentedName": "window",
"logSettings": log_settings_1,
},
{
"object": "window",
"instrumentedName": "window",
"logSettings": log_settings_2,
},
]
merged = jsi._merge_settings(dupe_input)
with pytest.raises(ValueError):
> jsi._validate(merged)
/home/runner/work/OpenWPM/OpenWPM/test/test_js_instrument_py.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:27: in _validate
jsonschema.validate(instance=python_list_to_validate, schema=schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instance = [{'instrumentedName': 'window', 'logSettings': {'depth': 5, 'excludedProperties': ['name'], 'logCallStack': False, 'logFunctionGets': False, ...}, 'object': 'window'}]
schema = {'$id': 'http://example.com/js-instrument-settings.schema', '$schema': 'http://json-schema.org/draft-07/schema#', 'des... 'type': 'string'}}, 'required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}
cls = <class 'jsonschema.validators.Draft7Validator'>, args = (), kwargs = {}
validator = Draft7Validator(schema={'$id': 'http://examp...ttings.schema', '$schema': 'http://json-...ft-07/schema#', 'description...required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}, format_checker=None)
error = <ValidationError: "'name' is not of type 'object'">
def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
"""
Validate an instance under the given schema.
>>> validate([2, 3, 4], {"maxItems": 2})
Traceback (most recent call last):
...
ValidationError: [2, 3, 4] is too long
:func:`~jsonschema.validators.validate` will first verify that the
provided schema is itself valid, since not doing so can lead to less
obvious error messages and fail in less obvious or consistent ways.
If you know you have a valid schema already, especially
if you intend to validate multiple instances with
the same schema, you likely would prefer using the
`jsonschema.protocols.Validator.validate` method directly on a
specific validator (e.g. ``Draft202012Validator.validate``).
Arguments:
instance:
The instance to validate
schema:
The schema to validate with
cls (jsonschema.protocols.Validator):
The class that will be used to validate the instance.
If the ``cls`` argument is not provided, two things will happen
in accordance with the specification. First, if the schema has a
:kw:`$schema` keyword containing a known meta-schema [#]_ then the
proper validator will be used. The specification recommends that
all schemas contain :kw:`$schema` properties for this reason. If no
:kw:`$schema` property is found, the default validator class is the
latest released draft.
Any other provided positional and keyword arguments will be passed
on when instantiating the ``cls``.
Raises:
`jsonschema.exceptions.ValidationError`:
if the instance is invalid
`jsonschema.exceptions.SchemaError`:
if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with
`jsonschema.validators.validates`
"""
if cls is None:
cls = validator_for(schema)
cls.check_schema(schema)
validator = cls(schema, *args, **kwargs)
error = exceptions.best_match(validator.iter_errors(instance))
if error is not None:
> raise error
E jsonschema.exceptions.ValidationError: 'name' is not of type 'object'
E
E Failed validating 'type' in schema['items']['properties']['logSettings']['properties']['propertiesToInstrument']['items']:
E {'properties': {'depth': {'type': 'integer'},
E 'propertyNames': {'items': {'type': 'string'},
E 'type': 'array'}},
E 'type': 'object'}
E
E On instance[0]['logSettings']['propertiesToInstrument'][0]:
E 'name'
/home/runner/mamba/envs/openwpm/lib/python3.12/site-packages/jsonschema/validators.py:1312: ValidationError
Check failure on line 0 in junit-report.xml
github-actions / test/test_[i-o,q-r,t-z]*
pytest ► test.test_js_instrument_py ► test_api_collection_fingerprinting
Failed test found in:
junit-report.xml
Error:
def test_api_collection_fingerprinting():
Raw output
def test_api_collection_fingerprinting():
# This is a very crude test, there are other tests to
# check fingeprinting instrumentation in more detail
shortcut_input = ["collection_fingerprinting"]
> output = jsi.clean_js_instrumentation_settings(shortcut_input)
/home/runner/work/OpenWPM/OpenWPM/test/test_js_instrument_py.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:245: in clean_js_instrumentation_settings
_validate(settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:27: in _validate
jsonschema.validate(instance=python_list_to_validate, schema=schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instance = [{'instrumentedName': 'ScriptProcessorNode', 'logSettings': {'depth': 5, 'excludedProperties': [], 'logCallStack': Fal...erties': [], 'logCallStack': False, 'logFunctionGets': False, ...}, 'object': "window['AudioContext'].prototype"}, ...]
schema = {'$id': 'http://example.com/js-instrument-settings.schema', '$schema': 'http://json-schema.org/draft-07/schema#', 'des... 'type': 'string'}}, 'required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}
cls = <class 'jsonschema.validators.Draft7Validator'>, args = (), kwargs = {}
validator = Draft7Validator(schema={'$id': 'http://examp...ttings.schema', '$schema': 'http://json-...ft-07/schema#', 'description...required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}, format_checker=None)
error = <ValidationError: "'name' is not of type 'object'">
def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
"""
Validate an instance under the given schema.
>>> validate([2, 3, 4], {"maxItems": 2})
Traceback (most recent call last):
...
ValidationError: [2, 3, 4] is too long
:func:`~jsonschema.validators.validate` will first verify that the
provided schema is itself valid, since not doing so can lead to less
obvious error messages and fail in less obvious or consistent ways.
If you know you have a valid schema already, especially
if you intend to validate multiple instances with
the same schema, you likely would prefer using the
`jsonschema.protocols.Validator.validate` method directly on a
specific validator (e.g. ``Draft202012Validator.validate``).
Arguments:
instance:
The instance to validate
schema:
The schema to validate with
cls (jsonschema.protocols.Validator):
The class that will be used to validate the instance.
If the ``cls`` argument is not provided, two things will happen
in accordance with the specification. First, if the schema has a
:kw:`$schema` keyword containing a known meta-schema [#]_ then the
proper validator will be used. The specification recommends that
all schemas contain :kw:`$schema` properties for this reason. If no
:kw:`$schema` property is found, the default validator class is the
latest released draft.
Any other provided positional and keyword arguments will be passed
on when instantiating the ``cls``.
Raises:
`jsonschema.exceptions.ValidationError`:
if the instance is invalid
`jsonschema.exceptions.SchemaError`:
if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with
`jsonschema.validators.validates`
"""
if cls is None:
cls = validator_for(schema)
cls.check_schema(schema)
validator = cls(schema, *args, **kwargs)
error = exceptions.best_match(validator.iter_errors(instance))
if error is not None:
> raise error
E jsonschema.exceptions.ValidationError: 'name' is not of type 'object'
E
E Failed validating 'type' in schema['items']['properties']['logSettings']['properties']['propertiesToInstrument']['items']:
E {'properties': {'depth': {'type': 'integer'},
E 'propertyNames': {'items': {'type': 'string'},
E 'type': 'array'}},
E 'type': 'object'}
E
E On instance[11]['logSettings']['propertiesToInstrument'][0]:
E 'name'
/home/runner/mamba/envs/openwpm/lib/python3.12/site-packages/jsonschema/validators.py:1312: ValidationError
Check failure on line 0 in junit-report.xml
github-actions / test/test_[i-o,q-r,t-z]*
pytest ► test.test_task_manager ► test_failure_limit_exceeded
Failed test found in:
junit-report.xml
Error:
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7fc9e0c6f060>
Raw output
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7fc9e0c6f060>
default_params = (ManagerParams(data_directory=PosixPath('/tmp/pytest-of-runner/pytest-0/test_failure_limit_exceeded0'), log_path=Posix...'/tmp'), maximum_profile_size=None, recovery_tar=None, donottrack=False, tracking_protection=False, custom_params={})])
def test_failure_limit_exceeded(task_manager_creator, default_params):
manager_params, browser_params = default_params
manager_params.num_browsers = 1
manager_params.failure_limit = 0
> manager, _ = task_manager_creator((manager_params, browser_params[:1]))
/home/runner/work/OpenWPM/OpenWPM/test/test_task_manager.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/OpenWPM/OpenWPM/test/conftest.py:80: in _create_task_manager
manager = TaskManager(
/home/runner/work/OpenWPM/OpenWPM/openwpm/task_manager.py:99: in __init__
cleaned_js_settings = clean_js_instrumentation_settings(js_settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:245: in clean_js_instrumentation_settings
_validate(settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:27: in _validate
jsonschema.validate(instance=python_list_to_validate, schema=schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instance = [{'instrumentedName': 'ScriptProcessorNode', 'logSettings': {'depth': 5, 'excludedProperties': [], 'logCallStack': Fal...erties': [], 'logCallStack': False, 'logFunctionGets': False, ...}, 'object': "window['AudioContext'].prototype"}, ...]
schema = {'$id': 'http://example.com/js-instrument-settings.schema', '$schema': 'http://json-schema.org/draft-07/schema#', 'des... 'type': 'string'}}, 'required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}
cls = <class 'jsonschema.validators.Draft7Validator'>, args = (), kwargs = {}
validator = Draft7Validator(schema={'$id': 'http://examp...ttings.schema', '$schema': 'http://json-...ft-07/schema#', 'description...required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}, format_checker=None)
error = <ValidationError: "'name' is not of type 'object'">
def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
"""
Validate an instance under the given schema.
>>> validate([2, 3, 4], {"maxItems": 2})
Traceback (most recent call last):
...
ValidationError: [2, 3, 4] is too long
:func:`~jsonschema.validators.validate` will first verify that the
provided schema is itself valid, since not doing so can lead to less
obvious error messages and fail in less obvious or consistent ways.
If you know you have a valid schema already, especially
if you intend to validate multiple instances with
the same schema, you likely would prefer using the
`jsonschema.protocols.Validator.validate` method directly on a
specific validator (e.g. ``Draft202012Validator.validate``).
Arguments:
instance:
The instance to validate
schema:
The schema to validate with
cls (jsonschema.protocols.Validator):
The class that will be used to validate the instance.
If the ``cls`` argument is not provided, two things will happen
in accordance with the specification. First, if the schema has a
:kw:`$schema` keyword containing a known meta-schema [#]_ then the
proper validator will be used. The specification recommends that
all schemas contain :kw:`$schema` properties for this reason. If no
:kw:`$schema` property is found, the default validator class is the
latest released draft.
Any other provided positional and keyword arguments will be passed
on when instantiating the ``cls``.
Raises:
`jsonschema.exceptions.ValidationError`:
if the instance is invalid
`jsonschema.exceptions.SchemaError`:
if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with
`jsonschema.validators.validates`
"""
if cls is None:
cls = validator_for(schema)
cls.check_schema(schema)
validator = cls(schema, *args, **kwargs)
error = exceptions.best_match(validator.iter_errors(instance))
if error is not None:
> raise error
E jsonschema.exceptions.ValidationError: 'name' is not of type 'object'
E
E Failed validating 'type' in schema['items']['properties']['logSettings']['properties']['propertiesToInstrument']['items']:
E {'properties': {'depth': {'type': 'integer'},
E 'propertyNames': {'items': {'type': 'string'},
E 'type': 'array'}},
E 'type': 'object'}
E
E On instance[11]['logSettings']['propertiesToInstrument'][0]:
E 'name'
/home/runner/mamba/envs/openwpm/lib/python3.12/site-packages/jsonschema/validators.py:1312: ValidationError
Check failure on line 0 in junit-report.xml
github-actions / test/test_[i-o,q-r,t-z]*
pytest ► test.test_task_manager ► test_failure_limit_reset
Failed test found in:
junit-report.xml
Error:
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7fc9e0c6e480>
Raw output
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7fc9e0c6e480>
default_params = (ManagerParams(data_directory=PosixPath('/tmp/pytest-of-runner/pytest-0/test_failure_limit_reset0'), log_path=PosixPat...'/tmp'), maximum_profile_size=None, recovery_tar=None, donottrack=False, tracking_protection=False, custom_params={})])
def test_failure_limit_reset(task_manager_creator, default_params):
"""Test that failure_count is reset on command sequence completion."""
manager_params, browser_params = default_params
manager_params.num_browsers = 1
manager_params.failure_limit = 1
> manager, _ = task_manager_creator((manager_params, browser_params[:1]))
/home/runner/work/OpenWPM/OpenWPM/test/test_task_manager.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/OpenWPM/OpenWPM/test/conftest.py:80: in _create_task_manager
manager = TaskManager(
/home/runner/work/OpenWPM/OpenWPM/openwpm/task_manager.py:99: in __init__
cleaned_js_settings = clean_js_instrumentation_settings(js_settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:245: in clean_js_instrumentation_settings
_validate(settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:27: in _validate
jsonschema.validate(instance=python_list_to_validate, schema=schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instance = [{'instrumentedName': 'ScriptProcessorNode', 'logSettings': {'depth': 5, 'excludedProperties': [], 'logCallStack': Fal...erties': [], 'logCallStack': False, 'logFunctionGets': False, ...}, 'object': "window['AudioContext'].prototype"}, ...]
schema = {'$id': 'http://example.com/js-instrument-settings.schema', '$schema': 'http://json-schema.org/draft-07/schema#', 'des... 'type': 'string'}}, 'required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}
cls = <class 'jsonschema.validators.Draft7Validator'>, args = (), kwargs = {}
validator = Draft7Validator(schema={'$id': 'http://examp...ttings.schema', '$schema': 'http://json-...ft-07/schema#', 'description...required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}, format_checker=None)
error = <ValidationError: "'name' is not of type 'object'">
def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
"""
Validate an instance under the given schema.
>>> validate([2, 3, 4], {"maxItems": 2})
Traceback (most recent call last):
...
ValidationError: [2, 3, 4] is too long
:func:`~jsonschema.validators.validate` will first verify that the
provided schema is itself valid, since not doing so can lead to less
obvious error messages and fail in less obvious or consistent ways.
If you know you have a valid schema already, especially
if you intend to validate multiple instances with
the same schema, you likely would prefer using the
`jsonschema.protocols.Validator.validate` method directly on a
specific validator (e.g. ``Draft202012Validator.validate``).
Arguments:
instance:
The instance to validate
schema:
The schema to validate with
cls (jsonschema.protocols.Validator):
The class that will be used to validate the instance.
If the ``cls`` argument is not provided, two things will happen
in accordance with the specification. First, if the schema has a
:kw:`$schema` keyword containing a known meta-schema [#]_ then the
proper validator will be used. The specification recommends that
all schemas contain :kw:`$schema` properties for this reason. If no
:kw:`$schema` property is found, the default validator class is the
latest released draft.
Any other provided positional and keyword arguments will be passed
on when instantiating the ``cls``.
Raises:
`jsonschema.exceptions.ValidationError`:
if the instance is invalid
`jsonschema.exceptions.SchemaError`:
if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with
`jsonschema.validators.validates`
"""
if cls is None:
cls = validator_for(schema)
cls.check_schema(schema)
validator = cls(schema, *args, **kwargs)
error = exceptions.best_match(validator.iter_errors(instance))
if error is not None:
> raise error
E jsonschema.exceptions.ValidationError: 'name' is not of type 'object'
E
E Failed validating 'type' in schema['items']['properties']['logSettings']['properties']['propertiesToInstrument']['items']:
E {'properties': {'depth': {'type': 'integer'},
E 'propertyNames': {'items': {'type': 'string'},
E 'type': 'array'}},
E 'type': 'object'}
E
E On instance[11]['logSettings']['propertiesToInstrument'][0]:
E 'name'
/home/runner/mamba/envs/openwpm/lib/python3.12/site-packages/jsonschema/validators.py:1312: ValidationError
Check failure on line 0 in junit-report.xml
github-actions / test/test_[i-o,q-r,t-z]*
pytest ► test.test_task_manager ► test_assertion_error_propagation[False-expectation0]
Failed test found in:
junit-report.xml
Error:
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7fc9e0c6f6a0>
Raw output
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7fc9e0c6f6a0>
default_params = (ManagerParams(data_directory=PosixPath('/tmp/pytest-of-runner/pytest-0/test_assertion_error_propagati0'), log_path=Po...'/tmp'), maximum_profile_size=None, recovery_tar=None, donottrack=False, tracking_protection=False, custom_params={})])
testing = False, expectation = <contextlib.nullcontext object at 0x7fc9e1f04fe0>
@pytest.mark.parametrize(
"testing,expectation",
[
(False, does_not_raise()),
(True, pytest.raises(AssertionError, match="From inside the command")),
],
)
def test_assertion_error_propagation(
task_manager_creator, default_params, testing, expectation
):
"""Test that assertion errors bubble up through the TaskManager when running tests"""
manager_params, browser_params = default_params
manager_params.num_browsers = 1
manager_params.testing = testing
> manager, _ = task_manager_creator((manager_params, browser_params[:1]))
/home/runner/work/OpenWPM/OpenWPM/test/test_task_manager.py:78:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/OpenWPM/OpenWPM/test/conftest.py:80: in _create_task_manager
manager = TaskManager(
/home/runner/work/OpenWPM/OpenWPM/openwpm/task_manager.py:99: in __init__
cleaned_js_settings = clean_js_instrumentation_settings(js_settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:245: in clean_js_instrumentation_settings
_validate(settings)
/home/runner/work/OpenWPM/OpenWPM/openwpm/js_instrumentation.py:27: in _validate
jsonschema.validate(instance=python_list_to_validate, schema=schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instance = [{'instrumentedName': 'ScriptProcessorNode', 'logSettings': {'depth': 5, 'excludedProperties': [], 'logCallStack': Fal...erties': [], 'logCallStack': False, 'logFunctionGets': False, ...}, 'object': "window['AudioContext'].prototype"}, ...]
schema = {'$id': 'http://example.com/js-instrument-settings.schema', '$schema': 'http://json-schema.org/draft-07/schema#', 'des... 'type': 'string'}}, 'required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}
cls = <class 'jsonschema.validators.Draft7Validator'>, args = (), kwargs = {}
validator = Draft7Validator(schema={'$id': 'http://examp...ttings.schema', '$schema': 'http://json-...ft-07/schema#', 'description...required': ['object', 'instrumentedName', 'logSettings'], 'title': 'Settings objects', ...}, ...}, format_checker=None)
error = <ValidationError: "'name' is not of type 'object'">
def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
"""
Validate an instance under the given schema.
>>> validate([2, 3, 4], {"maxItems": 2})
Traceback (most recent call last):
...
ValidationError: [2, 3, 4] is too long
:func:`~jsonschema.validators.validate` will first verify that the
provided schema is itself valid, since not doing so can lead to less
obvious error messages and fail in less obvious or consistent ways.
If you know you have a valid schema already, especially
if you intend to validate multiple instances with
the same schema, you likely would prefer using the
`jsonschema.protocols.Validator.validate` method directly on a
specific validator (e.g. ``Draft202012Validator.validate``).
Arguments:
instance:
The instance to validate
schema:
The schema to validate with
cls (jsonschema.protocols.Validator):
The class that will be used to validate the instance.
If the ``cls`` argument is not provided, two things will happen
in accordance with the specification. First, if the schema has a
:kw:`$schema` keyword containing a known meta-schema [#]_ then the
proper validator will be used. The specification recommends that
all schemas contain :kw:`$schema` properties for this reason. If no
:kw:`$schema` property is found, the default validator class is the
latest released draft.
Any other provided positional and keyword arguments will be passed
on when instantiating the ``cls``.
Raises:
`jsonschema.exceptions.ValidationError`:
if the instance is invalid
`jsonschema.exceptions.SchemaError`:
if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with
`jsonschema.validators.validates`
"""
if cls is None:
cls = validator_for(schema)
cls.check_schema(schema)
validator = cls(schema, *args, **kwargs)
error = exceptions.best_match(validator.iter_errors(instance))
if error is not None:
> raise error
E jsonschema.exceptions.ValidationError: 'name' is not of type 'object'
E
E Failed validating 'type' in schema['items']['properties']['logSettings']['properties']['propertiesToInstrument']['items']:
E {'properties': {'depth': {'type': 'integer'},
E 'propertyNames': {'items': {'type': 'string'},
E 'type': 'array'}},
E 'type': 'object'}
E
E On instance[11]['logSettings']['propertiesToInstrument'][0]:
E 'name'
/home/runner/mamba/envs/openwpm/lib/python3.12/site-packages/jsonschema/validators.py:1312: ValidationError