Option C Tools
Loading...
Searching...
No Matches
tests_git.test_workspace_commit Namespace Reference

Classes

class  TestOneCommitPerInvocation
class  TestAuditPerSubprojectResults
class  TestWorkspaceFilesUseWorkspaceProfile
class  TestSingleProjectCompat
class  TestEmptyBuckets

Functions

bool _git_available ()
 _git (Path repo, *str args, bool check=True)
subprocess.CompletedProcess _run_commit (Path cwd, *str extra_args)
Path _make_subproject (Path parent, str name, str profile="compact")
None _write_compliant (Path target, str rel_path)
 two_subproject_workspace (Path tmp_path)
dict|None _read_latest_audit (Path repo_root, str command_name)

Variables

str COMPLIANT_TEMPLATE

Detailed Description

Purpose
-------
Integration tests for ``oct git commit`` per-subproject quality-gate
fan-out (F1.3). When a workspace contains multiple subprojects and a
single ``oct git commit`` invocation stages files across them, each
subproject's slice must run under its own profile, the result must
aggregate cleanly, and the actual ``git commit`` must produce one
commit (not one per subproject).

Responsibilities
----------------
- One ``oct git commit`` produces exactly one git commit, even when
  staged files span multiple subprojects.
- A subproject's manifest profile is honoured; per-subproject octrc
  also takes effect.
- Secrets in any subproject still trip the always-blocking G-D4
  invariant.
- Files matching ``workspace_files[]`` are gated by
  ``workspace_profile``, not by any subproject's profile.
- Audit JSONL row carries ``per_subproject_results`` with the right
  shape after a workspace-mode commit.
- Single-project commit (from inside a subproject) is byte-for-byte
  unchanged.

Diagnostics
-----------
Domain: GIT-TESTS
Levels:
    L2 -- test lifecycle
    L3 -- assertion details

Contracts
---------
- All tests use subprocess invocation against ``oct.cli``.
- All tests use tmp_path fixtures so they are automatically cleaned up.

Function Documentation

◆ _git()

tests_git.test_workspace_commit._git ( Path repo,
*str args,
bool check = True )
protected

Definition at line 92 of file test_workspace_commit.py.

Here is the caller graph for this function:

◆ _git_available()

bool tests_git.test_workspace_commit._git_available ( )
protected

Definition at line 88 of file test_workspace_commit.py.

Here is the caller graph for this function:

◆ _make_subproject()

Path tests_git.test_workspace_commit._make_subproject ( Path parent,
str name,
str profile = "compact" )
protected
Build a minimal Option C subproject layout under *parent*/<name>/.

Definition at line 108 of file test_workspace_commit.py.

Here is the caller graph for this function:

◆ _read_latest_audit()

dict | None tests_git.test_workspace_commit._read_latest_audit ( Path repo_root,
str command_name )
protected
Return the newest audit-log row matching *command_name*.

Definition at line 242 of file test_workspace_commit.py.

Here is the caller graph for this function:

◆ _run_commit()

subprocess.CompletedProcess tests_git.test_workspace_commit._run_commit ( Path cwd,
*str extra_args )
protected

Definition at line 99 of file test_workspace_commit.py.

Here is the caller graph for this function:

◆ _write_compliant()

None tests_git.test_workspace_commit._write_compliant ( Path target,
str rel_path )
protected
Write a compliant Python file at *target / rel_path*.

Definition at line 135 of file test_workspace_commit.py.

Here is the caller graph for this function:

◆ two_subproject_workspace()

tests_git.test_workspace_commit.two_subproject_workspace ( Path tmp_path)
Build a workspace with two subprojects (alpha, beta) + initial commit.

Returns ``(ws_root, alpha, beta)``. Both subprojects are committed
in their initial state so further mutations show up cleanly in
``oct git status``.

Definition at line 156 of file test_workspace_commit.py.

Here is the call graph for this function:

Variable Documentation

◆ COMPLIANT_TEMPLATE

str tests_git.test_workspace_commit.COMPLIANT_TEMPLATE

Definition at line 52 of file test_workspace_commit.py.