Skip to content

Commit

Permalink
add ignore list for samples (Azure#15976)
Browse files Browse the repository at this point in the history
* add ignore list for samples

* add sample to ignore for eventgrid
  • Loading branch information
kristapratico authored and rakshith91 committed Jan 8, 2021
1 parent afb152f commit afcd21e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/devops_tasks/test_run_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@

root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "..", ".."))

IGNORED_SAMPLES = {
"azure-eventgrid": ["__init__.py"]
}


def run_samples(targeted_package):
logging.info("running samples for {}".format(targeted_package))

samples_errors = []
sample_paths = []
samples_dir_path = os.path.abspath(os.path.join(targeted_package, "samples"))
package_name = os.path.basename(targeted_package)

for path, subdirs, files in os.walk(samples_dir_path):
for name in files:
if fnmatch(name, "*.py"):
if fnmatch(name, "*.py") and name not in IGNORED_SAMPLES.get(package_name, []):
sample_paths.append(os.path.abspath(os.path.join(path, name)))

if not sample_paths:
Expand Down

0 comments on commit afcd21e

Please sign in to comment.