Drop unnecessary executable flags

This patch also adds checks for executable files in
pep8 job.

nose ignores executable files by default, so it is important
to ensure executable flag is not set for test files [1].
openstack_dashboard/test/test_plugins/panel_tests.py was not
tested actually and it was broken. This commit fixes it too.
[1] http://nose.readthedocs.io/en/latest/usage.html#cmdoption-exe

Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: I3a124fa2f9f0676b2b43a094e32e3d8b18fa6005
This commit is contained in:
Akihiro Motoki 2017-11-22 14:45:04 +00:00 committed by Ivan Kolodyazhny
parent 0b11ccb98f
commit 6c45c47e4b
21 changed files with 21 additions and 3 deletions
doc/source/contributor/tutorials
horizon/static/horizon/js
openstack_dashboard
static
app/core/trunks/details
dashboard/scss/components
templates
test
extensible_header_urls.py
test_panels/plugin_panel
templates/plugin_panel
views.py
test_plugins
themes/material/templates/header
urls.py
utils
views.py
tools
tox.ini

0
doc/source/contributor/tutorials/plugin.rst Executable file → Normal file

0
horizon/static/horizon/js/horizon.extensible_header.js Executable file → Normal file

0
openstack_dashboard/templates/header/_header.html Executable file → Normal file

0
openstack_dashboard/templates/horizon/_scripts.html Executable file → Normal file

0
openstack_dashboard/test/extensible_header_urls.py Executable file → Normal file

5
openstack_dashboard/test/test_plugins/panel_tests.py Executable file → Normal file

@ -64,8 +64,9 @@ class PanelPluginTests(test.PluginTestCase):
HORIZON_CONFIG['header_sections'])
def test_extensible_header(self):
response = self.client.get('/header/')
self.assertIn('sample context', response.content)
with self.settings(ROOT_URLCONF=self.urls):
response = self.client.get('/header/')
self.assertIn('sample context', response.content.decode('utf-8'))
def test_remove_panel(self):
dashboard = horizon.get_dashboard("admin")

0
openstack_dashboard/urls.py Executable file → Normal file

0
openstack_dashboard/utils/settings.py Executable file → Normal file

0
openstack_dashboard/views.py Executable file → Normal file

@ -0,0 +1,5 @@
./manage.py
./tools/abandon_old_reviews.sh
./tools/gate/integration/post_test_hook.sh
./tools/gate/integration/pre_test_hook.sh
./tools/unit_tests.sh

11
tools/find_executables.sh Normal file

@ -0,0 +1,11 @@
OUTPUT=`find . \( -name .tox -o -name .git \) -prune -o -type f -perm /a=x -print \
| grep -v -F -f ./tools/executable_files.txt`
if [ -n "$OUTPUT" ]; then
echo "Unexpected executable files are found:"
for f in $OUTPUT; do
echo $f
done
echo
echo "If you really need to add an executable file, add it to tools/executable_files.txt"
exit 1
fi

@ -66,8 +66,9 @@ commands =
[testenv:pep8]
commands =
{envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only
flake8 {posargs}
{envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only
bash {toxinidir}/tools/find_executables.sh
[testenv:cover]
commands =