##// END OF EJS Templates
tests: use `--no-cache-dir` with `pip`...
tests: use `--no-cache-dir` with `pip` After 1a09563a615c, there's one more wheel that gets cached in the user's pip cache in the macOS CI runner. The wheel corresponds to the version being used for the tests, but it doesn't get cached until the 3rd or 4th test shard is run, so it's not an issue with installing to run the tests. This seems to eliminate that. This doesn't seem to be an issue on Windows or Linux in my setup. Windows not being affected is likely because we set `$USERPROFILE` to redirect the home directory to `$TESTTMP` when running tests, since 08fd76a553c9. (When checking with `"$PYTHON" -m pip cache dir`, it points to `$TESTTMP/pip/cache`.) We do also set `$HOME` to this same location when running posix tests, but I can't tell what's going on locally in Linux, because running `pip` directly in the *.t explodes, and `"$PYTHON" -m pip --version` prints `pip 9.0.1 from /usr/lib/python3/dist-packages`, so that's likely before caching was enabled[1]. Running `python3.8 -m pip --version` locally outside of the *.t (the same version used to invoke the test runner), prints `pip 24.2 from /home/mharbison/.local/lib/python3.8/site-packages/pip (python 3.8)`. In CI, both macOS and Linux print a modern version of `pip`, and list the cache as being under `$TESTTMP`, but then it doesn't end up there on macOS. No idea if it is a pip bug, or what. But let's be explict and disable caching. [1] https://github.com/pypa/pip/blob/fe0925b3c00bf8956a0d33408df692ac364217d4/docs/html/topics/caching.md?plain=1#L37

File last commit:

r42094:cae3f7e3 default
r53221:519a997b stable
Show More
discovery-helper.sh
107 lines | 2.6 KiB | application/x-sh | BashLexer
#!/bin/bash
#
# produces two repositories with different common and missing subsets
#
# $ discovery-helper.sh REPO NBHEADS DEPT
#
# The Goal is to produce two repositories with some common part and some
# exclusive part on each side. Provide a source repository REPO, it will
# produce two repositories REPO-left and REPO-right.
#
# Each repository will be missing some revisions exclusive to NBHEADS of the
# repo topological heads. These heads and revisions exclusive to them (up to
# DEPTH depth) are stripped.
#
# The "left" repository will use the NBHEADS first heads (sorted by
# description). The "right" use the last NBHEADS one.
#
# To find out how many topological heads a repo has, use:
#
# $ hg heads -t -T '{rev}\n' | wc -l
#
# Example:
#
# The `pypy-2018-09-01` repository has 192 heads. To produce two repositories
# with 92 common heads and ~50 exclusive heads on each side.
#
# $ ./discovery-helper.sh pypy-2018-08-01 50 10
set -euo pipefail
printusage () {
echo "usage: `basename $0` REPO NBHEADS DEPTH [left|right]" >&2
}
if [ $# -lt 3 ]; then
printusage
exit 64
fi
repo="$1"
shift
nbheads="$1"
shift
depth="$1"
shift
doleft=1
doright=1
if [ $# -gt 1 ]; then
printusage
exit 64
elif [ $# -eq 1 ]; then
if [ "$1" == "left" ]; then
doleft=1
doright=0
elif [ "$1" == "right" ]; then
doleft=0
doright=1
else
printusage
exit 64
fi
fi
leftrepo="${repo}-${nbheads}h-${depth}d-left"
rightrepo="${repo}-${nbheads}h-${depth}d-right"
left="first(sort(heads(all()), 'desc'), $nbheads)"
right="last(sort(heads(all()), 'desc'), $nbheads)"
leftsubset="ancestors($left, $depth) and only($left, heads(all() - $left))"
rightsubset="ancestors($right, $depth) and only($right, heads(all() - $right))"
echo '### creating left/right repositories with missing changesets:'
if [ $doleft -eq 1 ]; then
echo '# left revset:' '"'${leftsubset}'"'
fi
if [ $doright -eq 1 ]; then
echo '# right revset:' '"'${rightsubset}'"'
fi
buildone() {
side="$1"
dest="$2"
revset="$3"
echo "### building $side repository: $dest"
if [ -e "$dest" ]; then
echo "destination repo already exists: $dest" >&2
exit 1
fi
echo '# cloning'
if ! cp --recursive --reflink=always ${repo} ${dest}; then
hg clone --noupdate "${repo}" "${dest}"
fi
echo '# stripping' '"'${revset}'"'
hg -R "${dest}" --config extensions.strip= strip --rev "$revset" --no-backup
}
if [ $doleft -eq 1 ]; then
buildone left "$leftrepo" "$leftsubset"
fi
if [ $doright -eq 1 ]; then
buildone right "$rightrepo" "$rightsubset"
fi