Skip to content

Commit 09101e6

Browse files
authored
[#47] Re-enable compat tests. (#69)
* Use production packages. * Updated populating cache for compat tests. * Readded compat tests through GHA. * Readded compat tests through GHA, take 2. * Readded compat tests through GHA, take 3. * Run docker builds and tests as a regular user. * Run docker builds and tests as a regular user, take 2 * Run docker builds and tests as a regular user, take 3 * Run docker builds and tests as a regular user, take 4 * Run docker builds and tests as a regular user, take 5 * Put paxctl where it's easier to find. * Also try test_ci2 compat tests. * Install sudo for elevated tests. * Final tweaks. * Final tweaks, take 2. * Final tweaks, take 3. * Changes after own review. * Changes after own review, take two. * Changes after own review, take three.
1 parent bb41ace commit 09101e6

File tree

5 files changed

+73
-23
lines changed

5 files changed

+73
-23
lines changed

.github/workflows/bare.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ concurrency:
1414
group: bare-${{ github.ref }}
1515
cancel-in-progress: true
1616

17+
env:
18+
CI: 'true'
19+
1720
jobs:
1821
windows:
1922
# The type of runner that the job will run on
@@ -40,6 +43,13 @@ jobs:
4043
timeout-minutes: 5
4144
run: bash ./build.sh test
4245

46+
- name: Test compat
47+
timeout-minutes: 10
48+
env:
49+
USER: runneradmin
50+
CODECOV_TOKEN: local
51+
run: bash ./build.sh compat
52+
4353
# Commit changed requirements.txt back to the repository
4454
- uses: chevah/git-auto-commit-action@HEAD
4555
with:
@@ -127,6 +137,12 @@ jobs:
127137
timeout-minutes: 5
128138
run: ./build.sh test
129139

140+
- name: Test compat
141+
timeout-minutes: 10
142+
env:
143+
CODECOV_TOKEN: local
144+
run: ./build.sh compat
145+
130146
- name: Upload testing package
131147
timeout-minutes: 5
132148
run: |
@@ -161,6 +177,12 @@ jobs:
161177
timeout-minutes: 5
162178
run: ./build.sh test
163179

180+
- name: Test compat
181+
timeout-minutes: 10
182+
env:
183+
CODECOV_TOKEN: local
184+
run: ./build.sh compat
185+
164186
- name: Upload testing package
165187
timeout-minutes: 5
166188
run: |

.github/workflows/docker.yaml

+25-7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ concurrency:
1515
group: docker-${{ github.ref }}
1616
cancel-in-progress: true
1717

18+
env:
19+
CI: 'true'
1820

1921
# Using a job name that doesn't contain the OS name, to minimize the risk of
2022
# confusion with the OS names of the containers, which are the relevant ones.
@@ -35,16 +37,16 @@ jobs:
3537
if: startsWith(matrix.container, 'alpine')
3638
run: |
3739
apk upgrade -U
38-
apk add git curl bash gcc make m4 patch musl-dev linux-headers lddtree shadow openssh-client file unzip perl g++ musl-locales dejagnu
40+
apk add git curl bash gcc make m4 patch musl-dev linux-headers lddtree shadow openssh-client file unzip perl g++ musl-locales dejagnu sudo
3941
apk del util-linux-dev
40-
curl --output /usr/local/bin/paxctl https://bin.chevah.com:20443/third-party-stuff/alpine/paxctl-3.12
41-
chmod +x /usr/local/bin/paxctl
42+
curl --output /usr/bin/paxctl https://bin.chevah.com:20443/third-party-stuff/alpine/paxctl-3.12
43+
chmod +x /usr/bin/paxctl
4244
4345
- name: Amazon setup
4446
if: startsWith(matrix.container, 'amazonlinux')
4547
run: |
4648
yum -y upgrade
47-
yum -y install git-core gcc make m4 patch tar unzip perl perl-Test-Simple perl-IPC-Cmd xz gcc-c++ dejagnu bzip2
49+
yum -y install git-core gcc make m4 patch tar unzip perl perl-Test-Simple perl-IPC-Cmd xz gcc-c++ dejagnu bzip2 sudo
4850
# To avoid linking against libdb and gdmb libraries on Amazon Linux 2.
4951
# Can't simply uninstall libdb-devel and gdmb-devel, they are required by perl-IPC-Cmd.
5052
rm -v /usr/include/libdb/db.h
@@ -57,25 +59,41 @@ jobs:
5759
run: |
5860
apt update
5961
apt --yes dist-upgrade
60-
apt --yes install wget curl gcc make m4 patch openssh-client unzip git libtest-simple-perl xz-utils g++ dejagnu
62+
apt --yes install wget curl gcc make m4 patch openssh-client unzip git libtest-simple-perl xz-utils g++ dejagnu sudo
6163
64+
# actions/checkout doesn't work on Amazon Linux 2, requires glibc 2.27.
6265
- name: Clone repo independently
6366
run: |
6467
git clone https://github.com/chevah/pythia.git
6568
cd pythia
6669
git checkout ${GITHUB_HEAD_REF}
6770
71+
- name: Chevah user setup
72+
run: |
73+
useradd -g adm -s /bin/bash -m chevah
74+
echo '%adm ALL=NOPASSWD: ALL' > /etc/sudoers
75+
6876
- name: Build Pythia
6977
timeout-minutes: 30
7078
run: |
79+
chown -R chevah pythia
7180
cd pythia
72-
./build.sh build
81+
su chevah -c "./build.sh build"
7382
7483
- name: Test Pythia
7584
timeout-minutes: 5
7685
run: |
7786
cd pythia
78-
./build.sh test
87+
su chevah -c "./build.sh test"
88+
89+
- name: Test compat
90+
timeout-minutes: 10
91+
env:
92+
USER: chevah
93+
CODECOV_TOKEN: local
94+
run: |
95+
cd pythia
96+
su chevah -c "./build.sh compat"
7997
8098
# Using `~/` is problematic under Docker, use `/root/`.
8199
# Remove key in same step to avoid leaving it on disk if publishing fails.

build.sh

+23-13
Original file line numberDiff line numberDiff line change
@@ -260,28 +260,38 @@ command_test() {
260260
# shellcheck disable=SC2034 # Only used through compgen.
261261
help_text_compat="Run the test suite from chevah/compat master."
262262
command_compat() {
263-
local new_python_conf="$PYTHON_BUILD_VERSION.$PYTHIA_VERSION"
263+
local new_python_ver="$PYTHON_BUILD_VERSION.$PYTHIA_VERSION"
264264
execute pushd "$BUILD_DIR"
265265

266266
# This is quite hackish, as compat is arm-twisted to use the local version.
267267
echo "::group::Compat tests"
268268
echo "#### Running chevah's compat tests... ####"
269269
echo "## Removing any pre-existing compat code... ##"
270270
execute rm -rf compat/
271+
echo "## Cloning compat's master branch... ##"
271272
execute git clone https://github.com/chevah/compat.git --depth=1 -b master
272273
execute pushd compat
273-
# Copy over current pythia stuff, as some changes might require it.
274-
execute cp ../../pythia.{conf,sh} ./
275-
# Patch compat to use the newly-built Python, then copy it to cache/.
276-
echo -e "\nPYTHON_CONFIGURATION=default@${new_python_conf}" >> pythia.conf
277-
execute mkdir cache
278-
execute cp -r ../"$PYTHON_BUILD_DIR" cache/
279-
# Make sure everything is done from scratch in the current dir.
280-
unset CHEVAH_CACHE CHEVAH_BUILD
281-
# Some tests might still fail due to causes not related to the new Python.
282-
execute ./pythia.sh deps
283-
execute ./pythia.sh test_ci
284-
274+
# Make sure everything is done from scratch in the current dir.
275+
echo "## Unsetting CHEVAH_CACHE and CHEVAH_BUILD... ##"
276+
unset CHEVAH_CACHE CHEVAH_BUILD
277+
# Copy over current pythia stuff, as some changes might require it.
278+
echo "## Patching compat code to use current pythia version... ##"
279+
execute cp ../../pythia.{conf,sh} ./
280+
# Patch compat to use the current's branch version.
281+
echo -e "\nPYTHON_CONFIGURATION=default@${new_python_ver}" >>pythia.conf
282+
execute mkdir cache
283+
# Copy dist file to local cache, if existing. If not, maybe it's online.
284+
cp ../../"$DIST_DIR"/"$PYTHON_BUILD_VERSION.$PYTHIA_VERSION"/* cache/
285+
# Some tests could fail due to causes not related to the new Python.
286+
echo "## Getting compat deps... ##"
287+
execute ./pythia.sh deps
288+
echo "## Running normal compat tests... ##"
289+
# Why not test_normal? See https://github.com/chevah/compat/issues/691.
290+
execute ./pythia.sh test -vs normal
291+
if [ "${CI:-}" = "true" ]; then
292+
echo "## Running ci2 compat tests... ##"
293+
execute ./pythia.sh test_ci2
294+
fi
285295
execute popd
286296
echo "::endgroup::"
287297
}

pkg_checks.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ case "$OS" in
5555
linux*)
5656
if [ -x /sbin/apk ]; then
5757
# Assumes Alpine Linux 3.15.
58-
CHECK_CMD=(apk info -q -e)
58+
CHECK_CMD=(/sbin/apk info -q -e)
5959
PACKAGES="$APK_PKGS"
6060
elif [ -x /usr/bin/dpkg ]; then
6161
# Assumes Ubuntu Linux 16.04.

pythia.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# When building a new major Python version, e.g. 3.11->3.12,
22
# update this in advance (e.g. use "default@3.12.0.deadbeef"),
33
# and remove BUILD_ENV_* files (e.g. with `./build.sh clean -a`).
4-
PYTHON_CONFIGURATION="default@3.12.7.ac6595f"
4+
PYTHON_CONFIGURATION="default@3.12.7.bb41ace"
55
# This is defined as a Bash array of options to be passed to commands.
66
BASE_REQUIREMENTS=("chevah-brink==1.0.15" "paver==1.3.4")
77
# Use our private PyPi server instead of the default one set in pythia.sh.
88
PIP_INDEX_URL="https://bin.chevah.com:20443/pypi/simple"
99
# Use our production server instead of the GitHub releases set by default.
1010
BINARY_DIST_URI="https://bin.chevah.com:20443/production"
1111
# For testing packages, make sure this one is the last uncommented instance:
12-
BINARY_DIST_URI="https://bin.chevah.com:20443/testing"
12+
#BINARY_DIST_URI="https://bin.chevah.com:20443/testing"
1313
# This directory is used by the Python runtime.
1414
CHEVAH_BUILD_DIR="build-py3"

0 commit comments

Comments
 (0)