Skip to content

feat: add Makefile target to test sample projects with gfp test#172

Merged
ThomasPluck merged 2 commits into
mainfrom
fix/test-sample-projects
May 23, 2026
Merged

feat: add Makefile target to test sample projects with gfp test#172
ThomasPluck merged 2 commits into
mainfrom
fix/test-sample-projects

Conversation

@joamatab
Copy link
Copy Markdown
Contributor

@joamatab joamatab commented May 23, 2026

Summary

  • Add test-gfp-projects Makefile target that runs gfp test inside each sample project
  • Ensures all cells in sample projects are tested

Sample projects tested:

  • ihp-gdsfactory--sample-projects/ihp--public--project

Usage:

make test-gfp-projects

Test plan

  • Run make test-gfp-projects and verify all tests pass

Summary by Sourcery

New Features:

  • Introduce a test-gfp-projects Makefile target that executes gfp test within the ihp public sample project.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 23, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a new Makefile target to run gfp test across the sample project, ensuring sample project cells are covered by tests via a consistent command.

Flow diagram for new test-gfp-projects Makefile target

flowchart TD
    A[Developer runs
make test-gfp-projects] --> B[Makefile target
test-gfp-projects]
    B --> C[cd ihp-gdsfactory--sample-projects/ihp--public--project]
    C --> D[uv run --directory CURDIR gfp test]
    D --> E[Sample project cells
tested via gfp]
Loading

File-Level Changes

Change Details Files
Introduce a Makefile target to run gfp tests in the sample project.
  • Add test-gfp-projects target that cds into the sample project directory and runs uv run --directory $(CURDIR) gfp test
  • Ensure sample project tests can be triggered via make test-gfp-projects from repo root
Makefile

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider marking test-gfp-projects as a .PHONY target to avoid any ambiguity if a file or directory with that name appears in the repo.
  • If you expect to add more sample projects, it might be cleaner to define a variable containing the project paths and iterate over them in test-gfp-projects rather than hardcoding a single cd.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider marking `test-gfp-projects` as a `.PHONY` target to avoid any ambiguity if a file or directory with that name appears in the repo.
- If you expect to add more sample projects, it might be cleaner to define a variable containing the project paths and iterate over them in `test-gfp-projects` rather than hardcoding a single `cd`.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new test-gfp-projects target to the Makefile to automate testing for sample projects. A high-severity issue was identified in the implementation where the --directory $(CURDIR) flag incorrectly forces the command to run in the root directory, negating the intended directory change. The reviewer provided suggestions to correctly target the sample project directory or use a loop to handle multiple projects.

Comment thread Makefile
uv run pytest -s --force-regen

test-gfp-projects:
cd ihp-gdsfactory--sample-projects/ihp--public--project && uv run --directory $(CURDIR) gfp test
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The current command incorrectly runs gfp test in the root directory instead of the sample project directory. The --directory $(CURDIR) flag instructs uv to change the working directory to the root of the repository (where the main Makefile is located) before executing the command, which negates the cd and causes gfp test to run on the main project.

To correctly test the sample project, you should point uv to the sample project's directory.

If you intend to support multiple sample projects in the future (as suggested by the target name and description), you might consider using a loop:

test-gfp-projects:
	@for dir in ihp-gdsfactory--sample-projects/*/ ; do \
		if [ -f "$$dir/pyproject.toml" ]; then \
			uv run --directory $$dir gfp test; \
		fi \
	done
test-gfp-projects:
	uv run --directory ihp-gdsfactory--sample-projects/ihp--public--project gfp test

@ThomasPluck ThomasPluck merged commit b2e16cb into main May 23, 2026
8 checks passed
@ThomasPluck ThomasPluck deleted the fix/test-sample-projects branch May 23, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants