Integration test improvements (#3330)

* Send a message from integration tests and check that it doesn't show up in the app logs
* Increase photo library timeout

* Wait for image tapping to process

* Send a message using the rich text editor too

* Wait for the various pickers to finish loading

* Set all logs to `trace` in integration tests

* Close formatting options after sending the second message

* Make sure logs are actually sent to tracing and get redirected to the right file

* Switch from using a custom `trace` log configuration to the lowest level `TracingConfiguration` we support
This commit is contained in:
Stefan Ceriu
2024-09-26 10:15:09 +03:00
committed by GitHub
parent a8dbda90d9
commit dc6d7f2985
8 changed files with 101 additions and 16 deletions
@@ -13,7 +13,13 @@ enum RustTracing {
/// name and other log management metadata during rotation.
static let filePrefix = "console"
/// The directory that stores all of the log files.
static var logsDirectory: URL { .appGroupContainerDirectory }
static var logsDirectory: URL {
if ProcessInfo.isRunningIntegrationTests {
"/Users/Shared"
} else {
.appGroupContainerDirectory
}
}
private(set) static var currentTracingConfiguration: TracingConfiguration?
static func setup(configuration: TracingConfiguration) {
@@ -23,7 +29,15 @@ enum RustTracing {
// as the app is unlikely to be running continuously.
let maxFiles: UInt64 = 24 * 7
setupTracing(config: .init(filter: configuration.filter,
// Log everything on integration tests to check whether
// the logs contain any sensitive data. See `UserFlowTests.swift`
let filter = if ProcessInfo.isRunningIntegrationTests {
TracingConfiguration(logLevel: .trace, target: nil).filter
} else {
configuration.filter
}
setupTracing(config: .init(filter: filter,
writeToStdoutOrSystem: true,
writeToFiles: .init(path: logsDirectory.path(percentEncoded: false),
filePrefix: configuration.fileName,