-
Notifications
You must be signed in to change notification settings - Fork 11
/
venv_test_harness_functions.bash
executable file
·58 lines (43 loc) · 1.88 KB
/
venv_test_harness_functions.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Set up isolated, clean ypkg_test_venv python venv
#
# This is designed to be sourced from other bash scripts
function prepare_venv () {
# Assume the user starts in the ypkg dir
echo ">>> Updating the ypkg git repo ..."
# ensure we show the current branch
git fetch && git pull && git branch
echo ">>> Cloning or updating the eopkg git repo ..."
# assume that eopkg lives in ../eopkg
git -C ../ clone https://github.com/getsolus/eopkg.git || \
{ git -C ../eopkg/ switch master && git -C ../eopkg/ fetch && git -C ../eopkg/ switch python3 && git -C ../eopkg/ pull ; }
# show available eopkg branches
git -C ../eopkg/ branch
echo ">>> Set up a clean ypkg_test_venv with symlink to ../eopkg/pisi in venv site-packages/ dir ..."
python3 -m venv --clear ypkg_test_venv
ln -srv ../eopkg/pisi ypkg_test_venv/lib/python3.11/site-packages/
source ypkg_test_venv/bin/activate
python3 -m pip install -r requirements.txt
install_solus_prereq_pkgs
}
function install_solus_prereq_pkgs () {
# we are currently carrying a patch to iksemel that has not yet been upstreamed
sudo eopkg it iksemel
ln -srv /usr/lib/python3.11/site-packages/iksemel.cpython-311-x86_64-linux-gnu.so ypkg_test_venv/lib/python3.11/site-packages/
}
function help () {
cat << EOF
1. To activate the newly prepared ypkg_test_venv, execute:
source ypkg_test_venv/bin/activate /
source ypkg_test_venv/bin/activate.fish /
source ypkg_test_venv/bin/activate.zsh
... depending on which shell you use.
2. When you are done testing, execute:
deactivate
... to exit the ypkg_test_venv venv.
3. To run the integration tests, execute:
./run_release_tests.sh
... this will run in a clean checkout + ypkg_test_venv
and will deactivate the ypkg_test_venv venv after
run is done.
EOF
}