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

Classes

class  TestScopeWorkspace
class  TestScopeProject
class  TestScopeNearest
class  TestInitWorkspaceAware
class  TestBackwardsCompat

Functions

bool _git_available ()
 _git (Path repo, *str args, bool check=True)
subprocess.CompletedProcess _run_ignore (Path cwd, *str extra_args)
subprocess.CompletedProcess _run_init (Path cwd, *str extra_args)
Path _make_subproject (Path parent, str name)
 workspace_with_subproject (Path tmp_path)

Detailed Description

Purpose
-------
Integration tests for the F1.4 workspace-aware ``oct git ignore``
``--scope`` flag and the matching ``oct git init`` workspace-mode
behaviour (which augments the workspace-root ``.gitignore`` with the
manifest's ``ignore_at_workspace_scope[]`` patterns).

Responsibilities
----------------
- ``oct git ignore --scope=workspace`` writes to the workspace
  root's ``.gitignore``, even when invoked from inside a subproject.
- ``oct git ignore --scope=project`` writes to the
  ``project_root``'s ``.gitignore`` (subproject if invoked there;
  workspace root if invoked there).
- ``oct git ignore --scope=nearest`` (the default) targets the
  workspace root when CWD is the workspace root, otherwise the
  subproject's ``.gitignore``.
- ``oct git init`` at workspace scope merges the manifest's
  ``ignore_at_workspace_scope[]`` patterns into the workspace
  ``.gitignore``.

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_ignore._git ( Path repo,
*str args,
bool check = True )
protected

Definition at line 53 of file test_workspace_ignore.py.

Here is the caller graph for this function:

◆ _git_available()

bool tests_git.test_workspace_ignore._git_available ( )
protected

Definition at line 49 of file test_workspace_ignore.py.

Here is the caller graph for this function:

◆ _make_subproject()

Path tests_git.test_workspace_ignore._make_subproject ( Path parent,
str name )
protected

Definition at line 78 of file test_workspace_ignore.py.

Here is the caller graph for this function:

◆ _run_ignore()

subprocess.CompletedProcess tests_git.test_workspace_ignore._run_ignore ( Path cwd,
*str extra_args )
protected

Definition at line 60 of file test_workspace_ignore.py.

Here is the caller graph for this function:

◆ _run_init()

subprocess.CompletedProcess tests_git.test_workspace_ignore._run_init ( Path cwd,
*str extra_args )
protected

Definition at line 69 of file test_workspace_ignore.py.

Here is the caller graph for this function:

◆ workspace_with_subproject()

tests_git.test_workspace_ignore.workspace_with_subproject ( Path tmp_path)
Build a workspace with one subproject for scope tests.

Definition at line 105 of file test_workspace_ignore.py.

Here is the call graph for this function: