From 0ab364b1ba8a9fc82b918599fd4ac191a146d6ae Mon Sep 17 00:00:00 2001 From: Tom Haines Date: Thu, 6 Aug 2020 13:41:45 +0100 Subject: [PATCH 01/11] Include hub install --- .travis.yml | 4 ++++ install_hub.sh | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 install_hub.sh diff --git a/.travis.yml b/.travis.yml index e16c11a..ed7174d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ elixir: - 1.10.3 otp_release: - 23.0.2 +services: + - postgresql cache: directories: - _build @@ -15,6 +17,8 @@ before_install: - mix local.hex --force - mix local.rebar --force - mix archive.install --force hex nerves_bootstrap + # Include our hub server at master + - ./install_hub.sh script: - mix coveralls.json after_success: diff --git a/install_hub.sh b/install_hub.sh new file mode 100644 index 0000000..b5ddb7e --- /dev/null +++ b/install_hub.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +git clone https://github.com/dwyl/smart-home-auth-server +cd smart-home-auth-server + +mix setup +mix phx.server + +cd ../ \ No newline at end of file From 9320aad9847ba37c464605be7e834c81f3d0a9fb Mon Sep 17 00:00:00 2001 From: Tom Haines Date: Thu, 6 Aug 2020 13:45:14 +0100 Subject: [PATCH 02/11] Give script executable permissions --- install_hub.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 install_hub.sh diff --git a/install_hub.sh b/install_hub.sh old mode 100644 new mode 100755 From cd0d497df5dc83b2662ecd9a42ad9c43b77d0f7d Mon Sep 17 00:00:00 2001 From: Tom Haines Date: Thu, 6 Aug 2020 14:05:32 +0100 Subject: [PATCH 03/11] Run hub in background --- .travis.yml | 6 +++++- install_hub.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ed7174d..b52749b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,11 @@ before_install: - mix local.rebar --force - mix archive.install --force hex nerves_bootstrap # Include our hub server at master - - ./install_hub.sh + - git clone https://github.com/dwyl/smart-home-auth-server + - cd smart-home-auth-server + - mix setup + - mix phx.server & + - cd ../ script: - mix coveralls.json after_success: diff --git a/install_hub.sh b/install_hub.sh index b5ddb7e..b3b2715 100755 --- a/install_hub.sh +++ b/install_hub.sh @@ -4,6 +4,6 @@ git clone https://github.com/dwyl/smart-home-auth-server cd smart-home-auth-server mix setup -mix phx.server +mix phx.server & cd ../ \ No newline at end of file From fa9a4c3218f522e3b6f88d6e5ee0880d15174f6c Mon Sep 17 00:00:00 2001 From: Tom Haines Date: Thu, 6 Aug 2020 14:17:59 +0100 Subject: [PATCH 04/11] Attempt to kill hub when tests finish --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b52749b..0e99e59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,12 +21,15 @@ before_install: - git clone https://github.com/dwyl/smart-home-auth-server - cd smart-home-auth-server - mix setup - - mix phx.server & + - | + mix phx.server& + SERVER_PID=$1 - cd ../ script: - mix coveralls.json after_success: - bash <(curl -s https://codecov.io/bash) +- kill $SERVER_PID env: global: - MIX_ENV=test From 75b111b6de50d385fe44286d531f9ac4f27f4423 Mon Sep 17 00:00:00 2001 From: Tom Haines Date: Thu, 6 Aug 2020 14:18:55 +0100 Subject: [PATCH 05/11] Cache hub deps --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0e99e59..6a9c599 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ cache: directories: - _build - deps + - smart-home-auth-server/deps before_install: - sudo apt-get update # build utils required to compile github.com/boydm/scenic_driver_glfw From 2dafac49ddd7a759302156aac8f6f30ef9a0116b Mon Sep 17 00:00:00 2001 From: Tom Haines Date: Thu, 6 Aug 2020 14:21:07 +0100 Subject: [PATCH 06/11] Fix typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6a9c599..205d5d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_install: - mix setup - | mix phx.server& - SERVER_PID=$1 + SERVER_PID=$! - cd ../ script: - mix coveralls.json From 0581b1390e0a727db79ba4d0f2356519187651fb Mon Sep 17 00:00:00 2001 From: Tom Haines Date: Thu, 6 Aug 2020 14:27:59 +0100 Subject: [PATCH 07/11] Hack around cache bug --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 205d5d0..ca58880 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ cache: directories: - _build - deps - - smart-home-auth-server/deps + - smart-home-auth-server-deps before_install: - sudo apt-get update # build utils required to compile github.com/boydm/scenic_driver_glfw @@ -20,6 +20,8 @@ before_install: - mix archive.install --force hex nerves_bootstrap # Include our hub server at master - git clone https://github.com/dwyl/smart-home-auth-server + - mkdir smart-home-auth-server/deps + - cp -R smart-home-auth-server-deps/* smart-home-auth-server/deps - cd smart-home-auth-server - mix setup - | @@ -31,6 +33,9 @@ script: after_success: - bash <(curl -s https://codecov.io/bash) - kill $SERVER_PID +- rm -rf smart-home-auth-server-deps +- mkdir smart-home-auth-server-deps +- cp -R smart-home-auth-server/deps/* smart-home-auth-server-deps env: global: - MIX_ENV=test From 9202264b459959d461076b1c92c27e9e7b738480 Mon Sep 17 00:00:00 2001 From: Tom Haines Date: Thu, 6 Aug 2020 14:45:03 +0100 Subject: [PATCH 08/11] Comment out caching --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index ca58880..5f0228b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,8 @@ before_install: - mix archive.install --force hex nerves_bootstrap # Include our hub server at master - git clone https://github.com/dwyl/smart-home-auth-server - - mkdir smart-home-auth-server/deps - - cp -R smart-home-auth-server-deps/* smart-home-auth-server/deps + # - mkdir smart-home-auth-server/deps + # - cp -R smart-home-auth-server-deps/* smart-home-auth-server/deps - cd smart-home-auth-server - mix setup - | @@ -33,9 +33,9 @@ script: after_success: - bash <(curl -s https://codecov.io/bash) - kill $SERVER_PID -- rm -rf smart-home-auth-server-deps -- mkdir smart-home-auth-server-deps -- cp -R smart-home-auth-server/deps/* smart-home-auth-server-deps +# - rm -rf smart-home-auth-server-deps +# - mkdir smart-home-auth-server-deps +# - cp -R smart-home-auth-server/deps/* smart-home-auth-server-deps env: global: - MIX_ENV=test From 01405d940bb7bcc5f91d2e37dd2f92d1129756ec Mon Sep 17 00:00:00 2001 From: Tom Haines Date: Thu, 6 Aug 2020 15:03:20 +0100 Subject: [PATCH 09/11] Default to local hub --- config/config.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.exs b/config/config.exs index a298025..4f07447 100644 --- a/config/config.exs +++ b/config/config.exs @@ -26,7 +26,7 @@ end config :smart_home_firmware, - hub: "192.168.0.14:4000" + hub: "localhost:4000" if Mix.target() == :host do import_config "host.exs" From 4d6fdab2aa90bcfcfd0485a3324bf02f76dd678b Mon Sep 17 00:00:00 2001 From: Tom Haines Date: Thu, 6 Aug 2020 15:45:51 +0100 Subject: [PATCH 10/11] Verbose logging --- config/config.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.exs b/config/config.exs index 4f07447..265b29d 100644 --- a/config/config.exs +++ b/config/config.exs @@ -21,7 +21,7 @@ config :nerves, source_date_epoch: "1594028364" # See https://hexdocs.pm/ring_logger/readme.html for more information on # configuring ring_logger. if Mix.env() == :test do - config :logger, level: :error + config :logger, level: :info end From f3e96edc84b436a5f0acfbbdbc7fe14666a68ec6 Mon Sep 17 00:00:00 2001 From: Tom Haines Date: Thu, 6 Aug 2020 16:36:30 +0100 Subject: [PATCH 11/11] Even more verbose logging --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5f0228b..9aa440e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,7 @@ script: - mix coveralls.json after_success: - bash <(curl -s https://codecov.io/bash) +- tail -f /proc/$SERVER_PID/fd/1 - kill $SERVER_PID # - rm -rf smart-home-auth-server-deps # - mkdir smart-home-auth-server-deps