From 5a22e7d2115ea1ae25278df2e62bf98ee8b0e440 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 25 Sep 2018 20:47:51 +0200 Subject: [PATCH] Fail if dirty (#16839) * Fail if dirty * Update check_dirty * Update text * Fix comment * Add -e * Update dirty script --- script/check_dirty | 7 +++++++ tox.ini | 2 ++ 2 files changed, 9 insertions(+) create mode 100755 script/check_dirty diff --git a/script/check_dirty b/script/check_dirty new file mode 100755 index 00000000000000..94db657a542db6 --- /dev/null +++ b/script/check_dirty @@ -0,0 +1,7 @@ +#!/bin/bash +[[ -z $(git ls-files --others --exclude-standard) ]] && exit 0 + +echo -e '\n***** ERROR\nTests are leaving files behind. Please update the tests to avoid writing any files:' +git ls-files --others --exclude-standard +echo +exit 1 diff --git a/tox.ini b/tox.ini index 60dacd5d8cb027..dcfb209ef3a9c0 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,7 @@ whitelist_externals = /usr/bin/env install_command = /usr/bin/env LANG=C.UTF-8 pip install {opts} {packages} commands = pytest --timeout=9 --duration=10 {posargs} + {toxinidir}/script/check_dirty deps = -r{toxinidir}/requirements_test_all.txt -c{toxinidir}/homeassistant/package_constraints.txt @@ -29,6 +30,7 @@ whitelist_externals = /usr/bin/env install_command = /usr/bin/env LANG=C.UTF-8 pip install {opts} {packages} commands = pytest --timeout=9 --duration=10 --cov --cov-report= {posargs} + {toxinidir}/script/check_dirty deps = -r{toxinidir}/requirements_test_all.txt -c{toxinidir}/homeassistant/package_constraints.txt