Skip to content

Commit

Permalink
{CI} Fix tests not belonging to the changed extension are running (#4637
Browse files Browse the repository at this point in the history
)

* fix-4565

* update

* add log

* update

* update

* Update test_source.py
  • Loading branch information
wangzelin007 authored Apr 6, 2022
1 parent 815d196 commit 57412be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
- bash: ./scripts/ci/test_source.sh
displayName: 'Run integration test and build test'
env:
ADO_PULL_REQUEST_LATEST_COMMIT: $(System.PullRequest.SourceCommitId)
ADO_PULL_REQUEST_LATEST_COMMIT: HEAD
ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch)

- job: LintModifiedExtensions
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
AZURE_EXTENSION_DIR=~/.azure/cliextensions python scripts/ci/verify_linter.py
displayName: "CLI Linter on Modified Extension"
env:
ADO_PULL_REQUEST_LATEST_COMMIT: $(System.PullRequest.SourceCommitId)
ADO_PULL_REQUEST_LATEST_COMMIT: HEAD
ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
- job: IndexRefDocVerify
Expand Down
6 changes: 6 additions & 0 deletions scripts/ci/test_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from __future__ import print_function

import logging
import os
import sys
import tempfile
Expand All @@ -21,6 +22,7 @@

from util import SRC_PATH

logger = logging.getLogger(__name__)

ALL_TESTS = []

Expand Down Expand Up @@ -55,6 +57,10 @@
if pkg_name and os.path.isdir(os.path.join(src_d_full, pkg_name, 'tests')):
ALL_TESTS.append((pkg_name, src_d_full))

logger.warning(f'ado_branch_last_commit: {ado_branch_last_commit}, '
f'ado_target_branch: {ado_target_branch}, '
f'ALL_TESTS: {ALL_TESTS}.')


class TestExtensionSourceMeta(type):
def __new__(mcs, name, bases, _dict):
Expand Down

0 comments on commit 57412be

Please sign in to comment.