@@ -270,6 +270,37 @@ final class DiagnosticCLITests: XCTestCase {
270270 XCTAssertEqual ( summary. artifacts. first? . foregroundSeconds, 45 )
271271 }
272272
273+ func testActivitySummaryIgnoresNonPullRequestGitHubDocumentPath( ) async throws {
274+ let root = try temporaryDirectory ( )
275+ defer { try ? FileManager . default. removeItem ( at: root) }
276+ let now = Date ( timeIntervalSince1970: 21_600 )
277+ try writeBatch (
278+ ActivitySummaryTests . batch (
279+ id: " batch_non_pr_url " ,
280+ startedAt: Date ( timeIntervalSince1970: 7_000 ) ,
281+ endedAt: Date ( timeIntervalSince1970: 7_030 ) ,
282+ frames: [
283+ ActivitySummaryTests . frame (
284+ appName: " Google Chrome " ,
285+ bundleId: " com.google.Chrome " ,
286+ windowTitle: " cerebro " ,
287+ documentPath: " https://github.com/evalops/cerebro#123 " ,
288+ capturedAt: Date ( timeIntervalSince1970: 7_000 ) ,
289+ displayId: 42
290+ )
291+ ]
292+ ) ,
293+ to: root. appendingPathComponent ( " batch_non_pr_url.json " )
294+ )
295+
296+ let summary = try await ActivitySummary . run (
297+ options: ActivityOptions ( sinceHours: 6 , batchDirectory: root, windowLabel: " 6h " ) ,
298+ now: now
299+ )
300+
301+ XCTAssertTrue ( summary. artifacts. isEmpty)
302+ }
303+
273304 func testActivitySummaryArtifactsWriteInstructionsAndResource( ) async throws {
274305 let batchRoot = try temporaryDirectory ( )
275306 let artifactRoot = try temporaryDirectory ( )
0 commit comments