Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Tests failing for version 3.9.0 #433

Closed
major opened this issue May 31, 2022 · 3 comments
Closed

Tests failing for version 3.9.0 #433

major opened this issue May 31, 2022 · 3 comments
Assignees
Labels
api: cloudasset Issues related to the googleapis/python-asset API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@major
Copy link

major commented May 31, 2022

Environment details

  • OS type and version: Fedora 35
  • Python version: 3.10.4
  • pip version: 21.2.3
  • google-cloud-asset version: 3.9.0

Steps to reproduce

  1. Build google-cloud-asset in an RPM package
  2. Run the tests
  3. Tests fail to run

Stack trace

The tests seem to fail for google-cloud-asset (and quite a few other Google Cloud packages) in the same way:

tests/unit/gapic/asset_v1p5beta1/test_asset_service.py:37: in <module>
    from google.cloud.asset_v1p5beta1.services.asset_service import AssetServiceAsyncClient
../../BUILDROOT/python-google-cloud-asset-3.9.0-1.fc35.noarch/usr/lib/python3.10/site-packages/google/cloud/asset_v1p5beta1/__init__.py:17: in <module>
    from .services.asset_service import AssetServiceClient
../../BUILDROOT/python-google-cloud-asset-3.9.0-1.fc35.noarch/usr/lib/python3.10/site-packages/google/cloud/asset_v1p5beta1/services/asset_service/__init__.py:16: in <module>
    from .client import AssetServiceClient
../../BUILDROOT/python-google-cloud-asset-3.9.0-1.fc35.noarch/usr/lib/python3.10/site-packages/google/cloud/asset_v1p5beta1/services/asset_service/client.py:37: in <module>
    from google.cloud.asset_v1p5beta1.services.asset_service import pagers
../../BUILDROOT/python-google-cloud-asset-3.9.0-1.fc35.noarch/usr/lib/python3.10/site-packages/google/cloud/asset_v1p5beta1/services/asset_service/pagers.py:27: in <module>
    from google.cloud.asset_v1p5beta1.types import asset_service
../../BUILDROOT/python-google-cloud-asset-3.9.0-1.fc35.noarch/usr/lib/python3.10/site-packages/google/cloud/asset_v1p5beta1/types/__init__.py:16: in <module>
    from .asset_service import (
../../BUILDROOT/python-google-cloud-asset-3.9.0-1.fc35.noarch/usr/lib/python3.10/site-packages/google/cloud/asset_v1p5beta1/types/asset_service.py:18: in <module>
    from google.cloud.asset_v1p5beta1.types import assets as gca_assets
../../BUILDROOT/python-google-cloud-asset-3.9.0-1.fc35.noarch/usr/lib/python3.10/site-packages/google/cloud/asset_v1p5beta1/types/assets.py:19: in <module>
    from google.iam.v1 import policy_pb2  # type: ignore
/usr/lib/python3.10/site-packages/google/iam/v1/policy_pb2.py:39: in <module>
    _POLICY = DESCRIPTOR.message_types_by_name["Policy"]
E   AttributeError: 'NoneType' object has no attribute 'message_types_by_name'

There's a full build log in Fedora's Koji buildsystem.

Thank you!

@product-auto-label product-auto-label bot added the api: cloudasset Issues related to the googleapis/python-asset API. label May 31, 2022
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jun 2, 2022
@vam-google
Copy link
Contributor

@major How do you run the tests? Looking at the log seems like you are running them directly via pytest /usr/bin/pytest --disable-warnings tests/unit. This repo, as well as all other googleapis/python-* repos are designed to run its unit tests using nox. Please check contents of https://github.com/googleapis/python-asset/blob/main/noxfile.py for more details.

@vam-google vam-google added type: question Request for information or clarification. Not an issue. priority: p3 Desirable enhancement or fix. May not be included in next release. and removed triage me I really want to be triaged. labels Jun 3, 2022
@major
Copy link
Author

major commented Jun 3, 2022

I'm using pytest for tests because I'm building this as an RPM package for Fedora and CentOS. I can only use what's packaged on the system during the build and I can't pull in any external dependencies.

It looks like I wan into an issue with the combination of grpc-google-iam-v1 that did not work with the version of protobuf/grpc packaged in Fedora 35. Once I had the following two packages built, python-asset tests worked just fine:

  • python-grpc-google-iam-v1 0.12.3
  • python-google-cloud-access-context-manager 0.1.9

If I update either of those two packages to a newer one, the tests break with the errors shown above.

At the moment, I have a working solution, so feel free to close this if it's not a concern.

@vam-google
Copy link
Contributor

Ok, closing. Thanks for you update!

@vam-google vam-google self-assigned this Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: cloudasset Issues related to the googleapis/python-asset API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants