-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
test(app launch profiling): wipe test data from disk for integration test #3604
Merged
armcknight
merged 9 commits into
armcknight/test/launch-profiling
from
armcknight/test/launch-profiling2
Feb 8, 2024
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f715546
test: manage files in sample app from integration test
armcknight 6c9c344
Merge branch 'armcknight/test/launch-profiling' into armcknight/test/…
armcknight e4ae98b
Merge branch 'armcknight/test/launch-profiling' into armcknight/test/…
armcknight 3af711b
fix test on macos (isnt applicable)
armcknight b799c57
add availability declaration to fix some ui tests that are failing to…
armcknight 2fe9785
Merge branch 'armcknight/test/launch-profiling' into armcknight/test/…
armcknight bf12020
Merge branch 'armcknight/feat/launch-profiling' into armcknight/test/…
armcknight 97de0c4
Merge branch 'armcknight/test/launch-profiling' into armcknight/test/…
armcknight f3c04cd
test(app launch profiling): integration test fixes and additions (#3605)
armcknight File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,17 @@ | ||
// | ||
// AppStartup.h | ||
// iOS-Swift | ||
// | ||
// Created by Andrew McKnight on 1/31/24. | ||
// Copyright © 2024 Sentry. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface AppStartup : NSObject | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
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,26 @@ | ||
#import "AppStartup.h" | ||
|
||
@implementation AppStartup | ||
|
||
// we must do this in objective c, because it's not permitted to be overridden in Swift | ||
+ (void)load | ||
{ | ||
if ([NSProcessInfo.processInfo.arguments containsObject:@"--io.sentry.wipe-data"]) { | ||
NSLog(@"[iOS-Swift] removing app data"); | ||
NSString *appSupport = [NSSearchPathForDirectoriesInDomains( | ||
NSApplicationSupportDirectory, NSUserDomainMask, true) firstObject]; | ||
NSString *cache = [NSSearchPathForDirectoriesInDomains( | ||
NSCachesDirectory, NSUserDomainMask, true) firstObject]; | ||
NSFileManager *fm = NSFileManager.defaultManager; | ||
for (NSString *dir in @[ appSupport, cache ]) { | ||
for (NSString *file in [fm enumeratorAtPath:dir]) { | ||
NSError *error; | ||
if (![fm removeItemAtPath:[dir stringByAppendingPathComponent:file] error:&error]) { | ||
NSLog(@"[iOS-Swift] failed to remove data at app startup."); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@end |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment 🥇