Skip to content

chore: updated AGENTS.md with more testing guidelines - #16328

Open
scotthart wants to merge 1 commit into
googleapis:mainfrom
scotthart:agents_testing_updates
Open

chore: updated AGENTS.md with more testing guidelines#16328
scotthart wants to merge 1 commit into
googleapis:mainfrom
scotthart:agents_testing_updates

Conversation

@scotthart

Copy link
Copy Markdown
Member

No description provided.

@scotthart
scotthart requested a review from a team as a code owner August 6, 2026 21:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates .agents/AGENTS.md to add guidelines recommending declarative container matchers over imperative loops and custom matchers for complex objects in tests. The review feedback correctly identifies that the provided example uses an undefined matcher HasTimeSeries and suggests a correction to make the example self-contained.

Comment thread .agents/AGENTS.md
Comment on lines +43 to +45
EXPECT_THAT(recorded_metrics, Contains(HasTimeSeries(AllOf(
MetricType(HasSubstr("outstanding_rpcs")),
HasMetricLabel("channel_pool_lb_policy", Eq("RANDOM_TWO_LEAST_USED"))))));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The matcher HasTimeSeries is used in the example assertion but is not defined in the code snippet. Since MetricType and HasMetricLabel already inspect arg.metric(), we can remove the undefined HasTimeSeries wrapper to make the example self-contained and correct.

Suggested change
EXPECT_THAT(recorded_metrics, Contains(HasTimeSeries(AllOf(
MetricType(HasSubstr("outstanding_rpcs")),
HasMetricLabel("channel_pool_lb_policy", Eq("RANDOM_TWO_LEAST_USED"))))));
EXPECT_THAT(recorded_metrics, Contains(AllOf(
MetricType(HasSubstr("outstanding_rpcs")),
HasMetricLabel("channel_pool_lb_policy", Eq("RANDOM_TWO_LEAST_USED")))));

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.23%. Comparing base (c49c86f) to head (bd80c18).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16328   +/-   ##
=======================================
  Coverage   92.23%   92.23%           
=======================================
  Files        2227     2227           
  Lines      209169   209169           
=======================================
+ Hits       192929   192932    +3     
+ Misses      16240    16237    -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@colinmoy colinmoy left a comment

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.

See gemini bot's suggestion

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