agentleFS
AWSKnown publisheraws/amazon-chime-sdk-ios/AmazonChimeSDK/AmazonChimeSDKTests/AGENTS.md

amazon-chime-sdk-ios / AmazonChimeSDKTests

AGENTS.md153 starsChanged 4 months agoApache-2.0View on GitHub

Tests use handwritten spies and the verification helpers in common/CommonTestCase.swift. Do not add Cuckoo, generated mocks, or method-specific verifier proxies without explicit approval. Avoid reintroducing equivalent boilerplate: Run the affected test class first, then run the complete suite before submitting broad test refactors:

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

We split this AGENTS.md into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Prefer verify, verifyEqual, and verifyIdentical over direct assertions on spy call counts.

    line 7
  2. Very specific:

    Use never() and times(_:) for non-default expected call counts.

    line 8
  3. Very specific:

    When wrapping these helpers, forward file: StaticString = #filePath and line: UInt = #line so failures point to the test call site.

    line 10
  4. Very specific:

    Keep equality and identity helpers under distinct names.

    line 11
  5. Distinctive:

    Avoid reintroducing equivalent boilerplate:

    line 36
  6. Distinctive:

    Run the affected test class first, then run the complete suite before submitting broad test refactors:

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AmazonChimeSDK XCTest Guidance

Spy Verification

Tests use handwritten spies and the verification helpers in common/CommonTestCase.swift. Do not add Cuckoo, generated mocks, or method-specific verifier proxies without explicit approval.

  • Prefer verify, verifyEqual, and verifyIdentical over direct assertions on spy call counts.
  • Use never() and times(_:) for non-default expected call counts.
  • Preserve existing matcher semantics. In particular, arguments previously matched with Cuckoo's any() must remain unconstrained unless the test already asserted their values.
  • When wrapping these helpers, forward file: StaticString = #filePath and line: UInt = #line so failures point to the test call site.
  • Keep equality and identity helpers under distinct names. Do not add verify overloads for values or object identity; those generic overloads caused Swift type-checking timeouts on complex predicates.
// Exactly one recorded call.
verify(audioClientControllerMock.stopCallCount)
verify(videoClientMock.setSendingCalls)

// Predicate matching, zero calls, or multiple calls.
verify(videoClientMock.sendDataMessageCalls) {
    $0.topic == topic && $0.lifetimeMs == 0
}
verify(videoClientMock.setSendingCalls, never())
verify(audioClientControllerMock.startCalls, times(2)) { $0.audioMode == .mono48K }

// Equality and reference identity.
verifyEqual(videoClientMock.setSendingCalls, to: true)
verifyIdentical(audioSessionMock.setPreferredInputCalls, to: port)

// Inspect the single matched call without filtering and counting again.
let event = verify(eventAnalyticsControllerMock.publishEventCalls) {
    $0.name == .audioInputFailed
}
XCTAssertEqual(event?.attributes?[EventAttributeName.audioInputError] as? MediaError, expectedError)

Avoid reintroducing equivalent boilerplate:

// Do not use when a verification helper expresses the same expectation.
XCTAssertEqual(calls.filter { $0.topic == topic }.count, 1)

Validation

Run the affected test class first, then run the complete suite before submitting broad test refactors:

cd AmazonChimeSDK
xcodebuild test \
  -project AmazonChimeSDK.xcodeproj \
  -scheme AmazonChimeSDKTests \
  -destination 'platform=iOS Simulator,name=iPhone 17 Pro' \
  -skip-testing:'AmazonChimeSDKTests/SchedulerTests' \
  -quiet

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.