Skip to content

Add tests folder with nao init#762

Merged
Bl3f merged 1 commit into
mainfrom
codex/init-test-scaffold
May 10, 2026
Merged

Add tests folder with nao init#762
Bl3f merged 1 commit into
mainfrom
codex/init-test-scaffold

Conversation

@ClaireGz
Copy link
Copy Markdown
Contributor

@ClaireGz ClaireGz commented May 10, 2026

Summary

  • Scaffold a starter tests/basic_arithmetic.yml file during nao init.
  • Keep tests/ in .naoignore so local test outputs/data stay out of synced context.
  • Extend init command tests to cover the .naoignore entry and sample test file.

Why

New projects already created a tests/ directory, but it was empty. That left users without a working example for the expected test YAML format.

Validation

  • uv run pytest tests/nao_core/commands/test_init.py
  • uv run ruff check nao_core/commands/init.py tests/nao_core/commands/test_init.py

Fixes #756.

@ClaireGz ClaireGz force-pushed the codex/init-test-scaffold branch from 2c6a554 to 4e1a856 Compare May 10, 2026 10:54
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 10, 2026

🧹 Preview Removed

The preview deployment for this PR has been cleaned up.

@ClaireGz ClaireGz force-pushed the codex/init-test-scaffold branch 2 times, most recently from 773f2d8 to aed2779 Compare May 10, 2026 10:58
@ClaireGz ClaireGz changed the title [codex] Add init test scaffold Add tests folder with nao init May 10, 2026
@ClaireGz ClaireGz force-pushed the codex/init-test-scaffold branch from aed2779 to 794b8d9 Compare May 10, 2026 11:03
@ClaireGz ClaireGz marked this pull request as ready for review May 10, 2026 11:13
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-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.

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="cli/nao_core/commands/init.py">

<violation number="1" location="cli/nao_core/commands/init.py:98">
P2: The newly scaffolded `tests/test_example.yml` is always overwritten on re-init, which can silently erase user changes.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

CreatedFile(path=Path("RULES.md"), content=None),
CreatedFile(path=Path(".naoignore"), content="templates/\n*.j2\ntests/\n"),
CreatedFile(
path=Path("tests/test_example.yml"),
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.

P2: The newly scaffolded tests/test_example.yml is always overwritten on re-init, which can silently erase user changes.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cli/nao_core/commands/init.py, line 98:

<comment>The newly scaffolded `tests/test_example.yml` is always overwritten on re-init, which can silently erase user changes.</comment>

<file context>
@@ -94,6 +94,10 @@ def create_empty_structure(project_path: Path) -> tuple[list[str], list[CreatedF
         CreatedFile(path=Path("RULES.md"), content=None),
         CreatedFile(path=Path(".naoignore"), content="templates/\n*.j2\ntests/\n"),
+        CreatedFile(
+            path=Path("tests/test_example.yml"),
+            content=("name: test_example\nprompt: What is the result of 1+1?\nsql: |\n  SELECT 2 AS answer_integer\n"),
+        ),
</file context>

@Bl3f Bl3f merged commit bfc8015 into main May 10, 2026
5 checks passed
@Bl3f Bl3f deleted the codex/init-test-scaffold branch May 10, 2026 17:00
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.

[feature] nao init should create a tests/ folder with a sample test

2 participants