[gRPC/iOS] Adding debug info for interop server host info (#29845)

pull/29282/head^2
Denny C. Dai 3 years ago committed by GitHub
parent bbf56baa88
commit 8563b69208
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/objective-c/tests/Common/TestUtils.h
  2. 11
      src/objective-c/tests/Common/TestUtils.m
  3. 4
      src/objective-c/tests/UnitTests/APIv2Tests.m

@ -41,4 +41,9 @@ FOUNDATION_EXPORT NSString *GRPCGetLocalInteropTestServerAddressSSL(void);
*/
FOUNDATION_EXPORT NSString *GRPCGetRemoteInteropTestServerAddress(void);
/**
* Common utility to print interop server address information to console via NSLog.
*/
FOUNDATION_EXPORT void GRPCPrintInteropTestServerDebugInfo(void);
NS_ASSUME_NONNULL_END

@ -49,3 +49,14 @@ NSString *GRPCGetRemoteInteropTestServerAddress() {
});
return address;
}
void GRPCPrintInteropTestServerDebugInfo() {
NSLog(@"local interop env: %@ macro: %@",
[NSProcessInfo processInfo].environment[@"HOST_PORT_LOCAL"], NSStringize(HOST_PORT_LOCAL));
NSLog(@"local interop ssl env: %@ macro: %@",
[NSProcessInfo processInfo].environment[@"HOST_PORT_LOCALSSL"],
NSStringize(HOST_PORT_LOCALSSL));
NSLog(@"remote interop env: %@ macro: %@",
[NSProcessInfo processInfo].environment[@"HOST_PORT_REMOTE"],
NSStringize(HOST_PORT_REMOTE));
}

@ -131,6 +131,10 @@ static const NSTimeInterval kInvertedTimeout = 2;
@implementation CallAPIv2Tests
+ (void)setUp {
GRPCPrintInteropTestServerDebugInfo();
}
- (void)setUp {
// This method isn't implemented by the remote server.
kInexistentMethod = [[GRPCProtoMethod alloc] initWithPackage:kPackage

Loading…
Cancel
Save