agentleFS
SentryKnown publishergetsentry/sentry-cocoa/Tests/AGENTS.md

sentry-cocoa / Tests

AGENTS.md1.1k starsChanged 3 months agoMITView on GitHub

Scope: Tests/**. Also follow root instructions.

Trending

Quiet this year.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the getsentry/sentry-cocoa repository that our weekly crawl found: only 13 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about getsentry/sentry-cocoa

The biggest 5 of 13 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 13

Talked about on GitHub (13 times).

On GitHub · 13

8 more on GitHub
  • 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.

  • In this repository8 other files it gives its agents.

The file

Show its rules and text

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

16 rules. About 0 are common, 8 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

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

    Test classes follow <SourceFile>Tests

    line 18
  2. Distinctive:

    Use iOS tests for iOS-specific or UIKit behavior and for final verification when required by the root matrix

    line 20
  3. Very specific:

    Use comma-separated test identifiers in ONLY_TESTING for multiple classes

    line 21
  4. Very specific:

    Use only for SentryNetworkTrackerIntegrationTestServerTests

    line 25
  5. Distinctive:

    Start the server before the relevant test commands

    line 26
  6. Distinctive:

    Stop the server after use, including when a test fails

    line 27
  7. Distinctive:

    Run only the relevant test commands between start and stop

    line 37
  8. Very specific:

    Do not create implementation tests against header-only SentryHeaders

    line 46
  9. Distinctive:

    Do not add unreliable tests for paths that cannot be controlled deterministically

    line 53
  10. Distinctive:

    Document the limitation at the source error-handling site and in the pull request

    line 54
  11. Distinctive:

    Use the narrowest deterministic lower-level validation when available

    line 55
  12. Very specific:

    Prefer specific assertions such as XCTAssertEqual, XCTAssertNil, and XCTAssertTrue over bare XCTAssert

    line 76
  13. Distinctive:

    Prefer self-contained DAMP tests over premature helper abstractions

    line 77
  14. Very specific:

    Use guard case with XCTFail for pattern matching

    line 78
  15. Very specific:

    Use XCTUnwrap for optional values and element(at:) for safe array access

    line 79
  16. Very specific:

    Prefer struct test helpers unless reference semantics are required

    line 80

≈ “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

Tests

Scope: Tests/**. Also follow root instructions.

Running Tests

make test-macos FOR_AGENTS=true
make test-macos FOR_AGENTS=true ONLY_TESTING=SentryTests/SentryHttpTransportTests
make test-ios FOR_AGENTS=true
make test-ios FOR_AGENTS=true ONLY_TESTING=SentryTests/SentryHttpTransportTests
make test-ios FOR_AGENTS=true ONLY_TESTING=SentryTests/SentryHttpTransportTests,SentryTests/SentryHubTests
make test-ios FOR_AGENTS=true ONLY_TESTING=SentryTests/SentryHttpTransportTests/testFlush_WhenNoInternet
make test FOR_AGENTS=true
make test-ui-critical
  • Test classes follow <SourceFile>Tests
  • The iOS test suite is slow, so prefer targeted macOS tests for quick iterations when the code and test support macOS
  • Use iOS tests for iOS-specific or UIKit behavior and for final verification when required by the root matrix
  • Use comma-separated test identifiers in ONLY_TESTING for multiple classes

Test Server

  • Use only for SentryNetworkTrackerIntegrationTestServerTests
  • Start the server before the relevant test commands
  • Stop the server after use, including when a test fails
make -C test-server start-debug
./scripts/sentry-xcodebuild.sh --platform iOS --command test --test-plan Sentry_TestServer
make test-macos FOR_AGENTS=true TEST_PLAN=Sentry_TestServer
make test-macos-v10 FOR_AGENTS=true TEST_PLAN=Sentry_TestServer
make -C test-server stop
  • Run only the relevant test commands between start and stop
  • Envelope snapshots in Tests/Resources/NetworkEnvelopeSnapshots compare all keys strictly
  • On mismatch, use the printed actual envelope JSON to update the snapshot
  • Payload changes usually require updating both standard and -v10 snapshots

SentryObjC Tests

  • ObjC public API tests belong in Tests/SentryObjCTests and import SentryObjC
  • Swift wrapper tests belong in Tests/SentryObjCCompatTests and use @testable import SentryObjCCompat
  • Do not create implementation tests against header-only SentryHeaders
  • Run make test-macos FOR_AGENTS=true TEST_SCHEME=SentryObjCTests
  • Target a class with ONLY_TESTING=SentryObjCTests/SentryObjCOptionsTests
  • Follow develop-docs/SENTRY-OBJC.md

Untestable Paths

  • Do not add unreliable tests for paths that cannot be controlled deterministically
  • Document the limitation at the source error-handling site and in the pull request
  • Use the narrowest deterministic lower-level validation when available

Style

Arrange, Act, Assert

func testExample() {
    // -- Arrange --
    let input = "test"

    // -- Act --
    let result = transform(input)

    // -- Assert --
    XCTAssertEqual(result, "TEST")
}
  • Name tests test<Function>_when<Condition>_should<Expected>()
  • Structure tests with the Arrange, Act, Assert markers shown above
  • Prefer specific assertions such as XCTAssertEqual, XCTAssertNil, and XCTAssertTrue over bare XCTAssert
  • Prefer self-contained DAMP tests over premature helper abstractions
  • Use guard case with XCTFail for pattern matching
  • Use XCTUnwrap for optional values and element(at:) for safe array access
  • Prefer struct test helpers unless reference semantics are required
  • Override SDK dependencies through SentryDependencyContainer.sharedInstance() when possible

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.