Fail if dirty (#16839)

* Fail if dirty

* Update check_dirty

* Update text

* Fix comment

* Add -e

* Update dirty script
This commit is contained in:
Paulus Schoutsen 2018-09-25 20:47:51 +02:00 committed by GitHub
parent 7de0e1e39a
commit 5a22e7d211
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

7
script/check_dirty Executable file
View file

@ -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

View file

@ -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