diff --git a/mobile/azure-pipelines.yml b/mobile/azure-pipelines.yml index 2b91154b676d..c4d1f74a5c22 100644 --- a/mobile/azure-pipelines.yml +++ b/mobile/azure-pipelines.yml @@ -208,6 +208,22 @@ stages: targetPath: dist/Envoy.framework - script: bazel build --config=ios //examples/objective-c/hello_world:app displayName: 'Build objective-c app' + # Now check that the app actually runs on the simulator. + # This is a non-ideal way to check for liveliness, but works for now. + # First start the iOS simulator. + # Interestingly bazel run does not start the simulator in CI. + # https://github.com/lyft/envoy-mobile/issues/201 for further investigation. + - script: npm install -g ios-sim && ios-sim start --devicetypeid "iPhone-X, 12.2" + displayName: 'Start the iOS simulator' + # Run the app in the background and redirect logs. + - script: bazel run --config=ios //examples/objective-c/hello_world:app &> /tmp/envoy.log & + displayName: 'Run objective-c app' + # Wait for the app to start and get some requests/responses. + - script: sleep 60 + displayName: 'Sleep' + # Check for the sentinel value that shows the app is alive and well. + - script: cat /tmp/envoy.log | grep 'Hello, world!' + displayName: 'Check liveliness' - job: mac_swift_helloworld dependsOn: mac_dist timeoutInMinutes: 60 @@ -227,3 +243,19 @@ stages: targetPath: dist/Envoy.framework - script: bazel build --config=ios //examples/swift/hello_world:app displayName: 'Build swift app' + # Now check that the app actually runs on the simulator. + # This is a non-ideal way to check for liveliness, but works for now. + # First start the iOS simulator. + # Interestingly bazel run does not start the simulator in CI. + # https://github.com/lyft/envoy-mobile/issues/201 for further investigation. + - script: npm install -g ios-sim && ios-sim start --devicetypeid "iPhone-X, 12.2" + displayName: 'Start the iOS simulator' + # Run the app in the background and redirect logs. + - script: bazel run --config=ios //examples/swift/hello_world:app &> /tmp/envoy.log & + displayName: 'Run swift app' + # Wait for the app to start and get some requests/responses. + - script: sleep 60 + displayName: 'Sleep' + # Check for the sentinel value that shows the app is alive and well. + - script: cat /tmp/envoy.log | grep 'Hello, world!' + displayName: 'Check liveliness'