gapic-generator-python icon indicating copy to clipboard operation
gapic-generator-python copied to clipboard

Add automated checks to golden files using lower-bound-checker from google-cloud-testutils

Open parthea opened this issue 2 years ago • 0 comments

There is a tool to check and update the constraints files which as added in https://github.com/googleapis/python-test-utils/pull/8. See the instructions in https://github.com/googleapis/python-test-utils/pull/8#issue-809740325 for information on running the tool. We could run this check on the golden files to ensure that the versions in testing/constraints-3.*.txt match the minimum version of dependencies in setup.py.

As an example.

(py39) partheniou@partheniou-vm-3:~/git/python-test-utils$ lower-bound-checker update --package-name google-auth-oauthlib  --constraints-file /usr/local/google/home/partheniou/git/google-auth-library-python-oauthlib/testing/constraints-3.7.txt
(py39) partheniou@partheniou-vm-3:~/git/python-test-utils$ lower-bound-checker check --package-name google-auth-oauthlib  --constraints-file /usr/local/google/home/partheniou/git/google-auth-library-python-oauthlib/testing/constraints-3.7.txt
All good!

See https://github.com/googleapis/synthtool/issues/1901 for context.

The check already exists in golden files:

https://github.com/googleapis/gapic-generator-python/blob/4b7701969f8e7c3ec5f23339cf7e9ad76f0dc757/tests/integration/goldens/redis/noxfile.py#L118-L130

We just need to run the nox session here: https://github.com/googleapis/gapic-generator-python/blob/4b7701969f8e7c3ec5f23339cf7e9ad76f0dc757/.github/workflows/tests.yaml#L322-L328

parthea avatar Nov 21 '23 11:11 parthea