Changed RUNNING_ON_CI to CI_USE_PACKAGER environment variable.
Reviewed By: javache Differential Revision: D3327726 fbshipit-source-id: 6293b71a2ca7783b089f16fe2089c8893e93a621
This commit is contained in:
parent
c8f39c3d2c
commit
913b4ccee4
|
@ -54,7 +54,7 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
shouldUseLaunchSchemeArgsEnv = "NO">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
|
@ -86,6 +86,13 @@
|
|||
ReferencedContainer = "container:UIExplorer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<EnvironmentVariables>
|
||||
<EnvironmentVariable
|
||||
key = "CI_USE_PACKAGER"
|
||||
value = "1"
|
||||
isEnabled = "YES">
|
||||
</EnvironmentVariable>
|
||||
</EnvironmentVariables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
{
|
||||
_bridge = [[RCTBridge alloc] initWithDelegate:self
|
||||
launchOptions:launchOptions];
|
||||
|
||||
|
||||
// Appetizer.io params check
|
||||
NSDictionary *initProps = nil;
|
||||
NSString *_routeUri = [[NSUserDefaults standardUserDefaults] stringForKey:@"route"];
|
||||
|
@ -36,7 +36,7 @@
|
|||
initProps = @{@"exampleFromAppetizeParams":
|
||||
[NSString stringWithFormat:@"rnuiexplorer://example/%@Example", _routeUri]};
|
||||
}
|
||||
|
||||
|
||||
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:_bridge
|
||||
moduleName:@"UIExplorerApp"
|
||||
initialProperties:initProps];
|
||||
|
@ -81,9 +81,9 @@
|
|||
|
||||
// sourceURL = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
||||
|
||||
#if RUNNING_ON_CI
|
||||
if (!getenv("CI_USE_PACKAGER")) {
|
||||
sourceURL = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
||||
#endif
|
||||
}
|
||||
|
||||
return sourceURL;
|
||||
}
|
||||
|
|
|
@ -34,13 +34,15 @@
|
|||
|
||||
- (void)setUp
|
||||
{
|
||||
#if RUNNING_ON_CI
|
||||
NSURL *scriptURL = [[NSBundle bundleForClass:[RCTBridge class]] URLForResource:@"main" withExtension:@"jsbundle"];
|
||||
RCTAssert(scriptURL != nil, @"Could not locate main.jsBundle");
|
||||
#else
|
||||
NSString *app = @"Examples/UIExplorer/UIExplorerIntegrationTests/js/IntegrationTestsApp";
|
||||
NSURL *scriptURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://localhost:8081/%@.bundle?platform=ios&dev=true", app]];
|
||||
#endif
|
||||
NSURL *scriptURL;
|
||||
if (getenv("CI_USE_PACKAGER")) {
|
||||
NSString *app = @"Examples/UIExplorer/UIExplorerIntegrationTests/js/IntegrationTestsApp";
|
||||
scriptURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://localhost:8081/%@.bundle?platform=ios&dev=true", app]];
|
||||
RCTAssert(scriptURL != nil, @"No scriptURL set");
|
||||
} else {
|
||||
scriptURL = [[NSBundle bundleForClass:[RCTBridge class]] URLForResource:@"main" withExtension:@"jsbundle"];
|
||||
RCTAssert(scriptURL != nil, @"Could not locate main.jsBundle");
|
||||
}
|
||||
|
||||
_bridge = [[RCTBridge alloc] initWithBundleURL:scriptURL moduleProvider:NULL launchOptions:nil];
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:5];
|
||||
|
|
|
@ -45,12 +45,13 @@ static const NSTimeInterval kTestTeardownTimeoutSeconds = 30;
|
|||
_testController.referenceImagesDirectory = referenceDirectory;
|
||||
_moduleProvider = [block copy];
|
||||
|
||||
#if RUNNING_ON_CI
|
||||
_scriptURL = [[NSBundle bundleForClass:[RCTBridge class]] URLForResource:@"main" withExtension:@"jsbundle"];
|
||||
RCTAssert(_scriptURL != nil, @"Could not locate main.jsBundle");
|
||||
#else
|
||||
_scriptURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://localhost:8081/%@.bundle?platform=ios&dev=true", app]];
|
||||
#endif
|
||||
if (getenv("CI_USE_PACKAGER")) {
|
||||
_scriptURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://localhost:8081/%@.bundle?platform=ios&dev=true", app]];
|
||||
RCTAssert(_scriptURL != nil, @"No scriptURL set");
|
||||
} else {
|
||||
_scriptURL = [[NSBundle bundleForClass:[RCTBridge class]] URLForResource:@"main" withExtension:@"jsbundle"];
|
||||
RCTAssert(_scriptURL != nil, @"Could not locate main.jsBundle");
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue