Skip to content

Simplify test_package_generation. - #650

Open
samcunliffe wants to merge 1 commit into
mainfrom
sc/remove-regression-test-data-and-simplify
Open

samcunliffe wants to merge 1 commit into
mainfrom
sc/remove-regression-test-data-and-simplify

Conversation

@samcunliffe

@samcunliffe samcunliffe commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

I would very much like to get rid of the complete duplication of the {{cookiecutter.project_slug}} directory.

This proposal massively simplifies test_package_generation and removes the regression data.

And remove the regression test + regression data.
@samcunliffe

Copy link
Copy Markdown
Member Author
Screenshot 2026-10-07 at 14 15 35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused assertions match fixture defaults, installation and documentation-build tests remain intact, and static review identified no blocking issues.

Review effort: Balanced
Findings: None

What changed in this PR

Simplifies Cookiecutter generation testing by replacing full snapshot comparisons with focused checks, removing duplicated generated-project data.

Changes:

  • Checks generation success, required files, and selected rendered values.
  • Removes snapshot comparison and automatic fixture replacement.
  • Deletes the stored reference project.
File Description
tests/​test_package_generation.py Replaces snapshot comparison with focused assertions.
tests/​data/​test_package_generation/​tests/​test_dummy.py Removes reference test.
tests/​data/​test_package_generation/​src/​cookiecutter_test/​__init__.py Removes reference package source.
tests/​data/​test_package_generation/​README.md Removes reference README.
tests/​data/​test_package_generation/​pyproject.toml Removes reference project configuration.
tests/​data/​test_package_generation/​mkdocs.yml Removes reference documentation configuration.
tests/​data/​test_package_generation/​LICENSE.md Removes reference license.
tests/​data/​test_package_generation/​docs/​LICENSE.md Removes reference license page.
tests/​data/​test_package_generation/​docs/​index.md Removes reference overview page.
tests/​data/​test_package_generation/​docs/​api.md Removes reference API page.
tests/​data/​test_package_generation/​CITATION.cff Removes reference citation metadata.
tests/​data/​test_package_generation/​.pre-commit-config.yaml Removes reference hook configuration.
tests/​data/​test_package_generation/​.markdownlint.yaml Removes reference Markdown lint configuration.
tests/​data/​test_package_generation/​.gitignore Removes reference ignore rules.
tests/​data/​test_package_generation/​.github/​workflows/​tests.yml Removes reference test workflow.
tests/​data/​test_package_generation/​.github/​workflows/​linting.yml Removes reference lint workflow.
tests/​data/​test_package_generation/​.github/​workflows/​docs.yml Removes reference documentation workflow.
tests/​data/​test_package_generation/​.github/​schemas/​github-issue-forms.json Removes reference issue-form schema.
tests/​data/​test_package_generation/​.github/​ISSUE_TEMPLATE/​question.yml Removes reference question form.
tests/​data/​test_package_generation/​.github/​ISSUE_TEMPLATE/​feature_request.yml Removes reference feature-request form.
tests/​data/​test_package_generation/​.github/​ISSUE_TEMPLATE/​documentation.yml Removes reference documentation form.
tests/​data/​test_package_generation/​.github/​ISSUE_TEMPLATE/​config.yml Removes reference issue configuration.
tests/​data/​test_package_generation/​.github/​ISSUE_TEMPLATE/​bug_report.yml Removes reference bug-report form.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@samcunliffe
samcunliffe requested review from a team and paddyroddy October 7, 2026 13:19
@samcunliffe samcunliffe self-assigned this Oct 7, 2026
@samcunliffe samcunliffe added the enhancement New feature or request label Oct 7, 2026
@samcunliffe
samcunliffe marked this pull request as ready for review October 7, 2026 13:19
@paddyroddy

Copy link
Copy Markdown
Member
Screenshot 2026-10-07 at 14 15 35

Crazy levels. Consider me intrigued.

@paddyroddy paddyroddy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine, but this is not as thorough as before. Maybe this isn't a problem, but previously we were checking every file.

@samcunliffe

samcunliffe commented Oct 9, 2026 •

Copy link
Copy Markdown
Member Author

Code looks fine, but this is not as thorough as before. Maybe this isn't a problem, but previously we were checking every file.

Right. I guess that's my proposal. We want to ensure that the template generation works (the most important thing) and for that we don't need every single file to regress against.

To my knowledge we've never caught a bug with the regression test that wouldn't have been caught with a simpler thing like this.

@paddyroddy

Copy link
Copy Markdown
Member

So it looks like the initial intent was because there was a mismatch in pyproject.toml configuration #329. So I guess the question is whether we are certain that every file we're currently checking is sufficient or not.

@samcunliffe

Copy link
Copy Markdown
Member Author

So it looks like the initial intent was because there was a mismatch in pyproject.toml configuration #329. So I guess the question is whether we are certain that every file we're currently checking is sufficient or not.

I think a check that the pyproject.toml is valid toml should suffice. And we do that because we lint the template. We could add a uv sync step that checks the cookiecut template is installable?

@paddyroddy

Copy link
Copy Markdown
Member

I like that idea

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants