suneet-s commented on a change in pull request #11238: URL: https://github.com/apache/druid/pull/11238#discussion_r631896897
########## File path: check-test-suite.py ########## @@ -0,0 +1,125 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import subprocess +import sys + +# do some primitive examination of git diff to determine if a test suite needs to be run or not + +always_run_jobs = ['license checks', '(openjdk8) packaging check', '(openjdk11) packaging check'] + +# ignore changes to these files completely since they don't impact CI, if the changes are only to these files then all +# of CI can be skipped +ignore_prefixes = ['.github', '.idea', '.asf.yaml', '.backportrc.json', '.codecov.yml', '.dockerignore', '.gitignore', + '.lgtm.yml', 'CONTRIBUTING.md', 'setup-hooks.sh', 'upload.sh', 'dev', 'distribution/docker', + 'distribution/asf-release-process-guide.md', '.travis.yml', 'check-test-suite.py'] +# these files are docs changes +# if changes are limited to this set then we can skip web-console and java +# if no changes in this set we can skip docs +docs_prefixes = ['docs/', 'website/'] +# travis docs job name +docs_jobs = ['docs'] +# these files are web-console changes +# if changes are limited to this set then we can skip docs and java +# if no changes in this set we can skip web-console +web_console_prefixes = ['web-console/'] +# travis web-console job name +web_console_jobs = ['web console', 'web console end-to-end test'] + + +def check_ignore(file): + is_always_ignore = True in (file.startswith(prefix) for prefix in ignore_prefixes) + if is_always_ignore: + print("found ignorable file change: {}".format(file)) + return is_always_ignore + +def check_docs(file): + is_docs = True in (file.startswith(prefix) for prefix in docs_prefixes) + if is_docs: + print("found docs file change: {}".format(file)) + return is_docs + +def check_console(file): + is_console = True in (file.startswith(prefix) for prefix in web_console_prefixes) + if is_console: + print("found web-console file change: {}".format(file)) + return is_console + +def check_should_run_suite(suite, diff_files): Review comment: the logic in this function seems quite involved, could you add a comment explaining what it's aiming to do -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
