Skip to content

tests.utils.sql.py: Add a dummy Postgresql to prevent import error

Zehao Chen requested to merge zchen723/fix-postgres-tests into master

Before raising this MR, consider whether the following are required, and complete if so:

  • Unit tests
  • Metrics
  • Documentation update(s)

If not required, please explain in brief why not.

Description

This short MR fixes a small issue when unit tests are executed on an environment without postgres installed. Without the fix, the Postgresql var is not created so attempted imports would fail.

e.g., https://gitlab.com/BuildGrid/buildgrid/-/blob/293efb9acff01f54bd64d6bb03b5f3f2c6240290/tests/sql/test_sql_provider.py#L14

Edited by Zehao Chen

Merge request reports