pgdevkit 0.7.0__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/PKG-INFO +8 -1
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/README.md +7 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/__init__.py +2 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/api.py +14 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/naming.py +10 -1
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pyproject.toml +1 -1
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_api.py +39 -1
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_naming.py +8 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/uv.lock +1 -1
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/.github/workflows/auto-release.yml +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/.github/workflows/python-publish.yml +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/.github/workflows/python-test.yml +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/.gitignore +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/.python-version +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/docs/database-layout.md +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/__init__.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/areas.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/backends/__init__.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/backends/base.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/backends/mssql.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/backends/postgres.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/cli.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/connection.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/db/__init__.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/db/complex_types.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/db/connection.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/db/crud.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/db/loader.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/db/model.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/db/mssql_crud.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/db/mssql_sql.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/dialect.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/diff.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/envtag.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/fetch_missing.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/introspect.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/lakebase.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/migrate.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/models.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/mssql_introspect.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/parser.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/schemas.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/sql_text.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/_docker.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/config.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/constants.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/container.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/mssql/__init__.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/mssql/api.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/mssql/constants.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/mssql/container.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/query.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/pgdevkit/testdb/schema.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/skills/pgdevkit/SKILL.md +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/skills/pgdevkit/references/dynamic-sql.md +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/skills/pgdevkit/references/temporal-tables.md +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/__init__.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/conftest.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/db/__init__.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/db/test_complex_types.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/db/test_connection.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/db/test_crud.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/db/test_loader.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/db/test_mssql_crud_live.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/db/test_mssql_crud_sql.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/fixtures/01_schema.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/fixtures/02_types.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/fixtures/03_tables.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/fixtures/04_views.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/fixtures/05_functions.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/fixtures/06_indexes.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_areas.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_cli_compare.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_compare.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_compare_mssql_live.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_connection.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_dialect.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_diff_mssql.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_envtag.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_fetch_missing.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_fetch_missing_cli.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_lakebase.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_migrate.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_migrate_areas.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_migrate_env.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_migrate_schemas.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_mssql_introspect.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_parser_areas.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_parser_mssql.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_parser_schemas.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/test_schemas.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/__init__.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/conftest.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/migrations/001_add_gadget_note.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/event.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/event_kind.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/gadget.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/gadget.test_data.json +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/prod_only.prod.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/widget.init.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/widget.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/widget.test_data.json +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/widget_part.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/widget_part_detail.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/types/dimensions.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/types/mood.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/views/a_wrapper_view.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/views/b_base_view.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/permissions/grants.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/schema/app.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database_mssql/app/tables/widget.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database_mssql/app/tables/widget.test_data.json +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database_mssql/app/views/a_wrapper_view.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database_mssql/app/views/b_base_view.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database_mssql/schema/app.sql +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_api_mssql.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_api_mssql_live.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_cli.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_config.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_config_mssql.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_constants.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_container.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_mssql_constants.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_query.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_schema.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_schema_filtering.py +0 -0
- {pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/test_schema_mssql.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pgdevkit
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: A helper for developing with Postgres
|
|
5
5
|
Requires-Python: >=3.14
|
|
6
6
|
Requires-Dist: docker>=7.1.0
|
|
@@ -252,6 +252,13 @@ belongs to a live worktree too:
|
|
|
252
252
|
extra_db_suffixes = ["_myservice"]
|
|
253
253
|
```
|
|
254
254
|
|
|
255
|
+
`pgdevkit.testdb.workspace_db_names(project_root=None)` is the
|
|
256
|
+
single-workspace analog of `find_orphaned_dbs()`: it returns the exact set
|
|
257
|
+
of DB names (main + any `extra_db_suffixes`) owned by the branch currently
|
|
258
|
+
checked out at `project_root`, without touching Postgres or diffing against
|
|
259
|
+
other worktrees. Useful for a caller that's about to remove one specific
|
|
260
|
+
worktree and wants to know exactly which DB(s) go with it.
|
|
261
|
+
|
|
255
262
|
Container connection defaults (`localhost:54322`, `postgres`/`testpwd`) can
|
|
256
263
|
be overridden with `PGDEVKIT_TESTDB_HOST`, `PGDEVKIT_TESTDB_PORT`,
|
|
257
264
|
`PGDEVKIT_TESTDB_USER`, `PGDEVKIT_TESTDB_PASSWORD`. Before touching the
|
|
@@ -231,6 +231,13 @@ belongs to a live worktree too:
|
|
|
231
231
|
extra_db_suffixes = ["_myservice"]
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
+
`pgdevkit.testdb.workspace_db_names(project_root=None)` is the
|
|
235
|
+
single-workspace analog of `find_orphaned_dbs()`: it returns the exact set
|
|
236
|
+
of DB names (main + any `extra_db_suffixes`) owned by the branch currently
|
|
237
|
+
checked out at `project_root`, without touching Postgres or diffing against
|
|
238
|
+
other worktrees. Useful for a caller that's about to remove one specific
|
|
239
|
+
worktree and wants to know exactly which DB(s) go with it.
|
|
240
|
+
|
|
234
241
|
Container connection defaults (`localhost:54322`, `postgres`/`testpwd`) can
|
|
235
242
|
be overridden with `PGDEVKIT_TESTDB_HOST`, `PGDEVKIT_TESTDB_PORT`,
|
|
236
243
|
`PGDEVKIT_TESTDB_USER`, `PGDEVKIT_TESTDB_PASSWORD`. Before touching the
|
|
@@ -189,6 +189,20 @@ def find_orphaned_dbs(project_root: Path | None = None) -> list[str]:
|
|
|
189
189
|
return asyncio.run(_find_orphaned_dbs(config))
|
|
190
190
|
|
|
191
191
|
|
|
192
|
+
def workspace_db_names(project_root: Path | None = None) -> frozenset[str]:
|
|
193
|
+
"""Every DB name this exact workspace (the branch currently checked out
|
|
194
|
+
at `project_root`) owns: its main workspace DB plus one
|
|
195
|
+
`<main>{suffix}` sibling per configured `extra_db_suffixes` entry. The
|
|
196
|
+
single-workspace analog of what `find_orphaned_dbs` computes across
|
|
197
|
+
every *live* worktree -- for a caller that wants "which DBs belong to
|
|
198
|
+
this one worktree right now" (e.g. to drop them before removing the
|
|
199
|
+
worktree itself), as opposed to a whole-project orphan sweep. Engine
|
|
200
|
+
(postgres/mssql) doesn't affect naming, so this doesn't dispatch on it."""
|
|
201
|
+
config = load_config(project_root)
|
|
202
|
+
branch = current_branch(config.root)
|
|
203
|
+
return frozenset(expected_db_names(config, [branch]))
|
|
204
|
+
|
|
205
|
+
|
|
192
206
|
def clean_testdb(project_root: Path | None = None, all: bool = False, orphaned: bool = False) -> None:
|
|
193
207
|
"""Drop this workspace's database. With all=True, drop every database
|
|
194
208
|
belonging to this project (matched by its name-slug prefix), across
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import hashlib
|
|
4
|
+
import os
|
|
4
5
|
import re
|
|
5
6
|
import subprocess
|
|
6
7
|
from pathlib import Path
|
|
@@ -25,7 +26,15 @@ def slugify(value: str) -> str:
|
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
def current_branch(cwd: Path | None = None) -> str:
|
|
28
|
-
"""Return the branch checked out in the git worktree rooted at cwd.
|
|
29
|
+
"""Return the branch checked out in the git worktree rooted at cwd.
|
|
30
|
+
|
|
31
|
+
PGDEVKIT_TESTDB_BRANCH overrides this when set -- lets concurrent CI
|
|
32
|
+
checkouts (which all otherwise resolve to detached-HEAD "HEAD") get
|
|
33
|
+
distinct database names on a shared test-DB container.
|
|
34
|
+
"""
|
|
35
|
+
override = os.environ.get("PGDEVKIT_TESTDB_BRANCH")
|
|
36
|
+
if override:
|
|
37
|
+
return override
|
|
29
38
|
result = subprocess.run(
|
|
30
39
|
["git", "rev-parse", "--abbrev-ref", "HEAD"],
|
|
31
40
|
cwd=cwd,
|
|
@@ -9,7 +9,14 @@ import psycopg
|
|
|
9
9
|
import pytest
|
|
10
10
|
|
|
11
11
|
from pgdevkit.testdb import constants
|
|
12
|
-
from pgdevkit.testdb.api import
|
|
12
|
+
from pgdevkit.testdb.api import (
|
|
13
|
+
clean_testdb,
|
|
14
|
+
ensure_testdb,
|
|
15
|
+
find_orphaned_dbs,
|
|
16
|
+
reset_testdb,
|
|
17
|
+
status,
|
|
18
|
+
workspace_db_names,
|
|
19
|
+
)
|
|
13
20
|
from pgdevkit.testdb.config import load_config
|
|
14
21
|
from pgdevkit.testdb.naming import slugify
|
|
15
22
|
from tests.testdb.conftest import requires_podman
|
|
@@ -204,3 +211,34 @@ def test_find_orphaned_dbs_respects_extra_db_suffixes(
|
|
|
204
211
|
assert find_orphaned_dbs(repo) == [stray_db]
|
|
205
212
|
finally:
|
|
206
213
|
clean_testdb(repo, all=True)
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def test_workspace_db_names_is_just_the_main_db_with_no_extra_suffixes(
|
|
217
|
+
project_factory: Callable[..., Path],
|
|
218
|
+
):
|
|
219
|
+
project = project_factory("wdntest", "main")
|
|
220
|
+
assert workspace_db_names(project) == {status(project)["database"]}
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def test_workspace_db_names_includes_configured_extra_db_suffixes(
|
|
224
|
+
project_factory: Callable[..., Path],
|
|
225
|
+
):
|
|
226
|
+
project = project_factory("wdntest2", "main")
|
|
227
|
+
pyproject = project / "pyproject.toml"
|
|
228
|
+
pyproject.write_text(
|
|
229
|
+
pyproject.read_text(encoding="utf-8").rstrip("\n") + '\nextra_db_suffixes = ["_sibling"]\n',
|
|
230
|
+
encoding="utf-8",
|
|
231
|
+
)
|
|
232
|
+
main_db = status(project)["database"]
|
|
233
|
+
assert workspace_db_names(project) == {main_db, f"{main_db}_sibling"}
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
def test_workspace_db_names_differs_from_a_sibling_worktrees_branch(
|
|
237
|
+
worktree_project_factory: Callable[..., tuple[Path, Callable[[str], Path]]],
|
|
238
|
+
):
|
|
239
|
+
repo, add_worktree = worktree_project_factory("wdntest3")
|
|
240
|
+
feature = add_worktree("feature")
|
|
241
|
+
|
|
242
|
+
assert workspace_db_names(repo) == {status(repo)["database"]}
|
|
243
|
+
assert workspace_db_names(feature) == {status(feature)["database"]}
|
|
244
|
+
assert workspace_db_names(repo) != workspace_db_names(feature)
|
|
@@ -53,6 +53,14 @@ def test_current_branch_reads_the_checked_out_branch(tmp_path: Path):
|
|
|
53
53
|
assert current_branch(tmp_path) == "my-feature"
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
def test_current_branch_env_override_skips_git_entirely(tmp_path: Path, monkeypatch):
|
|
57
|
+
# Not a git repo at all -- the override must short-circuit before the
|
|
58
|
+
# `git rev-parse` subprocess call, which would otherwise raise.
|
|
59
|
+
monkeypatch.setenv("PGDEVKIT_TESTDB_BRANCH", "ci-job-42")
|
|
60
|
+
|
|
61
|
+
assert current_branch(tmp_path) == "ci-job-42"
|
|
62
|
+
|
|
63
|
+
|
|
56
64
|
def _init_repo(repo: Path, initial_branch: str) -> None:
|
|
57
65
|
repo.mkdir()
|
|
58
66
|
subprocess.run(["git", "init", "-q"], cwd=repo, check=True)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/gadget.test_data.json
RENAMED
|
File without changes
|
{pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/prod_only.prod.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/widget.test_data.json
RENAMED
|
File without changes
|
|
File without changes
|
{pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/tables/widget_part_detail.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database/app/views/a_wrapper_view.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database_mssql/app/tables/widget.sql
RENAMED
|
File without changes
|
|
File without changes
|
{pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database_mssql/app/views/a_wrapper_view.sql
RENAMED
|
File without changes
|
{pgdevkit-0.7.0 → pgdevkit-0.7.2}/tests/testdb/fixtures/database_mssql/app/views/b_base_view.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|