Skip to content

Commit b7ad18a

Browse files
author
Gleb Tarasov
committed
Reduce amount of logs in UITests
1 parent 3fefa21 commit b7ad18a

File tree

7 files changed

+90
-5
lines changed

7 files changed

+90
-5
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
destination: platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5
6060
workspace: Project.xcworkspace
6161
run: |
62-
xcodebuild test -scheme "$scheme" -workspace "$workspace" -destination "$destination" -test-iterations 3 -run-tests-until-failure -enableCodeCoverage YES -derivedDataPath DerivedData
62+
xcodebuild test -scheme "$scheme" -workspace "$workspace" -destination "$destination" -derivedDataPath DerivedData
6363
6464
- name: Slather
6565
env:

PerformanceSuite/Tests/PerformanceMonitoringTests.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ final class PerformanceMonitoringTests: XCTestCase {
1515
continueAfterFailure = false
1616
try PerformanceMonitoring.disable()
1717
StartupTimeReporter.forgetMainStartedForTests()
18+
AppInfoHolder.resetForTests()
1819
}
1920

2021
override func tearDown() {
@@ -32,6 +33,8 @@ final class PerformanceMonitoringTests: XCTestCase {
3233
wait(for: [exp], timeout: 20) // increase timeout as it is very slow on CI
3334
_ = vc
3435

36+
// simulate vc appearance to generate more performance events
37+
// checking there are no crashes
3538
_ = vc.view
3639
vc.beginAppearanceTransition(true, animated: false)
3740
vc.endAppearanceTransition()
@@ -63,6 +66,16 @@ final class PerformanceMonitoringTests: XCTestCase {
6366
setenv("ActivePrewarm", "", 1)
6467
}
6568

69+
func testNoPrewarming() throws {
70+
setenv("ActivePrewarm", "", 1)
71+
PerformanceMonitoring.onMainStarted()
72+
try PerformanceMonitoring.enable(config: .all(receiver: self))
73+
74+
XCTAssertFalse(PerformanceMonitoring.appStartInfo.appStartedWithPrewarming)
75+
76+
try PerformanceMonitoring.disable()
77+
}
78+
6679
private var onInitExpectation: XCTestExpectation?
6780
}
6881

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"configurations" : [
3+
{
4+
"id" : "ABDBB9DB-889D-4707-B550-881A8D2FE47B",
5+
"name" : "Test Scheme Action",
6+
"options" : {
7+
8+
}
9+
}
10+
],
11+
"defaultOptions" : {
12+
"maximumTestRepetitions" : 3,
13+
"testRepetitionMode" : "untilFailure",
14+
"userAttachmentLifetime" : "keepAlways"
15+
},
16+
"testTargets" : [
17+
{
18+
"target" : {
19+
"containerPath" : "container:Pods\/Pods.xcodeproj",
20+
"identifier" : "E7B17CF293A0585BA47ADEED225E1659",
21+
"name" : "PerformanceSuite-Unit-Tests"
22+
}
23+
}
24+
],
25+
"version" : 1
26+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"configurations" : [
3+
{
4+
"id" : "21225ED1-5F89-43DE-9076-0D7ED1174387",
5+
"name" : "Test Scheme Action",
6+
"options" : {
7+
8+
}
9+
}
10+
],
11+
"defaultOptions" : {
12+
"environmentVariableEntries" : [
13+
{
14+
"key" : "OS_ACTIVITY_MODE",
15+
"value" : "disable"
16+
}
17+
],
18+
"testRepetitionMode" : "retryOnFailure"
19+
},
20+
"testTargets" : [
21+
{
22+
"target" : {
23+
"containerPath" : "container:Pods\/Pods.xcodeproj",
24+
"identifier" : "B65E438620CC2DA1C6452F8C936D2E6C",
25+
"name" : "PerformanceSuite-UI-UITests"
26+
}
27+
}
28+
],
29+
"version" : 1
30+
}

Project.xcworkspace/contents.xcworkspacedata

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Project.xcworkspace/xcshareddata/xcschemes/UITests.xcscheme

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
buildConfiguration = "Release"
1111
selectedDebuggerIdentifier = ""
1212
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
13-
shouldUseLaunchSchemeArgsEnv = "YES"
14-
shouldAutocreateTestPlan = "YES">
13+
shouldUseLaunchSchemeArgsEnv = "YES">
14+
<TestPlans>
15+
<TestPlanReference
16+
reference = "container:PerformanceSuite/UITests/UITests.xctestplan"
17+
default = "YES">
18+
</TestPlanReference>
19+
</TestPlans>
1520
<Testables>
1621
<TestableReference
1722
skipped = "NO">

Project.xcworkspace/xcshareddata/xcschemes/UnitTests.xcscheme

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES"
30-
shouldAutocreateTestPlan = "YES">
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<TestPlans>
31+
<TestPlanReference
32+
reference = "container:PerformanceSuite/Tests/UnitTests.xctestplan"
33+
default = "YES">
34+
</TestPlanReference>
35+
</TestPlans>
3136
<Testables>
3237
<TestableReference
3338
skipped = "NO">

0 commit comments

Comments
 (0)