mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
early boot the simulator to avoid false travis failures
Tests were frequently failing, especially during peak travis-ci hours. Also, saved some time by removing redundant build from test script. // FREEBIE
This commit is contained in:
parent
49de772997
commit
8bf4acd78a
|
@ -3,6 +3,9 @@ cache: cocoapods # pod install somtimes takes >20 minutes, so lets cache this
|
||||||
|
|
||||||
osx_image: xcode8
|
osx_image: xcode8
|
||||||
|
|
||||||
|
env:
|
||||||
|
-EARLY_START_SIMULATOR=1 # early starting simulator reduces false negatives due to test timeouts
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- brew update # we may not be running the latest version so always update
|
- brew update # we may not be running the latest version so always update
|
||||||
- brew outdated xctool || brew upgrade xctool # only upgrade if outdated (saves 2 minutes)
|
- brew outdated xctool || brew upgrade xctool # only upgrade if outdated (saves 2 minutes)
|
||||||
|
|
16
Makefile
16
Makefile
|
@ -1,7 +1,9 @@
|
||||||
# Make sure we're failing even though we pipe to xcpretty
|
# Make sure we're failing even though we pipe to xcpretty
|
||||||
SHELL=/bin/bash -o pipefail -o errexit
|
SHELL=/bin/bash -o pipefail -o errexit
|
||||||
|
|
||||||
BUILD_DESTINATION = platform=iOS Simulator,name=iPhone 6,OS=9.3
|
# iPhone6, iOS10
|
||||||
|
DEVICE_UUID:=$(shell xcrun instruments -s | grep -o "iPhone 6 (10.0) \[.*\]" | grep -o "\[.*\]" | sed "s/^\[\(.*\)\]$$/\1/")
|
||||||
|
BUILD_DESTINATION = platform=iOS Simulator,id=${DEVICE_UUID}
|
||||||
WORKING_DIR = ./
|
WORKING_DIR = ./
|
||||||
SCHEME = Signal
|
SCHEME = Signal
|
||||||
XCODE_BUILD = xcrun xcodebuild -workspace $(SCHEME).xcworkspace -scheme $(SCHEME) -sdk iphonesimulator
|
XCODE_BUILD = xcrun xcodebuild -workspace $(SCHEME).xcworkspace -scheme $(SCHEME) -sdk iphonesimulator
|
||||||
|
@ -20,14 +22,22 @@ build: pod_install
|
||||||
cd $(WORKING_DIR) && \
|
cd $(WORKING_DIR) && \
|
||||||
$(XCODE_BUILD) build | xcpretty
|
$(XCODE_BUILD) build | xcpretty
|
||||||
|
|
||||||
retest:
|
retest: optional_early_start_simulator
|
||||||
cd $(WORKING_DIR) && \
|
cd $(WORKING_DIR) && \
|
||||||
$(XCODE_BUILD) \
|
$(XCODE_BUILD) \
|
||||||
-destination '${BUILD_DESTINATION}' \
|
-destination '${BUILD_DESTINATION}' \
|
||||||
build test | xcpretty
|
test | xcpretty
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
cd $(WORKING_DIR) && \
|
cd $(WORKING_DIR) && \
|
||||||
$(XCODE_BUILD) \
|
$(XCODE_BUILD) \
|
||||||
clean | xcpretty
|
clean | xcpretty
|
||||||
|
|
||||||
|
optional_early_start_simulator:
|
||||||
|
ifdef EARLY_START_SIMULATOR
|
||||||
|
echo "Waiting for simulator to start to help with testing timeouts" &&\
|
||||||
|
xcrun instruments -w '${DEVICE_UUID}' || true # xcrun can return irrelevant non-zeroes.
|
||||||
|
else
|
||||||
|
echo "Not waiting for simulator."
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue