Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only retrieve device logs in e2e tests when DEBUG is set #1718

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,17 @@ def skip_between(os, version_lo, version_hi)
Process.kill 'KILL', $fixture_pid
Process.waitpid $fixture_pid
$fixture_pid = nil
sleep 1 # prevent log bleed between scenarios due to second precision of --start
app = ENV['RUN_XCFRAMEWORK_APP'] ? 'macOSTestAppXcFramework' : 'macOSTestApp'
log = Process.spawn(
'/usr/bin/log', 'show', '--style', 'syslog', '--predicate',
"eventMessage contains \"#{app}\" OR process == \"#{app}\"",
'--start', $started_at.strftime('%Y-%m-%d %H:%M:%S%z'),
out: File.open(File.join(path, 'device.log'), 'w')
)
Process.wait log
if ENV['DEBUG']
sleep 1 # prevent log bleed between scenarios due to second precision of --start
app = ENV['RUN_XCFRAMEWORK_APP'] ? 'macOSTestAppXcFramework' : 'macOSTestApp'
log = Process.spawn(
'/usr/bin/log', 'show', '--style', 'syslog', '--predicate',
"eventMessage contains \"#{app}\" OR process == \"#{app}\"",
'--start', $started_at.strftime('%Y-%m-%d %H:%M:%S%z'),
out: File.open(File.join(path, 'device.log'), 'w')
)
Process.wait log
end
end
when 'ios'
begin
Expand Down
Loading