-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from hoangatuan/update-docs
Update docs
- Loading branch information
Showing
9 changed files
with
128 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
# XCUITests | ||
|
||
After the tests finish execution, the essential thing that we need is the simulator needs to stay alive. | ||
The problem with `XCUITests` is that after testing finish execution, it quit the simulator. | ||
|
||
# Things I've tried: | ||
|
||
1. Trying to find a way to preserve the running program after tests finish running | ||
|
||
- I can't find any way to preserve the running program. | ||
|
||
2. At the end of a test, run shell script to generate `memgraph` before the running program quit | ||
|
||
For this idea, I put a breakpoint before the test finish execution. Then we can custom that breakpoint to execute a shell script command. | ||
However, when running on CI, we will execute test using script, not from Xcode. So, using breakpoint to execute shell script will not work for CI | ||
|
||
=> Only work on Xcode | ||
|
||
3. From Xcode13, Apple provide `-enablePerformanceTestsDiagnostics` to generate memgraph after a test finish executing. | ||
|
||
```bash | ||
xcodebuild test -project MemoryLeaksCheck.xcodeproj \ | ||
-scheme LeaksCheckerUITests \ | ||
-destination platform=iOS,name="Tuan iPhone" \ | ||
-enablePerformanceTestsDiagnostics YES | ||
``` | ||
|
||
> Note: In the scheme configuration, open `Options` under `Test`, unselect "Delete if test succeeds" for Attachments. | ||
<img src=../resources/xcuitests.png width=800/> | ||
|
||
However, **this only works for real device, not for simulator.** | ||
|
||
Based on [Apple docs](https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes) | ||
|
||
> xcodebuild has a new option -enablePerformanceTestsDiagnostics YES that collects diagnostics for Performance XCTests. The option collects a ktrace file for non-XCTMemoryMetrics, and a series of memory graphs for XCTMemoryMetrics. xcodebuild attaches diagnostics to the generated xcresult bundle. **Note that memory graph collection isn’t available in simulated devices. (64495534)** | ||
=> Only work on local with real device, doesn't work on CI | ||
|
||
# Conclusion | ||
|
||
XCUITests is not appropriate for this approach. (for now) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+17.5 KB
...eproj/project.xcworkspace/xcuserdata/tuanhoang.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...yLeaksCheck.xcodeproj/xcuserdata/tuanhoang.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>LeaksCheckerUITests.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>0</integer> | ||
</dict> | ||
<key>MemoryLeaksCheck.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>1</integer> | ||
</dict> | ||
<key>SnapKitPlayground (Playground) 1.xcscheme</key> | ||
<dict> | ||
<key>isShown</key> | ||
<false/> | ||
<key>orderHint</key> | ||
<integer>3</integer> | ||
</dict> | ||
<key>SnapKitPlayground (Playground) 2.xcscheme</key> | ||
<dict> | ||
<key>isShown</key> | ||
<false/> | ||
<key>orderHint</key> | ||
<integer>4</integer> | ||
</dict> | ||
<key>SnapKitPlayground (Playground).xcscheme</key> | ||
<dict> | ||
<key>isShown</key> | ||
<false/> | ||
<key>orderHint</key> | ||
<integer>2</integer> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.