Skip to content

ci(blueprint): add Python linting and unit tests to PR workflow#462

Closed
Bortlesboat wants to merge 0 commit intoNVIDIA:mainfrom
Bortlesboat:ci/blueprint-python-tests
Closed

ci(blueprint): add Python linting and unit tests to PR workflow#462
Bortlesboat wants to merge 0 commit intoNVIDIA:mainfrom
Bortlesboat:ci/blueprint-python-tests

Conversation

@Bortlesboat
Copy link
Copy Markdown

@Bortlesboat Bortlesboat commented Mar 20, 2026

Summary

The PR CI workflow only runs JavaScript/TypeScript tests — the Python blueprint code has no CI coverage. This adds a test-blueprint job to .github/workflows/pr.yaml that:

  • Installs Python + uv via astral-sh/setup-uv@v6
  • Runs ruff check and ruff format --check on the blueprint
  • Runs pytest tests/ -v using the test extra from pyproject.toml

Also adds make test / make test-py targets to both root and blueprint Makefiles for local parity with CI.

Companion to #460 which adds the test suite itself.

Changes

  • .github/workflows/pr.yaml — new test-blueprint job (5 min timeout)
  • Makefile — add test and test-py phony targets
  • nemoclaw-blueprint/Makefile — add test phony target

Test plan

  • Workflow YAML is valid (checked with actionlint patterns)
  • make test-py runs locally and passes
  • No changes to production code

Summary by CodeRabbit

  • Chores
    • Added a CI job to run Python code-quality checks and unit tests as part of pull-request validation.
    • Added and registered Makefile targets to allow running the project’s test suite from the top-level and blueprint subproject, streamlining local and CI test execution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

Added CI and Makefile testing targets: a new GitHub Actions job test-blueprint sets up Python (uv, 3.12), runs ruff checks and pytest inside nemoclaw-blueprint; root and nemoclaw-blueprint Makefiles gained test targets to invoke that pytest command.

Changes

Cohort / File(s) Summary
CI Testing Job
\.github/workflows/pr.yaml
Added test-blueprint job (runs on ubuntu-latest, 5m timeout) that checks out the repo, sets up uv/Python 3.12 via astral-sh/setup-uv, runs ruff check . and ruff format --check ., then runs tests with uv run --extra test pytest tests/ -v in the nemoclaw-blueprint working directory.
Root Makefile Targets
Makefile
Added phony targets test and test-py; test depends on test-py and prints All tests passed.; test-py runs cd nemoclaw-blueprint && $(MAKE) test.
Blueprint Makefile
nemoclaw-blueprint/Makefile
Added test target and added test to .PHONY; test runs uv run --extra test pytest tests/ -v.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through code and CI light,
Added tests to keep things right,
Ruff and pytest, a tidy pair,
I nudged the Make and Actions there —
Hooray for passing checks tonight! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding Python linting and unit tests to the PR workflow for the blueprint code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can validate your CodeRabbit configuration file in your editor.

If your editor has YAML language server, you can enable auto-completion and validation by adding # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/pr.yaml:
- Around line 54-67: The Install uv step using the astral-sh/setup-uv@v6 action
does not pin a Python interpreter; update the "Install uv" job step to include
the python-version input (e.g., python-version: '3.11.x' or a specific patch
like '3.11.4') so the setup-uv action installs a deterministic Python runtime;
modify the action invocation for astronomal-sh/setup-uv@v6 in the "Install uv"
step to include that python-version input.

In `@nemoclaw-blueprint/Makefile`:
- Around line 14-15: Update the Makefile test target to invoke the same command
used by CI: replace the current python -m pytest invocation in the test target
with uv run --extra test pytest tests/ -v so local runs match CI; modify the
"test" target in the Makefile to call uv run --extra test pytest tests/ -v
(keeping the target name "test") ensuring developers without a global pytest
still run tests via the project's uv environment.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c79ea357-c609-46ad-952c-0e6eb2d3c18a

📥 Commits

Reviewing files that changed from the base of the PR and between dbfd78c and 506a6cf.

📒 Files selected for processing (3)
  • .github/workflows/pr.yaml
  • Makefile
  • nemoclaw-blueprint/Makefile

Comment thread .github/workflows/pr.yaml Outdated
Comment thread nemoclaw-blueprint/Makefile Outdated
@wscurran wscurran added the CI/CD Use this label to identify issues with NemoClaw CI/CD pipeline or GitHub Actions. label Mar 20, 2026
@wscurran
Copy link
Copy Markdown
Contributor

Thanks for adding Python linting and unit tests to the PR workflow, this can help ensure the Python code is correct and stable.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
nemoclaw-blueprint/Makefile (1)

1-1: Consider resolving checkmake’s all/clean phony warnings.

Line 1 still triggers checkmake minphony warnings for missing all and clean. If this rule is enforced, adding lightweight targets (or adjusting checkmake config) will keep Makefile lint clean.

Possible Makefile adjustment
-.PHONY: lint format check test
+.PHONY: all clean lint format check test
+
+all: check
+
+clean:
+	`@true`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nemoclaw-blueprint/Makefile` at line 1, The Makefile currently declares
.PHONY: lint format check test but checkmake warns about missing phony targets
all and clean; add lightweight targets named all and clean and include them in
the .PHONY line so the linter stops complaining. For example, add an all: target
that depends on a sensible default like check or test (e.g., all: check) and a
minimal clean: target that removes generated artifacts or is a no-op (e.g.,
clean: ; `@echo` "nothing to clean") and update .PHONY to: .PHONY: all clean lint
format check test to reference the unique symbols (.PHONY, all, clean, lint,
format, check, test).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@nemoclaw-blueprint/Makefile`:
- Line 1: The Makefile currently declares .PHONY: lint format check test but
checkmake warns about missing phony targets all and clean; add lightweight
targets named all and clean and include them in the .PHONY line so the linter
stops complaining. For example, add an all: target that depends on a sensible
default like check or test (e.g., all: check) and a minimal clean: target that
removes generated artifacts or is a no-op (e.g., clean: ; `@echo` "nothing to
clean") and update .PHONY to: .PHONY: all clean lint format check test to
reference the unique symbols (.PHONY, all, clean, lint, format, check, test).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7fe74edc-577f-406e-b6d3-a6727e33feb9

📥 Commits

Reviewing files that changed from the base of the PR and between 506a6cf and 54a8b4e.

📒 Files selected for processing (2)
  • .github/workflows/pr.yaml
  • nemoclaw-blueprint/Makefile
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/pr.yaml

@Bortlesboat
Copy link
Copy Markdown
Author

Thanks @wscurran! Addressed the CodeRabbit feedback in the latest commit — pinned Python 3.12 and matched the Makefile test target to CI. Happy to add the /\ phony targets too if you'd like, though it's cosmetic.

@wscurran
Copy link
Copy Markdown
Contributor

Thanks for adding Python linting and unit tests to the PR workflow — the blueprint CI coverage is important. The CI configuration has changed significantly since March. Could you rebase against main and verify the workflow additions still fit the current CI structure? Note this is from the same contributor as #460 — a joint rebase on both would be ideal.

@wscurran wscurran added the status: needs-info For issues/PRs that lack a description. (Signals to the author that more detail is required). label Apr 14, 2026
@Bortlesboat Bortlesboat force-pushed the ci/blueprint-python-tests branch from ae332b3 to 230d27e Compare April 14, 2026 02:45
@Bortlesboat
Copy link
Copy Markdown
Author

Rebased this branch to current main on April 13, 2026 and re-checked it against the live CI layout.

The March test-blueprint addition no longer fits the repo:

  • current .github/workflows/pr.yaml has been restructured
  • nemoclaw-blueprint/ is YAML-only on main
  • the target files from this PR (nemoclaw-blueprint/Makefile and nemoclaw-blueprint/pyproject.toml) no longer exist on main

I refreshed this branch and companion PR #460 to current main; that leaves both PRs with an empty diff, so this one is superseded by upstream changes.

@wscurran wscurran added status: rebase PR needs to be rebased against main before review can continue and removed status: needs-info For issues/PRs that lack a description. (Signals to the author that more detail is required). labels Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Use this label to identify issues with NemoClaw CI/CD pipeline or GitHub Actions. status: rebase PR needs to be rebased against main before review can continue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants