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

Increase code coverage to 100% for generated types #1035

Closed
parthea opened this issue Oct 16, 2021 · 6 comments
Closed

Increase code coverage to 100% for generated types #1035

parthea opened this issue Oct 16, 2021 · 6 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@parthea
Copy link
Contributor

parthea commented Oct 16, 2021

See build log here which shows coverage is missing for network_security.py at lines 18-23 here.

google/cloud/network_security_v1beta1/types/network_security.py 2 2 0 0 0% 18-23

The specific lines are

__protobuf__ = proto.module(
    package="google.cloud.networksecurity.v1beta1", manifest={},
)


__all__ = tuple(sorted(__protobuf__.manifest))
@parthea parthea added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Oct 16, 2021
@parthea parthea changed the title Increase code coverage to 100% for python-network-security Increase code coverage to 100% for generated types Oct 16, 2021
@parthea
Copy link
Contributor Author

parthea commented Oct 16, 2021

I see the same issue in python-os-config. See build log here which shows coverage is missing for osconfig_service.py here, osconfig_zonal_service.py here and osconfig_zonal_service.py here.

@busunkim96
Copy link
Contributor

It looks like there are no types in any of those files... I wonder why they were generated

@parthea
Copy link
Contributor Author

parthea commented Oct 27, 2021

@software-dov Please could you take a look to understand the level of difficulty of this one?

@parthea
Copy link
Contributor Author

parthea commented Oct 29, 2021

This issue appears to be resolved.

@parthea parthea closed this as completed Oct 29, 2021
@busunkim96
Copy link
Contributor

Out of curiosity, what fixed this? Did the coverage rise to 100% with the most recent release?

@parthea
Copy link
Contributor Author

parthea commented Nov 3, 2021

I'm not sure exactly. The files without types disappeared from the coverage list, which is the desired behaviour.

In the snippet below google/cloud/network_security_v1beta1/types/network_security.py had 0% coverage and then completely disappeared from the coverage list.

Before

Name                                                                                         Stmts   Miss Branch BrPart  Cover   Missing
----------------------------------------------------------------------------------------------------------------------------------------
google/cloud/network_security_v1beta1/__init__.py                                               29      0      0      0   100%
google/cloud/network_security_v1beta1/services/__init__.py                                       0      0      0      0   100%
google/cloud/network_security_v1beta1/services/network_security/__init__.py                      3      0      0      0   100%
google/cloud/network_security_v1beta1/services/network_security/async_client.py                263      0     78      0   100%
google/cloud/network_security_v1beta1/services/network_security/client.py                      378      0    142      0   100%
google/cloud/network_security_v1beta1/services/network_security/pagers.py                      121      0     30      0   100%
google/cloud/network_security_v1beta1/services/network_security/transports/__init__.py           9      0      0      0   100%
google/cloud/network_security_v1beta1/services/network_security/transports/base.py             104      0     12      0   100%
google/cloud/network_security_v1beta1/services/network_security/transports/grpc.py             134      0     46      0   100%
google/cloud/network_security_v1beta1/services/network_security/transports/grpc_asyncio.py     137      0     46      0   100%
google/cloud/network_security_v1beta1/types/__init__.py                                          6      0      0      0   100%
google/cloud/network_security_v1beta1/types/authorization_policy.py                             52      0      0      0   100%
google/cloud/network_security_v1beta1/types/client_tls_policy.py                                36      0      0      0   100%
google/cloud/network_security_v1beta1/types/common.py                                           12      0      0      0   100%
google/cloud/network_security_v1beta1/types/network_security.py                                  2      2      0      0     0%   18-23
google/cloud/network_security_v1beta1/types/server_tls_policy.py                                38      0      0      0   100%
google/cloud/network_security_v1beta1/types/tls.py                                              13      0      0      0   100%
tests/unit/__init__.py                                                                           0      0      0      0   100%
tests/unit/gapic/__init__.py                                                                     0      0      0      0   100%
tests/unit/gapic/network_security_v1beta1/__init__.py                                            0      0      0      0   100%
tests/unit/gapic/network_security_v1beta1/test_network_security.py                            1908      0     52      0   100%
----------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                         3245      2    406      0    99%

After

----------------------------------------------------------------------------------------------------------------------------------------
google/cloud/network_security_v1beta1/__init__.py                                               29      0      0      0   100%
google/cloud/network_security_v1beta1/services/__init__.py                                       0      0      0      0   100%
google/cloud/network_security_v1beta1/services/network_security/__init__.py                      3      0      0      0   100%
google/cloud/network_security_v1beta1/services/network_security/async_client.py                264      0     78      0   100%
google/cloud/network_security_v1beta1/services/network_security/client.py                      379      0    142      0   100%
google/cloud/network_security_v1beta1/services/network_security/pagers.py                      121      0     30      0   100%
google/cloud/network_security_v1beta1/services/network_security/transports/__init__.py           9      0      0      0   100%
google/cloud/network_security_v1beta1/services/network_security/transports/base.py              91      0     10      0   100%
google/cloud/network_security_v1beta1/services/network_security/transports/grpc.py             134      0     46      0   100%
google/cloud/network_security_v1beta1/services/network_security/transports/grpc_asyncio.py     136      0     46      0   100%
google/cloud/network_security_v1beta1/types/__init__.py                                          6      0      0      0   100%
google/cloud/network_security_v1beta1/types/authorization_policy.py                             52      0      0      0   100%
google/cloud/network_security_v1beta1/types/client_tls_policy.py                                36      0      0      0   100%
google/cloud/network_security_v1beta1/types/common.py                                           12      0      0      0   100%
google/cloud/network_security_v1beta1/types/server_tls_policy.py                                38      0      0      0   100%
google/cloud/network_security_v1beta1/types/tls.py                                              13      0      0      0   100%
tests/unit/__init__.py                                                                           0      0      0      0   100%
tests/unit/gapic/__init__.py                                                                     0      0      0      0   100%
tests/unit/gapic/network_security_v1beta1/__init__.py                                            0      0      0      0   100%
tests/unit/gapic/network_security_v1beta1/test_network_security.py                            1881      0     52      0   100%
----------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                         3204      0    404      0   100%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants