googleapis / googleapis/google-cloud-python
testing: unit tests are slow, noisy and make network calls making it very hard to develop offline
- Vorherrschende Sprache
- Python
- Sterne
- 5.4k
- Forks
- 1.8k
- Ø Merge
- 3 T. 4 Std.
- Gemergte PRs (30 T.)
- 122
Beschreibung
It is quite cumbersome and slow developing for this library because even just the unit tests require a bulky setup of fetching dependencies afresh every single time and even worse makes it impossible to properly test. Unit tests should be hermetic in most cases but the experience here is very noisy producing lots of output then requires network calls too.
#### Environment details
- OS type and version: `Darwin Emmanuels-MacBook-Pro-2.local 22.6.0 Darwin Kernel Version 22.6.0: Mon Feb 19 19:48:53 PST 2024; root:xnu-8796.141.3.704.6~1/RELEASE_X86_64 x86_64`
- Python version: `python --version` `Python 3.10.11`
- pip version: `pip --version` `pip 24.2 from /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip (python 3.10)`
- `google-cloud-spanner` version: `pip show google-cloud-spanner`
```shell
Name: google-cloud-spanner
Version: 3.49.1
Summary: Google Cloud Spanner API client library
Home-page: https://github.com/googleapis/python-spanner
Author: Google LLC
Author-email: googleapis-packages@google.com
License: Apache 2.0
Location: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages
Editable project location: /Users/emmanuelodeke/go/src/github.com/googleapis/python-spanner
Requires: google-api-core, google-cloud-core, grpc-google-iam-v1, grpc-interceptor, proto-plus, protobuf, sqlparse
```
#### Steps to reproduce
`nox -s unit-3.7`
#### Stack trace
```
nox > Running session unit-3.7(protobuf_implementation='python')
nox > Creating virtual environment (virtualenv) using python3.7 in .nox/unit-3-7-protobuf_implementation-python
nox > python -m pip install mock asyncmock pytest pytest-cov pytest-asyncio -c /Users/emmanuelodeke/go/src/github.com/googleapis/python-spanner/testing/constraints-3.7.txt
nox > Command python -m pip install mock asyncmock pytest pytest-cov pytest-asyncio -c /Users/emmanuelodeke/go/src/github.com/googleapis/python-spanner/testing/constraints-3.7.txt failed with exit code 1:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/mock/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/mock/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/mock/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/mock/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/mock/
ERROR: Could not find a version that satisfies the requirement mock (from versions: none)
ERROR: No matching distribution found for mock
nox > Session unit-3.7(protobuf_implementation='python') failed.
nox > Running session unit-3.7(protobuf_implementation='upb')
nox > Creating virtual environment (virtualenv) using python3.7 in .nox/unit-3-7-protobuf_implementation-upb
nox > python -m pip install mock asyncmock pytest pytest-cov pytest-asyncio -c /Users/emmanuelodeke/go/src/github.com/googleapis/python-spanner/testing/constraints-3.7.txt
^Cnox > Interrupted...
nox > Session unit-3.7(protobuf_implementation='upb') interrupted.
```
/cc @harshachinta @surbhigarg92
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.