Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various mockgun compare bugfixes #963

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

various mockgun compare bugfixes

35d8813
Select commit
Loading
Failed to load commit list.
Open

various mockgun compare bugfixes #963

various mockgun compare bugfixes
35d8813
Select commit
Loading
Failed to load commit list.
Azure Pipelines / tk-core failed Feb 28, 2024 in 9m 23s

Build #20240228.1 had test failures

Details

Tests

  • Failed: 225 (2.18%)
  • Passed: 10,074 (97.67%)
  • Other: 15 (0.15%)
  • Total: 10,314
Code coverage

  • 14948 of 21022 lines covered (71.11%)

Annotations

Check failure on line 1173 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / tk-core

Build log #L1173

25 test(s) failed, 1146 test(s) collected.

Check failure on line 6977 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / tk-core

Build log #L6977

Bash exited with code '1'.

Check failure on line 1173 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / tk-core

Build log #L1173

25 test(s) failed, 1146 test(s) collected.

Check failure on line 6977 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / tk-core

Build log #L6977

Bash exited with code '1'.

Check failure on line 1 in tests/bootstrap_tests/test_resolver.py::TestPipelineLocationFieldPriority::test_descriptor_without_plugin

See this annotation in the file changed.

@azure-pipelines azure-pipelines / tk-core

tests/bootstrap_tests/test_resolver.py::TestPipelineLocationFieldPriority::test_descriptor_without_plugin

self = <tests.bootstrap_tests.test_resolver.TestPipelineLocationFieldPriority testMethod=test_descriptor_without_plugin>

    def test_descriptor_without_plugin(self):
        """
        Ensures only plugin based pipeline configurations are reported as valid when the descriptor
        field is set.
        """
    
        # First make sure we've created a valid pipeline configuration.
        pc_id = self._create_pc(
            "Primary",
            project=self._project,
            descriptor="sgtk:descriptor:app_store?version=v3.1.2&name=tk-config-test",
            plugin_ids="foo.*",
        )["id"]
        pcs = self.resolver.find_matching_pipeline_configurations(
>           None, "john.smith", self.mockgun
        )

tests/bootstrap_tests/test_resolver.py:851: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
python/tank/bootstrap/resolver.py:762: in find_matching_pipeline_configurations
    ) = self._filter_pipeline_configurations(pcs)
python/tank/bootstrap/resolver.py:699: in _filter_pipeline_configurations
    for pc in pcs:
python/tank/bootstrap/resolver.py:406: in _get_pipeline_configurations_for_project
    order=[{"field_name": "id", "direction": "asc"}],
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:288: in find
    row for row in self._db[entity_type].values()
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:290: in <listcomp>
    entity_type, row, resolved_filters, filter_operator, retired_only
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:821: in _row_matches_filters
    return all(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:821: in <genexpr>
    return all(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:743: in _row_matches_filter
    return self._row_matches_filters(entity_type, row, rval, operator, retired_only)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:823: in _row_matches_filters
    return any(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:823: in <genexpr>
    return any(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:764: in _row_matches_filter
    return self._compare(field_type, lval, operator, rval)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tank_vendor.shotgun_api3.lib.mockgun.mockgun.Shotgun object at 0x7fe83453c810>
field_type = 'multi_entity', lval = [], operator = 'is', rval = None

    def _compare(self, field_type, lval, operator, rval):
        """
        Compares a field using the operator and value provide by the filter.
    
        :param str field_type: Type of the field we are operating on.
        :param lval: Value inside that field. Can be of any type: datetime, date, int, str, bool, etc.
        :param str operator: Name of the operator to use.
        :param rval: The value following the operator in a filter.
    
        :returns: The result of the operator that was applied.
        :rtype: bool
        """
        # If we have a list of scalar values
        if isinstance(lval, list) and field_type != "multi_entity":
            # Compare each one. If one matches the predicate we're good!
            return any((self._compare(field_type, sub_val, operator, rval)) for sub_val in lval)
    
        if field_type == "checkbox":
            if operator == "is":
                return lval == rval
            elif operator == "is_not":
                return lval != rval
        elif field_type in ("float", "number", "date", "date_time"):
            if operator == "is":
                return lval == rval
            elif operator == "is_not":
   
Raw output
/home/vsts/work/1/s/python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:667: tank_vendor.shotgun_api3.shotgun.ShotgunError: The is operator is not supported on the multi_entity type

Check failure on line 1 in tests/bootstrap_tests/test_resolver.py::TestPipelineLocationFieldPriority::test_path_override

See this annotation in the file changed.

@azure-pipelines azure-pipelines / tk-core

tests/bootstrap_tests/test_resolver.py::TestPipelineLocationFieldPriority::test_path_override

self = <tests.bootstrap_tests.test_resolver.TestPipelineLocationFieldPriority testMethod=test_path_override>
_ = <MagicMock name='isdir' id='140634994825616'>

    @mock.patch("os.path.isdir", return_value=True)
    def test_path_override(self, _):
        """
        If pipeline config paths are defined, these take precedence over the descriptor field.
        """
    
        self._create_pc(
            "Primary",
            self._project,
            path="sg_path",
            plugin_ids="foo.*",
            descriptor="sgtk:descriptor:app_store?version=v0.1.2&name=tk-config-test",
            uploaded_config_dict={
                "name": "v1.2.3.zip",
                "url": "https://...",
                "content_type": "application/zip",
                "type": "Attachment",
                "id": 139,
                "link_type": "upload",
            },
        )
    
        config = self.resolver.resolve_shotgun_configuration(
            pipeline_config_identifier=None,
            fallback_config_descriptor=self.config_1,
            sg_connection=self.mockgun,
>           current_login="john.smith",
        )

tests/bootstrap_tests/test_resolver.py:688: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
python/tank/bootstrap/resolver.py:865: in resolve_shotgun_configuration
    ) = self._filter_pipeline_configurations(pcs)
python/tank/bootstrap/resolver.py:699: in _filter_pipeline_configurations
    for pc in pcs:
python/tank/bootstrap/resolver.py:406: in _get_pipeline_configurations_for_project
    order=[{"field_name": "id", "direction": "asc"}],
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:288: in find
    row for row in self._db[entity_type].values()
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:290: in <listcomp>
    entity_type, row, resolved_filters, filter_operator, retired_only
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:821: in _row_matches_filters
    return all(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:821: in <genexpr>
    return all(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:743: in _row_matches_filter
    return self._row_matches_filters(entity_type, row, rval, operator, retired_only)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:823: in _row_matches_filters
    return any(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:823: in <genexpr>
    return any(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:764: in _row_matches_filter
    return self._compare(field_type, lval, operator, rval)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tank_vendor.shotgun_api3.lib.mockgun.mockgun.Shotgun object at 0x7fe8345308d0>
field_type = 'multi_entity', lval = [], operator = 'is', rval = None

    def _compare(self, field_type, lval, operator, rval):
        """
        Compares a field using the operator and value provide by the filter.
    
        :param str field_type: Type of the field we are operating on.
        :param lval: Value inside that field. Can be of any type: datetime, date, int, str, bool, etc.
        :param str operator: Name of the operator to use.
        :param rval: The value following the operator in a filter.
    
        :returns: The result of the operator that was applied.
        :rtype: bool
        """
        # If we have a list of scalar values
        if isinstance(lval, list) and field_type != "multi_entity":
            # Compare each one. If one matches the predicate we're good!
            return any((self._compare(field_type, sub_val, ope
Raw output
/home/vsts/work/1/s/python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:667: tank_vendor.shotgun_api3.shotgun.ShotgunError: The is operator is not supported on the multi_entity type

Check failure on line 1 in tests/bootstrap_tests/test_resolver.py::TestPipelineLocationFieldPriority::test_pc_descriptor

See this annotation in the file changed.

@azure-pipelines azure-pipelines / tk-core

tests/bootstrap_tests/test_resolver.py::TestPipelineLocationFieldPriority::test_pc_descriptor

self = <tests.bootstrap_tests.test_resolver.TestPipelineLocationFieldPriority testMethod=test_pc_descriptor>

    def test_pc_descriptor(self):
        """
        Test that descriptor field is used when set.
        """
        self._create_pc(
            "Primary",
            self._project,
            plugin_ids="foo.*, bar, baz",
            descriptor="sgtk:descriptor:app_store?version=v3.1.2&name=tk-config-test",
            uploaded_config_dict={
                "name": "v1.2.3.zip",
                "url": "https://...",
                "content_type": "application/zip",
                "type": "Attachment",
                "id": 139,
                "link_type": "upload",
            },
        )
    
        config = self.resolver.resolve_shotgun_configuration(
            pipeline_config_identifier=None,
            fallback_config_descriptor=self.config_1,
            sg_connection=self.mockgun,
>           current_login="john.smith",
        )

tests/bootstrap_tests/test_resolver.py:716: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
python/tank/bootstrap/resolver.py:865: in resolve_shotgun_configuration
    ) = self._filter_pipeline_configurations(pcs)
python/tank/bootstrap/resolver.py:699: in _filter_pipeline_configurations
    for pc in pcs:
python/tank/bootstrap/resolver.py:406: in _get_pipeline_configurations_for_project
    order=[{"field_name": "id", "direction": "asc"}],
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:288: in find
    row for row in self._db[entity_type].values()
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:290: in <listcomp>
    entity_type, row, resolved_filters, filter_operator, retired_only
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:821: in _row_matches_filters
    return all(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:821: in <genexpr>
    return all(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:743: in _row_matches_filter
    return self._row_matches_filters(entity_type, row, rval, operator, retired_only)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:823: in _row_matches_filters
    return any(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:823: in <genexpr>
    return any(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:764: in _row_matches_filter
    return self._compare(field_type, lval, operator, rval)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tank_vendor.shotgun_api3.lib.mockgun.mockgun.Shotgun object at 0x7fe83628cc50>
field_type = 'multi_entity', lval = [], operator = 'is', rval = None

    def _compare(self, field_type, lval, operator, rval):
        """
        Compares a field using the operator and value provide by the filter.
    
        :param str field_type: Type of the field we are operating on.
        :param lval: Value inside that field. Can be of any type: datetime, date, int, str, bool, etc.
        :param str operator: Name of the operator to use.
        :param rval: The value following the operator in a filter.
    
        :returns: The result of the operator that was applied.
        :rtype: bool
        """
        # If we have a list of scalar values
        if isinstance(lval, list) and field_type != "multi_entity":
            # Compare each one. If one matches the predicate we're good!
            return any((self._compare(field_type, sub_val, operator, rval)) for sub_val in lval)
    
        if field_type == "checkbox":
            if operator == "is":
                return lval == rval
            elif operator == "
Raw output
/home/vsts/work/1/s/python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:667: tank_vendor.shotgun_api3.shotgun.ShotgunError: The is operator is not supported on the multi_entity type

Check failure on line 1 in tests/bootstrap_tests/test_resolver.py::TestPipelineLocationFieldPriority::test_pc_uploaded

See this annotation in the file changed.

@azure-pipelines azure-pipelines / tk-core

tests/bootstrap_tests/test_resolver.py::TestPipelineLocationFieldPriority::test_pc_uploaded

self = <tests.bootstrap_tests.test_resolver.TestPipelineLocationFieldPriority testMethod=test_pc_uploaded>

    def test_pc_uploaded(self):
        """
        Test that uploaded zip field is used when no descriptor or path
        """
        uploaded_config_dict = {
            "name": "v1.2.3.zip",
            "url": "https://...",
            "content_type": "application/zip",
            "type": "Attachment",
            "id": 139,
            "link_type": "upload",
        }
        pc = self._create_pc(
            "Primary",
            self._project,
            plugin_ids="foo.*, bar, baz",
            uploaded_config_dict=uploaded_config_dict,
        )
    
        config = self.resolver.resolve_shotgun_configuration(
            pipeline_config_identifier=None,
            fallback_config_descriptor=self.config_1,
            sg_connection=self.mockgun,
>           current_login="john.smith",
        )

tests/bootstrap_tests/test_resolver.py:747: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
python/tank/bootstrap/resolver.py:865: in resolve_shotgun_configuration
    ) = self._filter_pipeline_configurations(pcs)
python/tank/bootstrap/resolver.py:699: in _filter_pipeline_configurations
    for pc in pcs:
python/tank/bootstrap/resolver.py:406: in _get_pipeline_configurations_for_project
    order=[{"field_name": "id", "direction": "asc"}],
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:288: in find
    row for row in self._db[entity_type].values()
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:290: in <listcomp>
    entity_type, row, resolved_filters, filter_operator, retired_only
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:821: in _row_matches_filters
    return all(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:821: in <genexpr>
    return all(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:743: in _row_matches_filter
    return self._row_matches_filters(entity_type, row, rval, operator, retired_only)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:823: in _row_matches_filters
    return any(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:823: in <genexpr>
    return any(self._row_matches_filter(entity_type, row, filter, retired_only) for filter in filters)
python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:764: in _row_matches_filter
    return self._compare(field_type, lval, operator, rval)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tank_vendor.shotgun_api3.lib.mockgun.mockgun.Shotgun object at 0x7fe82fee46d0>
field_type = 'multi_entity', lval = [], operator = 'is', rval = None

    def _compare(self, field_type, lval, operator, rval):
        """
        Compares a field using the operator and value provide by the filter.
    
        :param str field_type: Type of the field we are operating on.
        :param lval: Value inside that field. Can be of any type: datetime, date, int, str, bool, etc.
        :param str operator: Name of the operator to use.
        :param rval: The value following the operator in a filter.
    
        :returns: The result of the operator that was applied.
        :rtype: bool
        """
        # If we have a list of scalar values
        if isinstance(lval, list) and field_type != "multi_entity":
            # Compare each one. If one matches the predicate we're good!
            return any((self._compare(field_type, sub_val, operator, rval)) for sub_val in lval)
    
        if field_type == "checkbox":
            if operator == "is":
                return lval == rval
            elif operator == "is_not":
                return lval != rval
  
Raw output
/home/vsts/work/1/s/python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py:667: tank_vendor.shotgun_api3.shotgun.ShotgunError: The is operator is not supported on the multi_entity type