mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Split perf test into multiple checks
This commit is contained in:
parent
eb51d9550d
commit
cf281b10dc
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@ -73,7 +73,7 @@ jobs:
|
||||
docker kill $(docker ps -q) ||:
|
||||
docker rm -f $(docker ps -a -q) ||:
|
||||
sudo rm -fr $TEMP_PATH
|
||||
PerformanceComparison:
|
||||
PerformanceComparison1:
|
||||
needs: [BuilderPerformance]
|
||||
runs-on: [self-hosted, perf-tester]
|
||||
steps:
|
||||
@ -89,8 +89,8 @@ jobs:
|
||||
REPORTS_PATH: ${{runner.temp}}/reports_dir
|
||||
CHECK_NAME: 'Performance Comparison (actions)'
|
||||
REPO_COPY: ${{runner.temp}}/performance_comparison/ClickHouse
|
||||
RAMDRIVE_PATH: ${{runner.temp}}/performance_comparison/ramdrive
|
||||
RAMDRIVE_SIZE: '30G'
|
||||
RUN_BY_HASH_NUM: 1
|
||||
RUN_BY_HASH_TOTAL: 3
|
||||
run: |
|
||||
sudo rm -fr $TEMP_PATH
|
||||
mkdir -p $TEMP_PATH
|
||||
|
@ -207,6 +207,22 @@ function run_tests
|
||||
test_files=$(ls "$test_prefix"/*.xml)
|
||||
fi
|
||||
|
||||
# We split perf tests into multiple checks to make them faster
|
||||
if [ -v CHPC_TEST_RUN_BY_HASH_TOTAL ]; then
|
||||
# filter tests array in bash https://stackoverflow.com/a/40375567
|
||||
for index in "${!test_files[@]}"; do
|
||||
# sorry for this, just calculating hash(test_name) % total_tests_group == my_test_group_num
|
||||
test_hash_result=$(echo test_files[$index] | perl -ne 'use Digest::MD5 qw(md5); print unpack('Q', md5($_)) % $ENV{CHPC_TEST_RUN_BY_HASH_TOTAL} == $ENV{CHPC_TEST_RUN_BY_HASH_NUM};')
|
||||
# BTW, for some reason when hash(test_name) % total_tests_group != my_test_group_num perl outputs nothing, not zero
|
||||
if [ "$test_hash_result" != "1" ]; then
|
||||
# deleting element from array
|
||||
unset -v 'test_files[$index]'
|
||||
fi
|
||||
done
|
||||
# to have sequential indexes...
|
||||
test_files=("${test_files[@]}")
|
||||
fi
|
||||
|
||||
# For PRs w/o changes in test definitons, test only a subset of queries,
|
||||
# and run them less times. If the corresponding environment variables are
|
||||
# already set, keep those values.
|
||||
|
@ -45,7 +45,8 @@ if __name__ == "__main__":
|
||||
temp_path = os.getenv("TEMP_PATH", os.path.abspath("."))
|
||||
repo_path = os.getenv("REPO_COPY", os.path.abspath("../../"))
|
||||
ramdrive_path = os.getenv("RAMDRIVE_PATH", os.path.join(temp_path, "ramdrive"))
|
||||
ramdrive_size = os.getenv("RAMDRIVE_SIZE", '30G')
|
||||
# currently unused, doesn't make tests more stable
|
||||
ramdrive_size = os.getenv("RAMDRIVE_SIZE", '0G')
|
||||
reports_path = os.getenv("REPORTS_PATH", "./reports")
|
||||
|
||||
check_name = sys.argv[1]
|
||||
@ -73,6 +74,11 @@ if __name__ == "__main__":
|
||||
docker_env += ' -e CHPC_ADD_REPORT_LINKS="<a href={}>Job (actions)</a> <a href={}>Tested commit</a>"'.format(
|
||||
task_url, pr_link)
|
||||
|
||||
if 'RUN_BY_HASH_TOTAL' in os.environ:
|
||||
run_by_hash_total = int(os.getenv('RUN_BY_HASH_TOTAL'))
|
||||
run_by_hash_num = int(os.getenv('RUN_BY_HASH_NUM'))
|
||||
docker_env += f' -e CHPC_TEST_RUN_BY_HASH_TOTAL={run_by_hash_total} -e CHPC_TEST_RUN_BY_HASH_NUM={run_by_hash_num}'
|
||||
|
||||
docker_image = get_image_with_version(reports_path, IMAGE_NAME)
|
||||
|
||||
#with RamDrive(ramdrive_path, ramdrive_size):
|
||||
|
Loading…
Reference in New Issue
Block a user