Skip to content

tools/template-check: add comprehensive unit tests for valid/invalid functions - #18372

Open
vr-ibm wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:add-func-check-tests-1
Open

tools/template-check: add comprehensive unit tests for valid/invalid functions#18372
vr-ibm wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:add-func-check-tests-1

Conversation

@vr-ibm

@vr-ibm vr-ibm commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Description
This is Part 2 of the template-check func-check series. This PR expands the test suite to cover a wide range of valid and invalid template scenarios.
Changes:

  • Replaced minimal tests with a table-driven test suite.
  • Added coverage for:
    • MMv1 Custom Functions: camelize, underscore, plural, etc.
    • Go Built-ins: len, index, and, or, etc.
    • Template Keywords: if, range, with, block.
    • Edge Cases: Dot access (.Resource.Name), variables ($var), and string literals.
  • Added negative tests for common developer mistakes (e.g., using camelCase instead of camelize).
    Note: This PR is based on add-func-check-logic. It should be merged after Part 1.
    Release Note Template for Downstream PRs (will be copied)

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jul 23, 2026
@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 317a0f5:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@vr-ibm
vr-ibm marked this pull request as ready for review July 23, 2026 21:11
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