Skip to content

feat: Add testing agent to help with testing#793

Merged
jonstacks merged 3 commits intomainfrom
stacks/testing-agent
Mar 27, 2026
Merged

feat: Add testing agent to help with testing#793
jonstacks merged 3 commits intomainfrom
stacks/testing-agent

Conversation

@jonstacks
Copy link
Copy Markdown
Collaborator

@jonstacks jonstacks commented Mar 27, 2026

  • Fix "flakey" → "flaky" spelling in README.md
  • Update Eventually/Consistently context passing guidance to match repo patterns (test-agent.agent.md)
  • Soften DeferCleanup and Label("slow") recommendations to reflect they are not established repo practices (test-agent.agent.md)
  • Update code templates to use the correct GinkgoT().Context() + timeout, interval args pattern

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@jonstacks jonstacks self-assigned this Mar 27, 2026
@jonstacks jonstacks requested a review from a team as a code owner March 27, 2026 20:46
@github-actions github-actions bot added the size/L Denotes a PR that changes 100-499 lines label Mar 27, 2026
@jonstacks jonstacks requested a review from Copilot March 27, 2026 21:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new custom GitHub Copilot agent focused on improving test stability and authoring patterns for the ngrok Kubernetes Operator, and documents its usage for maintainers.

Changes:

  • Added test-agent agent instructions covering Ginkgo/Gomega + envtest patterns and flake-reduction guidance.
  • Updated the agents README to list and document how to invoke the new test agent.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
.github/agents/test-agent.agent.md Introduces a testing-focused agent playbook (framework, repo test structure, flake causes, workflows).
.github/agents/README.md Documents the new agent alongside existing agents and provides usage examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jonstacks
Copy link
Copy Markdown
Collaborator Author

@copilot apply changes based on the comments in this thread

- Fix "flakey" -> "flaky" spelling in README.md and test-agent.agent.md
- Update Eventually/Consistently guidance to reflect actual repo patterns:
  pass ctx to k8s client calls inside the body, use explicit timeout/interval
  args instead of Eventually(ctx, ...) form
- Use GinkgoT().Context() in test templates instead of context.Background()
- Soften DeferCleanup/Label("slow") recommendations to reflect they are not
  the predominant pattern in existing tests
- Update code template to use AfterEach for namespace cleanup and DeferCleanup
  for per-resource cleanup, consistent with surrounding test patterns

Agent-Logs-Url: https://github.com/ngrok/ngrok-operator/sessions/b9bc6551-834c-4de8-bc1d-e31dc243b407

Co-authored-by: jonstacks <[email protected]>
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

@copilot apply changes based on the comments in this thread

Applied all changes from the review thread in commit 4f18467:

  • Fixed "flakey" → "flaky" spelling throughout both files
  • Updated the "Missing WithContext" section to correctly describe the repo's pattern: pass ctx to k8s client calls inside the Eventually body, use positional timeout, interval args (or KGinkgo helpers) instead of Eventually(ctx, ...)
  • Replaced context.Background() with GinkgoT().Context() in test examples
  • Softened DeferCleanup recommendation to note that AfterEach/AfterAll is the predominant style in existing tests
  • Softened Label("slow") recommendation to note it's not widely used and consistency with nearby tests is preferred
  • Updated code template to use AfterEach for namespace cleanup and DeferCleanup for per-resource cleanup inside It blocks

@jonstacks jonstacks added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit f6da008 Mar 27, 2026
14 checks passed
@jonstacks jonstacks deleted the stacks/testing-agent branch March 27, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants