Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed static check for py2 and only run tests for edited extensions #244

Merged
merged 2 commits into from
Jul 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ install:
- pip install pylint==1.9.2 flake8 requests wheel==0.30.0 -q
jobs:
include:
- stage: precheck
env: PURPOSE='SourceStatic'
script: ./scripts/ci/test_static.sh
python: 2.7
- stage: precheck
env: PURPOSE='SourceStatic'
script: ./scripts/ci/test_static.sh
Expand All @@ -21,11 +17,11 @@ jobs:
python: 3.6
- stage: verify
env: PURPOSE='SourceTests'
script: travis_wait 40 ./scripts/ci/test_source.sh
script: ./scripts/ci/test_source.sh
python: 2.7
- stage: verify
env: PURPOSE='SourceTests'
script: travis_wait 40 ./scripts/ci/test_source.sh
script: ./scripts/ci/test_source.sh
python: 3.6
- stage: verify
env: PURPOSE='IndexRefDocVerify'
Expand Down
17 changes: 12 additions & 5 deletions scripts/ci/test_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,18 @@

for src_d in os.listdir(SRC_PATH):
src_d_full = os.path.join(SRC_PATH, src_d)
if os.path.isdir(src_d_full):
pkg_name = next((d for d in os.listdir(src_d_full) if d.startswith('azext_')), None)
# Find the package and check it has tests
if pkg_name and os.path.isdir(os.path.join(src_d_full, pkg_name, 'tests')):
ALL_TESTS.append((pkg_name, src_d_full))
if not os.path.isdir(src_d_full):
continue
pkg_name = next((d for d in os.listdir(src_d_full) if d.startswith('azext_')), None)

# If running in Travis CI, only run tests for edited extensions
commit_range = os.environ.get('TRAVIS_COMMIT_RANGE')
if commit_range and not check_output(['git', '--no-pager', 'diff', '--name-only', commit_range, '--', src_d_full]):
continue

# Find the package and check it has tests
if pkg_name and os.path.isdir(os.path.join(src_d_full, pkg_name, 'tests')):
ALL_TESTS.append((pkg_name, src_d_full))


class TestExtensionSourceMeta(type):
Expand Down