Merge pull request #7854 from edx/ned/te-855
Run pylint on all our code, and only our code. TE-855
This commit is contained in:
0
common/test/__init__.py
Normal file
0
common/test/__init__.py
Normal file
@@ -4,8 +4,8 @@ Acceptance tests for Studio related to the asset index page.
|
||||
|
||||
from ...pages.studio.asset_index import AssetIndexPage
|
||||
|
||||
from acceptance.tests.studio.base_studio_test import StudioCourseTest
|
||||
from acceptance.fixtures.base import StudioApiLoginError
|
||||
from .base_studio_test import StudioCourseTest
|
||||
from ...fixtures.base import StudioApiLoginError
|
||||
|
||||
|
||||
class AssetIndexTest(StudioCourseTest):
|
||||
|
||||
@@ -3,7 +3,7 @@ Acceptance tests for Studio's Settings Details pages
|
||||
"""
|
||||
from unittest import skip
|
||||
|
||||
from acceptance.tests.studio.base_studio_test import StudioCourseTest
|
||||
from .base_studio_test import StudioCourseTest
|
||||
from ...fixtures.course import CourseFixture
|
||||
from ...pages.studio.settings import SettingsPage
|
||||
from ...pages.studio.overview import CourseOutlinePage
|
||||
|
||||
@@ -7,7 +7,27 @@ import re
|
||||
|
||||
from .utils.envs import Env
|
||||
|
||||
ALL_SYSTEMS = 'lms,cms,common'
|
||||
ALL_SYSTEMS = 'lms,cms,common,openedx,pavelib'
|
||||
|
||||
|
||||
def top_python_dirs(dirname):
|
||||
"""
|
||||
Find the directories to start from in order to find all the Python files in `dirname`.
|
||||
"""
|
||||
top_dirs = []
|
||||
|
||||
dir_init = os.path.join(dirname, "__init__.py")
|
||||
if os.path.exists(dir_init):
|
||||
top_dirs.append(dirname)
|
||||
|
||||
for directory in ['djangoapps', 'lib']:
|
||||
subdir = os.path.join(dirname, directory)
|
||||
subdir_init = os.path.join(subdir, "__init__.py")
|
||||
if os.path.exists(subdir) and not os.path.exists(subdir_init):
|
||||
dirs = os.listdir(subdir)
|
||||
top_dirs.extend(d for d in dirs if os.path.isdir(os.path.join(subdir, d)))
|
||||
|
||||
return top_dirs
|
||||
|
||||
|
||||
@task
|
||||
@@ -27,13 +47,7 @@ def find_fixme(options):
|
||||
# This makes the folder if it doesn't already exist.
|
||||
report_dir = (Env.REPORT_DIR / system).makedirs_p()
|
||||
|
||||
apps = [system]
|
||||
|
||||
for directory in ['djangoapps', 'lib']:
|
||||
dirs = os.listdir(os.path.join(system, directory))
|
||||
apps.extend([d for d in dirs if os.path.isdir(os.path.join(system, directory, d))])
|
||||
|
||||
apps_list = ' '.join(apps)
|
||||
apps_list = ' '.join(top_python_dirs(system))
|
||||
|
||||
pythonpath_prefix = (
|
||||
"PYTHONPATH={system}:{system}/lib"
|
||||
@@ -88,13 +102,7 @@ def run_pylint(options):
|
||||
if errors:
|
||||
flags.append("--errors-only")
|
||||
|
||||
apps = [system]
|
||||
|
||||
for directory in ['lib']:
|
||||
dirs = os.listdir(os.path.join(system, directory))
|
||||
apps.extend([d for d in dirs if os.path.isdir(os.path.join(system, directory, d))])
|
||||
|
||||
apps_list = ' '.join(apps)
|
||||
apps_list = ' '.join(top_python_dirs(system))
|
||||
|
||||
pythonpath_prefix = (
|
||||
"PYTHONPATH={system}:{system}/djangoapps:{system}/"
|
||||
|
||||
@@ -61,7 +61,7 @@ git clean -qxfd
|
||||
source scripts/jenkins-common.sh
|
||||
|
||||
# Violations thresholds for failing the build
|
||||
PYLINT_THRESHOLD=6400
|
||||
PYLINT_THRESHOLD=7350
|
||||
|
||||
# If the environment variable 'SHARD' is not set, default to 'all'.
|
||||
# This could happen if you are trying to use this script from
|
||||
|
||||
Reference in New Issue
Block a user