performance comparison

This commit is contained in:
Alexander Kuzmenkov 2020-06-05 17:30:26 +03:00
parent ecca78d855
commit 29adb1cbcf
2 changed files with 14 additions and 8 deletions

View File

@ -104,13 +104,12 @@ function run_tests
# allows the tests to pass even when we add new functions and tests for # allows the tests to pass even when we add new functions and tests for
# them, that are not supported in the old revision. # them, that are not supported in the old revision.
test_prefix=left/performance test_prefix=left/performance
elif [ "$PR_TO_TEST" != "" ] && [ "$PR_TO_TEST" != "0" ] else
then
# For PRs, use newer test files so we can test these changes. # For PRs, use newer test files so we can test these changes.
test_prefix=right/performance test_prefix=right/performance
# If some tests were changed in the PR, we may want to run only these # If only the perf tests were changed in the PR, we will run only these
# ones. The list of changed tests in changed-test.txt is prepared in # tests. The list of changed tests in changed-test.txt is prepared in
# entrypoint.sh from git diffs, because it has the cloned repo. Used # entrypoint.sh from git diffs, because it has the cloned repo. Used
# to use rsync for that but it was really ugly and not always correct # to use rsync for that but it was really ugly and not always correct
# (e.g. when the reference SHA is really old and has some other # (e.g. when the reference SHA is really old and has some other

View File

@ -83,10 +83,17 @@ if [ "$REF_PR" == "" ]; then echo Reference PR is not specified ; exit 1 ; fi
if [ "$PR_TO_TEST" != "0" ] if [ "$PR_TO_TEST" != "0" ]
then then
# Prepare the list of tests changed in the PR for use by compare.sh. Compare to # If the PR only changes the tests and nothing else, prepare a list of these
# merge base, because master might be far in the future and have unrelated test # tests for use by compare.sh. Compare to merge base, because master might be
# changes. # far in the future and have unrelated test changes.
git -C ch diff --name-only "$SHA_TO_TEST" "$(git -C ch merge-base "$SHA_TO_TEST" master)" -- tests/performance | tee changed-tests.txt base=$(git -C ch merge-base "$SHA_TO_TEST" master)
git -C ch diff --name-only "$SHA_TO_TEST" "$base" | tee changed-tests.txt
if grep -vq '^tests/performance' changed-tests.txt
then
# Have some other changes besides the tests, so truncate the test list,
# meaning, run all tests.
: > changed-tests.txt
fi
fi fi
# Set python output encoding so that we can print queries with Russian letters. # Set python output encoding so that we can print queries with Russian letters.