Skip to content

Commit

Permalink
It looks like github unit tests don't have oslog debug enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mbruin-NR committed Oct 24, 2024
1 parent 9a2be22 commit 738eb3a
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,13 @@ - (void) testAutoCollectedLogs {
}];

// Three messages should reach the remote log file for upload.
NSLog(@"NSLog Test \n\n");
NSLog(@"NSLog Test \n");
os_log_t customLog = os_log_create("com.agent.tests", "logTest");
// Log messages at different levels
os_log(customLog, "This is a default os_log message.\n");
os_log_info(customLog, "This is an info os_log message.\n");
os_log_debug(customLog, "This is a debug os_log message.\n");
os_log_error(customLog, "This is an error os_log message.\n");
os_log_fault(customLog, "This is a fault os_log message.\n");
os_log(customLog, "This is a default os_log message.");
os_log_info(customLog, "This is an info os_log message.");
os_log_error(customLog, "This is an error os_log message.");
os_log_fault(customLog, "This is a fault os_log message.");

XCTestExpectation *delayExpectation2 = [self expectationWithDescription:@"Waiting for Log Queue"];

Expand Down Expand Up @@ -312,7 +311,6 @@ - (void) testAutoCollectedLogs {
@{@"message": @"NSLog Test"},
@{@"message": @"This is a default os_log message."},
@{@"message": @"This is an info os_log message."},
@{@"message": @"This is a debug os_log message."},
@{@"message": @"This is an error os_log message."},
@{@"message": @"This is a fault os_log message."},
];
Expand All @@ -336,7 +334,7 @@ - (void) testAutoCollectedLogs {
}
}

XCTAssertEqual(foundCount, 6, @"Three remote messages should be found.");
XCTAssertEqual(foundCount, 5, @"Three remote messages should be found.");
[NRMAFlags disableFeatures: NRFeatureFlag_RedirectStdOutStdErr];
}

Expand Down

0 comments on commit 738eb3a

Please sign in to comment.