Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve test coverage#462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
tony wants to merge128 commits intomaster
base:master
Choose a base branch
Loading
fromimprove-test-coverage
Open
Changes from1 commit
Commits
Show all changes
128 commits
Select commitHold shift + click to select a range
1225314
pkg: Add `py.typed` file
tonyMar 9, 2025
105a1b6
py(deps) Add `pydantic` for typed, intuitive validation
tonyMar 8, 2025
90c6c80
notes(about[2025-03-08]) Add about
tonyMar 8, 2025
c5ce495
notes(test-audit[2025-03-08]) Add test-audit file
tonyMar 8, 2025
173f3df
notes(test-audit[2025-03-08]) More notes
tonyMar 8, 2025
6bc9624
cursor(rules[notes-llms-txt]) Add rules for note generation
tonyMar 8, 2025
ae0f614
notes(test-audit[2025-03-08]) Add test-audit test plan file
tonyMar 8, 2025
a9e87c3
!squash more examples for test plan
tonyMar 8, 2025
4dbab51
!squash more
tonyMar 8, 2025
d9d1561
!squash
tonyMar 8, 2025
f308c41
notes(test-audit[2025-03-08]) Update test-audit test plan file
tonyMar 8, 2025
d92946f
notes(TODO) Add file
tonyMar 8, 2025
e645f31
feat(models): Add Pydantic models and update validator to use them
tonyMar 8, 2025
26c37a0
!squash more
tonyMar 8, 2025
fa617f2
!squash More
tonyMar 8, 2025
581d997
!squash remove notes for pydantic
tonyMar 8, 2025
bb879cd
notes(TODO) Update to most recent
tonyMar 8, 2025
fc4cea3
notes(test-audit[2025-03-08]) Update test-audit plan file
tonyMar 8, 2025
4a699be
notes(test-audit): Update test plan and TODO to reflect Pydantic impl…
tonyMar 8, 2025
9e3e610
Update todo
tonyMar 8, 2025
cd7beef
notes: Add test-coverage
tonyMar 8, 2025
2cfb459
!squash notes test-coverage.md
tonyMar 8, 2025
4f3a888
!squash more test-coverage notes
tonyMar 8, 2025
6f382c3
!squash more test-coverage notes
tonyMar 8, 2025
0f1f6b5
!squash more
tonyMar 9, 2025
a0fb77d
!squash
tonyMar 9, 2025
50e6a09
!squash more
tonyMar 9, 2025
14eb3ed
!squash
tonyMar 9, 2025
279923d
!squash more
tonyMar 9, 2025
3bf1846
notes: Add pydantic-overhaul.md
tonyMar 9, 2025
4575c57
!squash pydantic overhaul
tonyMar 9, 2025
1f0329f
!squash notes pydantic-overhaul.md
tonyMar 9, 2025
fb4c69f
!squash pydantic overhaul
tonyMar 9, 2025
a3aa5e4
notes(pydantic-overhaul) Update document
tonyMar 9, 2025
73bee29
notes(pydantic-overhaul) Update document
tonyMar 9, 2025
5a0485b
notes(pydantic-overhaul) Update document
tonyMar 9, 2025
2207edb
notes(pydantic-overhaul) Update document
tonyMar 9, 2025
d05862b
notes(pydantic-overhaul) Update document
tonyMar 9, 2025
8108447
notes(pydantic-overhaul) Update document
tonyMar 9, 2025
be39738
notes(pydantic-v2) Add document
tonyMar 9, 2025
9dadb13
notes(pydantic-v2) Update document
tonyMar 9, 2025
ac5d131
notes(pydantic-v2) Update document
tonyMar 9, 2025
bc393d3
notes(pydantic-v2) Update document
tonyMar 9, 2025
c49cd44
notes(pydantic-v2) Update document
tonyMar 9, 2025
0bc8fa0
notes(pydantic-v2) Update document
tonyMar 9, 2025
f1de885
notes(pydantic-v2) Update document
tonyMar 9, 2025
4971074
notes(pydantic-v2) Update document
tonyMar 9, 2025
2242a5a
notes(pydantic-v2) Update document
tonyMar 9, 2025
de2ff23
notes(pydantic-v2) Update document
tonyMar 9, 2025
835b861
notes(pydantic-v2) Update document
tonyMar 9, 2025
0c5c652
notes(pydantic-v2) Update document
tonyMar 9, 2025
ad3af4b
notes(pydantic-v2) Update document
tonyMar 9, 2025
ba63d61
notes(pydantic-v2) Update document
tonyMar 9, 2025
73c07e4
notes(pydantic-v2) Update document
tonyMar 9, 2025
d8a6f8d
!squash pydantic v2 notes
tonyMar 9, 2025
1ad57a1
notes/pydantic-overhaul.md
tonyMar 9, 2025
99028e3
!squash more
tonyMar 9, 2025
76563cd
!squash more
tonyMar 9, 2025
57a7d08
!squash more
tonyMar 9, 2025
d937ee6
!squash more
tonyMar 9, 2025
78e9d54
!squash more
tonyMar 9, 2025
d0c69e7
!squash more
tonyMar 9, 2025
1fefcec
!squash
tonyMar 9, 2025
7647ad8
!squash more updates
tonyMar 9, 2025
c0932fc
!squash more
tonyMar 9, 2025
ece359a
!squash more
tonyMar 9, 2025
ad7af19
!squash tests
tonyMar 9, 2025
8c7459a
!squash more ruff strict
tonyMar 9, 2025
8b16cce
!squash more
tonyMar 9, 2025
d64f424
notes(2025-03-09) audit
tonyMar 9, 2025
b16cf30
!squash more audit
tonyMar 9, 2025
72cb23d
!squash more audit
tonyMar 9, 2025
1c471d3
!squash more audit
tonyMar 9, 2025
1203329
!squash audit
tonyMar 9, 2025
086d4a7
notes: proposals
tonyMar 9, 2025
7a86cb0
notes: More
tonyMar 9, 2025
6334d81
!squash more proposals
tonyMar 9, 2025
6a46fdd
!squash more notes
tonyMar 9, 2025
8ced00f
!squash more notes
tonyMar 9, 2025
f4b249b
!squash notes
tonyMar 9, 2025
0e35cef
!squash proposals
tonyMar 9, 2025
8443c7d
notes: Add TODO.md
tonyMar 9, 2025
be67a2a
notes: Move TODO.md -> TODO-old.md
tonyMar 9, 2025
2488c5d
notes: 00 summary update
tonyMar 9, 2025
7f4f241
notes: Add new TODO
tonyMar 9, 2025
0d4ba9e
notes: Remove test audit
tonyMar 9, 2025
4b483b0
notes: Remove TODO-old.md
tonyMar 9, 2025
88372c9
tests,src: Move to *_old dirs
tonyMar 9, 2025
ca26a38
config(feat[models,loader]): Implement modern configuration system wi…
tonyMar 9, 2025
370440f
!squash ruff and mypy fixes
tonyMar 9, 2025
b70ab82
pyproject: Pack src/vcspull/py.typed
tonyMar 9, 2025
f1dc905
notes: Update TODO
tonyMar 9, 2025
9142dad
py(deps[docs]) Add autodoc_pydantic
tonyMar 9, 2025
ff6e554
types+docs(feat[configuration]): Add py.typed marker and Pydantic mod…
tonyMar 9, 2025
fd777bb
notes: Update TODO
tonyMar 9, 2025
3942005
docs: Remove old pages
tonyMar 9, 2025
506c971
docs: New pages
tonyMar 9, 2025
8ae82dc
vcspull(feat[operations]): Implement repository operations API and VC…
tonyMar 9, 2025
50947dd
notes: Update TODO
tonyMar 9, 2025
bf86ea2
vcs(feat[lock]): Implement version locking for repositories
tonyMar 10, 2025
f7a4f78
notes: Update TODO
tonyMar 10, 2025
9f223c8
py(deps[test]) Add `hypothesis`
tonyMar 10, 2025
1af1250
tests(feat[property]): Add property-based testing for configuration m…
tonyMar 10, 2025
106586e
notes: Update notes (progress)
tonyMar 15, 2025
bd059a2
tests/config(test[loader]): Add property-based tests for configuratio…
tonyMar 15, 2025
6a1d19e
!squash tests/config(test[loader]): Add property-based
tonyMar 15, 2025
8881f29
!squash tests/config(test[loader]): Add property-based
tonyMar 15, 2025
29f6fdc
!squash tests/config(test[loader]): Add property-based
tonyMar 15, 2025
ad36b58
!squash tests(feat[property]): Add property-based testin
tonyMar 15, 2025
9ddc8ac
!squash pyproject: Pack src/vcspull/py.typed
tonyMar 15, 2025
d8357b4
!squash config(feat[models,loader]): Implement modern
tonyMar 15, 2025
71057d3
!squash tests(feat[property]): Add property-based testin
tonyMar 15, 2025
2a4f9ed
!squsah config(feat[models,loader]): Implement modern configuration s…
tonyMar 15, 2025
1f036a5
!squash pyproject: Pack src/vcspull/py.typed
tonyMar 15, 2025
d17af4a
squash config(feat[models,loader]): Implement modern co
tonyMar 15, 2025
31be7f3
!squash !squash tests/config(test[loader]): Add property
tonyMar 15, 2025
dd2e882
!squash tests(feat[property]): Add property-based testing for configu…
tonyMar 15, 2025
c4eef7e
!squash config(feat[models,loader]): Implement modern co
tonyMar 15, 2025
d2020b6
!squash tests(feat[property]): Add property-based testing for configu…
tonyMar 15, 2025
db0e617
notes: Update notes
tonyMar 15, 2025
e0a7994
notes: Update notes
tonyMar 15, 2025
f6f8390
notes: Update notes
tonyMar 15, 2025
6aa5795
notes: Update notes
tonyMar 15, 2025
90e36c8
pyproject(mypy) Ignore scripts/ and examples/ for now
tonyMar 15, 2025
2cf02c2
notes: Update notes
tonyMar 15, 2025
eef166c
tests(cli): Implement CLI testing framework
tonyMar 15, 2025
82a8748
config(feat[migration]): Add configuration migration tool
tonyMar 15, 2025
b0522cc
docs: Add migration notes for configuration changes
tonyMar 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
!squash tests/config(test[loader]): Add property-based
  • Loading branch information
@tony
tony committedApr 19, 2025
commit29f6fdcf7ad2983731a51e225695f4e77b0d93a7
63 changes: 23 additions & 40 deletionstests/integration/test_config_system.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,30 +6,13 @@

from __future__ import annotations

import tempfile
from collections.abc import Generator
from pathlib import Path

import pytest
import pathlib

from vcspull.config.loader import load_config, resolve_includes, save_config
from vcspull.config.models import Repository, Settings, VCSPullConfig


@pytest.fixture
def temp_config_dir() -> Generator[Path, None, None]:
"""Create a temporary directory for config files.

Returns
-------
Generator[Path, None, None]
Temporary directory path
"""
with tempfile.TemporaryDirectory() as temp_dir:
yield Path(temp_dir)


def test_complete_config_workflow(temp_config_dir: Path) -> None:
def test_complete_config_workflow(tmp_path: pathlib.Path) -> None:
"""Test the complete configuration workflow from creation to resolution."""
# 1. Create a multi-level configuration setup

Expand All@@ -49,13 +32,13 @@ def test_complete_config_workflow(temp_config_dir: Path) -> None:
Repository(
name="repo1",
url="https://github.com/example/repo1.git",
path=str(temp_config_dir / "repos/repo1"),
path=str(tmp_path / "repos/repo1"),
vcs="git",
),
Repository(
name="repo2",
url="https://github.com/example/repo2.git",
path=str(temp_config_dir / "repos/repo2"),
path=str(tmp_path / "repos/repo2"),
vcs="git",
),
],
Expand All@@ -68,7 +51,7 @@ def test_complete_config_workflow(temp_config_dir: Path) -> None:
Repository(
name="hg-repo1",
url="https://hg.example.org/repo1",
path=str(temp_config_dir / "repos/hg-repo1"),
path=str(tmp_path / "repos/hg-repo1"),
vcs="hg",
),
],
Expand All@@ -80,13 +63,13 @@ def test_complete_config_workflow(temp_config_dir: Path) -> None:
Repository(
name="nested-repo",
url="https://github.com/example/nested-repo.git",
path=str(temp_config_dir / "repos/nested-repo"),
path=str(tmp_path / "repos/nested-repo"),
vcs="git",
),
Repository(
name="svn-repo",
url="svn://svn.example.org/repo",
path=str(temp_config_dir / "repos/svn-repo"),
path=str(tmp_path / "repos/svn-repo"),
vcs="svn",
),
],
Expand All@@ -95,13 +78,13 @@ def test_complete_config_workflow(temp_config_dir: Path) -> None:
# 2. Save all config files

# Create nested directory
nested_dir =temp_config_dir / "nested"
nested_dir =tmp_path / "nested"
nested_dir.mkdir(exist_ok=True)

# Save all configs
base_path =temp_config_dir / "vcspull.yaml"
repos1_path =temp_config_dir / "repos1.yaml"
repos2_path =temp_config_dir / "repos2.yaml"
base_path =tmp_path / "vcspull.yaml"
repos1_path =tmp_path / "repos1.yaml"
repos2_path =tmp_path / "repos2.yaml"
nested_path = nested_dir / "more-repos.yaml"

save_config(base_config, base_path)
Expand DownExpand Up@@ -134,11 +117,11 @@ def test_complete_config_workflow(temp_config_dir: Path) -> None:

# Verify all paths are absolute
for repo in resolved_config.repositories:
assert Path(repo.path).is_absolute()
assertpathlib.Path(repo.path).is_absolute()

# 5. Test saving the resolved config

resolved_path =temp_config_dir / "resolved.yaml"
resolved_path =tmp_path / "resolved.yaml"
save_config(resolved_config, resolved_path)

# 6. Load the saved resolved config and verify
Expand All@@ -152,7 +135,7 @@ def test_complete_config_workflow(temp_config_dir: Path) -> None:
assert len(final_config.repositories) == 5


def test_missing_include_handling(temp_config_dir:Path) -> None:
def test_missing_include_handling(tmp_path: pathlib.Path) -> None:
"""Test that missing includes are handled gracefully."""
# Create a config with a non-existent include
config = VCSPullConfig(
Expand All@@ -161,19 +144,19 @@ def test_missing_include_handling(temp_config_dir: Path) -> None:
Repository(
name="repo1",
url="https://github.com/example/repo1.git",
path=str(temp_config_dir / "repos/repo1"),
path=str(tmp_path / "repos/repo1"),
),
],
includes=["missing.yaml"],
)

# Save the config
config_path =temp_config_dir / "config.yaml"
config_path =tmp_path / "config.yaml"
save_config(config, config_path)

# Load and resolve includes
loaded_config = load_config(config_path)
resolved_config = resolve_includes(loaded_config,temp_config_dir)
resolved_config = resolve_includes(loaded_config,tmp_path)

# The config should still contain the original repository
assert len(resolved_config.repositories) == 1
Expand All@@ -183,15 +166,15 @@ def test_missing_include_handling(temp_config_dir: Path) -> None:
assert len(resolved_config.includes) == 0


def test_circular_include_prevention(temp_config_dir:Path) -> None:
def test_circular_include_prevention(tmp_path: pathlib.Path) -> None:
"""Test that circular includes don't cause infinite recursion."""
# Create configs that include each other
config1 = VCSPullConfig(
repositories=[
Repository(
name="repo1",
url="https://github.com/example/repo1.git",
path=str(temp_config_dir / "repos/repo1"),
path=str(tmp_path / "repos/repo1"),
),
],
includes=["config2.yaml"],
Expand All@@ -202,21 +185,21 @@ def test_circular_include_prevention(temp_config_dir: Path) -> None:
Repository(
name="repo2",
url="https://github.com/example/repo2.git",
path=str(temp_config_dir / "repos/repo2"),
path=str(tmp_path / "repos/repo2"),
),
],
includes=["config1.yaml"], # Creates a circular reference
)

# Save both configs
config1_path =temp_config_dir / "config1.yaml"
config2_path =temp_config_dir / "config2.yaml"
config1_path =tmp_path / "config1.yaml"
config2_path =tmp_path / "config2.yaml"
save_config(config1, config1_path)
save_config(config2, config2_path)

# Load and resolve includes for the first config
loaded_config = load_config(config1_path)
resolved_config = resolve_includes(loaded_config,temp_config_dir)
resolved_config = resolve_includes(loaded_config,tmp_path)

# The repositories might contain duplicates due to circular references
# Get the unique URLs to check if both repos are included
Expand Down

[8]ページ先頭

©2009-2026 Movatter.jp