From fb3b5d38e86eecee4939223f535c7dc99ab86cef Mon Sep 17 00:00:00 2001 From: Jared Friese Date: Sun, 14 Aug 2016 12:49:47 -0700 Subject: [PATCH 1/7] Move testing scripts [#128293477] --- .travis.yml | 2 +- {script => Testing}/tests.go | 0 {script => Testing}/unittests.go | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename {script => Testing}/tests.go (100%) rename {script => Testing}/unittests.go (100%) diff --git a/.travis.yml b/.travis.yml index 837bbde..1c8aeb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ install: - git submodule update script: -- go run script/tests.go +- go run Testing/tests.go diff --git a/script/tests.go b/Testing/tests.go similarity index 100% rename from script/tests.go rename to Testing/tests.go diff --git a/script/unittests.go b/Testing/unittests.go similarity index 100% rename from script/unittests.go rename to Testing/unittests.go From f5121d5c9bdc705bd9a11b7583c57e178ecce3e6 Mon Sep 17 00:00:00 2001 From: Jared Friese Date: Sun, 14 Aug 2016 13:28:00 -0700 Subject: [PATCH 2/7] Pipe unit test output through xcpretty [#128293477] --- Testing/tests.go | 2 +- Testing/unittests.go | 25 ++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Testing/tests.go b/Testing/tests.go index d5e8167..14591d3 100644 --- a/Testing/tests.go +++ b/Testing/tests.go @@ -15,7 +15,7 @@ func main() { } func runUnitTests(stdOut io.Writer, stdErr io.Writer) { - runCommand := exec.Command("go", "run", "script/unittests.go") + runCommand := exec.Command("go", "run", "Testing/unittests.go") runCommand.Stdout = stdOut runCommand.Stderr = stdErr diff --git a/Testing/unittests.go b/Testing/unittests.go index 8ca4069..3e71f8c 100644 --- a/Testing/unittests.go +++ b/Testing/unittests.go @@ -15,11 +15,26 @@ func main() { } unitTestCommand := exec.Command("xcodebuild", "test", "-workspace", "Fleet.xcworkspace", "-scheme", "Fleet", "-destination", "platform=iOS Simulator,OS=9.3,name=iPhone 6") - unitTestCommand.Stdout = stdOut - unitTestCommand.Stderr = stdErr - unitTestErr := unitTestCommand.Run() - if unitTestErr != nil { - log.Fatal(unitTestErr) + xcprettyCommand := exec.Command("xcpretty") + xcprettyCommand.Stdin, err = unitTestCommand.StdoutPipe() + if err != nil { + log.Fatal(err) + } + xcprettyCommand.Stdout = stdOut + xcprettyCommand.Stderr = stdErr + err = xcprettyCommand.Start() + if err != nil { + log.Fatal(err) + } + + err = unitTestCommand.Run() + if err != nil { + log.Fatal(err) + } + + err = xcprettyCommand.Wait() + if err != nil { + log.Fatal(err) } _, err = stdOut.Write([]byte("Fleet unit tests passed...\n")) From f478e342846f9f6608570bbb13a1ea5e1ab264d7 Mon Sep 17 00:00:00 2001 From: Jared Friese Date: Sun, 14 Aug 2016 19:32:45 -0700 Subject: [PATCH 3/7] Install xcpretty fork on Travis before running tests [#128293477] --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1c8aeb6..4e01066 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,8 @@ before_install: install: - git submodule init - git submodule update +- gem install specific_install +- gem specific_install jwfriese/xcpretty script: - go run Testing/tests.go From 4c98d86f2660fe49e5877134b9f68023160a9238 Mon Sep 17 00:00:00 2001 From: Jared Friese Date: Sun, 14 Aug 2016 19:48:20 -0700 Subject: [PATCH 4/7] Specify Ruby version [#128293477] --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4e01066..371e348 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: generic os: osx osx_image: xcode7.3 +rvm: +- 2.0.0 before_install: - export XCODEBUILD_PATH=$(which xcodebuild) - export PATH=$PATH:$XCODEBUILD_PATH @@ -8,7 +10,6 @@ install: - git submodule init - git submodule update - gem install specific_install -- gem specific_install jwfriese/xcpretty - +- gem specific_install https://github.com/jwfriese/xcpretty.git script: - go run Testing/tests.go From 193419200c209e17ef010080ba97cc4abcaf3dbc Mon Sep 17 00:00:00 2001 From: Jared Friese Date: Sun, 14 Aug 2016 20:58:09 -0700 Subject: [PATCH 5/7] Run 'gem' alone to check for availability on Travis [#128293477] --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 371e348..90f6f1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ before_install: install: - git submodule init - git submodule update -- gem install specific_install -- gem specific_install https://github.com/jwfriese/xcpretty.git +- gem script: - go run Testing/tests.go From bb219c463f82c1f738e9ca57b763e1794830a720 Mon Sep 17 00:00:00 2001 From: Jared Friese Date: Mon, 15 Aug 2016 07:21:49 -0700 Subject: [PATCH 6/7] Add Ruby version file [#128293477] --- .ruby-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..bec3a35 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +system From 7c86f9648f68f5fd892329a49c0a5ecb7d39f458 Mon Sep 17 00:00:00 2001 From: Jared Friese Date: Mon, 15 Aug 2016 07:38:06 -0700 Subject: [PATCH 7/7] Install xcpretty before running tests [#128293477] --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 90f6f1c..a487bef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,13 @@ language: generic os: osx osx_image: xcode7.3 -rvm: -- 2.0.0 before_install: - export XCODEBUILD_PATH=$(which xcodebuild) - export PATH=$PATH:$XCODEBUILD_PATH +- export PATH=$PATH:~/bin install: - git submodule init - git submodule update -- gem +- gem install xcpretty --user-install -n~/bin script: - go run Testing/tests.go