Conversation
| # otherwise run all the sessions. | ||
| if [[ -n "${NOX_SESSION:-}" ]]; then | ||
| python3 -m nox -s ${NOX_SESSION:-} | ||
| elif [[ "${RUN_COMPLIANCE_TESTS}" -eq "false" ]]; then |
There was a problem hiding this comment.
This ensures that if RUN_COMPLIANCE_TESTS=false has been set, then we only run the unit tests (and not lint, migration tests, etc.). All of those are covered by GitHub Actions runners.
| env_vars: { | ||
| key: "NOX_SESSION" | ||
| value: "compliance_test_20" | ||
| value: "unit" |
There was a problem hiding this comment.
TODO in a next step: Remove this entire workflow. It is slow and not needed. The tests against the emulator should be enough.
|
|
||
| if USE_EMULATOR: | ||
| database = instance.database("compliance-test") | ||
| database.drop() |
There was a problem hiding this comment.
This ensures that each test really gets a fresh database. SQLAlchemy just ignored AlreadyExists errors that happened when the tests tried to create the same database again on the emulator, which caused some tests to show unpredictable behavior.
Note that database.drop() is a no-op if the database does not exist.
| BLACK_VERSION = "black==22.3.0" | ||
| BLACK_PATHS = ["google", "test", "noxfile.py", "setup.py", "samples"] | ||
| DEFAULT_PYTHON_VERSION = "3.8" | ||
| DEFAULT_PYTHON_VERSION_FOR_SQLALCHEMY_20 = "3.12" |
There was a problem hiding this comment.
Run compliance tests for SQLAlchemy 2.0 on Python 3.12. That is a currently supported version (https://devguide.python.org/versions/)
| zip_safe=False, | ||
| ) | ||
| with warnings.catch_warnings(): | ||
| warnings.simplefilter("ignore") |
There was a problem hiding this comment.
This makes sure that the tests do not fail due to a warning about deprecation being logged.
| cls.ot_exporter = get_test_ot_exporter() | ||
|
|
||
| def teardown(self): | ||
| def teardown_method(self): |
There was a problem hiding this comment.
TODOs in next steps: