tests: enforce conventions for go Test#2624
Merged
zakisk merged 1 commit intotektoncd:mainfrom Mar 31, 2026
Merged
Conversation
45f4ead to
2386c8e
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a new linter check in .tekton/linter.yaml to enforce PascalCase naming for Go test functions and the use of the gotest.tools/v3/assert library. It updates AGENTS.md with these testing conventions and refactors numerous test files to comply by renaming functions and updating assertions. Review feedback suggests refining the linter's regex to more effectively detect underscores and identifies several instances where documentation comments were not updated to match the renamed test functions.
df1ddcf to
0bbea93
Compare
Member
Author
|
/test |
zakisk
reviewed
Mar 31, 2026
0bbea93 to
75eb639
Compare
Enforce our convention on test to use table driven tests and better naming across the repository. Add s imple check in linters.yaml to enforce this. Update AGENTS.md so agents can respect it. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
75eb639 to
2abff06
Compare
zakisk
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enforce our convention on test to use table driven tests and better naming across the repository.
Add simple check in linters.yaml to enforce this. Update AGENTS.md so agents can respect it.
📝 Description of the Change
Enforces Go test conventions across the repository to improve consistency and maintainability:
TestGetTektonDir) with no underscores.tekton/linter.yamlto validate test structure complianceAGENTS.mdwith explicit test conventions and best practices for agents🔗 Linked GitHub Issue
Fixes #
🧪 Testing Strategy
🤖 AI Assistance
AI assistance can be used for various tasks, such as code generation,
documentation, or testing.
Please indicate whether you have used AI assistance
for this PR and provide details if applicable.
Important
Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.
If the majority of the code in this PR was generated by an AI, please add a `Co-authored-by` trailer to your commit message.
For example:
Co-authored-by: Claude noreply@anthropic.com
✅ Submitter Checklist