From 8345c4ef4c80205b3934391b51ea00437d245705 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 10 Feb 2025 09:51:06 -0800 Subject: [PATCH] Remove `python-hy` test Originally this was helpful as a deeper test of Python, but I don't think it's caught us any Python bugs, and just puts us at the forefront of Hy integration problems. "But Tianon," you might say, "isn't that a good thing?" Yes! Yes, it is. HOWEVER, we literally have the https://hub.docker.com/_/hylang image which would run into these same integration issues, but in a more appropriate place (such that they're only affecting updates to the Hy image, not PyPy or Python). So in short, we should remove that test instead, as much as I love it and find it extremely cute, since we'll keep it anyways on all the variants of the Hy image (but without that hairy if statement for filtering supported versions, because it'll only even run for supported versions, pre-filtered). --- test/README.md | 32 ++++++++--------- test/config.sh | 1 - test/run.sh | 2 +- test/tests/python-hy/container.cmd | 37 -------------------- test/tests/python-hy/container.hy | 1 - test/tests/python-hy/container.sh | 42 ----------------------- test/tests/python-hy/expected-std-out.txt | 1 - test/tests/python-hy/run.sh | 1 - 8 files changed, 15 insertions(+), 102 deletions(-) delete mode 100644 test/tests/python-hy/container.cmd delete mode 120000 test/tests/python-hy/container.hy delete mode 100644 test/tests/python-hy/container.sh delete mode 120000 test/tests/python-hy/expected-std-out.txt delete mode 120000 test/tests/python-hy/run.sh diff --git a/test/README.md b/test/README.md index d2708b5d02..695d6e4b71 100644 --- a/test/README.md +++ b/test/README.md @@ -8,7 +8,7 @@ $ ./run.sh usage: run.sh [-t test ...] image:tag [...] ie: run.sh debian:bookworm run.sh -t utc python:3 - run.sh -t utc python:3 -t python-hy + run.sh -t utc python:3 -t python-imports This script processes the specified Docker images to test their running environments. @@ -25,24 +25,24 @@ testing debian:bookworm 'debian-apt-get' [4/4]...passed ``` -Try to run just the `python-hy` test against the `debian:bookworm` image: (which doesn't contain Python) +Try to run just the `python-imports` test against the `debian:bookworm` image: (which doesn't contain Python) ```console -$ ./run.sh -t python-hy debian:bookworm +$ ./run.sh -t python-imports debian:bookworm testing debian:bookworm image has no tests...skipping ``` -Run the `utc` and `python-hy` tests against `python:3`, `pypy:3`, and `debian:bookworm`: +Run the `utc` and `python-imports` tests against `python:3`, `pypy:3`, and `debian:bookworm`: ```console -$ ./run.sh -t utc -t python-hy python:3 pypy:3 debian:bookworm +$ ./run.sh -t utc -t python-imports python:3 pypy:3 debian:bookworm testing python:3 'utc' [1/2]...passed - 'python-hy' [2/2]...passed + 'python-imports' [2/2]...passed testing pypy:3 'utc' [1/2]...passed - 'python-hy' [2/2]...passed + 'python-imports' [2/2]...passed testing debian:bookworm 'utc' [1/1]...passed ``` @@ -107,18 +107,14 @@ total 8 -rw-rw-r-- 1 tianon tianon 167 Mar 11 13:24 container.hy -rw-rw-r-- 1 tianon tianon 5 Mar 11 13:24 expected-std-out.txt lrwxrwxrwx 1 tianon tianon 25 Mar 11 13:25 run.sh -> ../run-hy-in-container.sh -$ ls -l tests/python-hy/ +$ ls -l tests/python-imports/ total 4 -lrwxrwxrwx 1 tianon tianon 25 Mar 11 13:25 container.hy -> ../hylang-sh/container.hy --rw-rw-r-- 1 tianon tianon 56 Mar 11 13:24 container.sh -lrwxrwxrwx 1 tianon tianon 33 Mar 11 13:25 expected-std-out.txt -> ../hylang-sh/expected-std-out.txt -lrwxrwxrwx 1 tianon tianon 27 Feb 5 16:52 run.sh -> ../run-bash-in-container.sh -$ cat tests/python-hy/container.sh -#!/bin/bash -set -e +-rw-r--r-- 1 tianon tianon 1096 Aug 29 16:14 container.py +lrwxrwxrwx 1 tianon tianon 29 Dec 15 2016 run.sh -> ../run-python-in-container.sh +$ head -n3 tests/python-imports/container.py +import platform, sys -pip install -q hy -hy ./container.hy +isWindows = platform.system() == 'Windows' ``` ## Configuring the Test Suite @@ -161,7 +157,7 @@ This array defines the list of explicit tests for each image. For example, the ` ```bash imageTests+=( [python]=' - python-hy + python-imports python-pip-requests-ssl ' [mysql]=' diff --git a/test/config.sh b/test/config.sh index 257b13b6cc..dbfca87b78 100644 --- a/test/config.sh +++ b/test/config.sh @@ -207,7 +207,6 @@ imageTests+=( postgres-initdb ' [python]=' - python-hy python-imports python-no-pyc python-pip-requests-ssl diff --git a/test/run.sh b/test/run.sh index 7d8d582f6a..c9ccdb7cb0 100755 --- a/test/run.sh +++ b/test/run.sh @@ -11,7 +11,7 @@ usage() { usage: $self [-t test ...] image:tag [...] ie: $self debian:bookworm $self -t utc python:3 - $self -t utc python:3 -t python-hy + $self -t utc python:3 -t python-imports This script processes the specified Docker images to test their running environments. diff --git a/test/tests/python-hy/container.cmd b/test/tests/python-hy/container.cmd deleted file mode 100644 index 2abb97a2b2..0000000000 --- a/test/tests/python-hy/container.cmd +++ /dev/null @@ -1,37 +0,0 @@ -@echo off - -for %%p in ( pypy3 pypy python3 python ) do ( - %%p --version >nul 2>&1 && ( - set python=%%p - goto found - ) -) -echo unable to run Hy test -- seems this image does not contain Python? >&2 -exit /b 1 - -:found -%python% --version >nul 2>&1 || exit /b %errorlevel% - -rem Hy is complicated, and uses Python's internal AST representation directly, and thus Hy releases usually lag behind a little on major Python releases (and we don't want that to gum up our tests) -rem see https://github.com/hylang/hy/issues/1111 for example breakage -rem also, it doesn't always support older (still supported) Python versions; https://github.com/hylang/hy/pull/2176 (3.6 support removal) -rem see "Programming Language" tags on https://pypi.org/project/hy/ for the current support range (see also version numbers below) -rem TODO allow 3.12 again once https://github.com/hylang/hy/issues/2598 / https://github.com/hylang/hy/pull/2599 is in a release (likely 0.29.1 or 0.30.0) -%python% -c "import sys; exit(not(sys.version_info[0] == 3 and 8 <= sys.version_info[1] <= 11))" || ( - echo skipping Hy test -- not allowed on Python less than 3.8 or greater than 3.11 ^(yet!^) >&2 - rem cheaters gunna cheat - type expected-std-out.txt - exit /b 0 -) - -rem ensure pip does not complain about a new version being available -set PIP_DISABLE_PIP_VERSION_CHECK=1 -rem or that a new version will no longer work with this python version -set PIP_NO_PYTHON_VERSION_WARNING=1 -rem https://pypi.org/project/hy/#history -rem https://pypi.org/project/hyrule/#history -pip install -q "hy==0.29.0" "hyrule==0.6.0" > NUL || exit /b %errorlevel% - -hy ./container.hy || exit /b %errorlevel% - -exit /b 0 diff --git a/test/tests/python-hy/container.hy b/test/tests/python-hy/container.hy deleted file mode 120000 index b3e0802268..0000000000 --- a/test/tests/python-hy/container.hy +++ /dev/null @@ -1 +0,0 @@ -../hylang-sh/container.hy \ No newline at end of file diff --git a/test/tests/python-hy/container.sh b/test/tests/python-hy/container.sh deleted file mode 100644 index 3ce9ad517a..0000000000 --- a/test/tests/python-hy/container.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -set -eu - -python= -for c in pypy3 pypy python3 python; do - if [ -x "/usr/local/bin/$c" ]; then - python="/usr/local/bin/$c" - break - fi -done - -if [ -z "$python" ]; then - echo >&2 'unable to run Hy test -- seems this image does not contain Python?' - exit 1 -fi - -# Hy is complicated, and uses Python's internal AST representation directly, and thus Hy releases usually lag behind a little on major Python releases (and we don't want that to gum up our tests) -# see https://github.com/hylang/hy/issues/1111 for example breakage -# also, it doesn't always support older (still supported) Python versions; https://github.com/hylang/hy/pull/2176 (3.6 support removal) -# see "Programming Language" tags on https://pypi.org/project/hy/ for the current support range (see also version numbers below) -# TODO allow 3.12 again once https://github.com/hylang/hy/issues/2598 / https://github.com/hylang/hy/pull/2599 is in a release (likely 0.29.1 or 0.30.0) -if ! "$python" -c 'import sys; exit(not(sys.version_info[0] == 3 and 8 <= sys.version_info[1] <= 11))'; then - echo >&2 'skipping Hy test -- not allowed on Python less than 3.8 or greater than 3.11 (yet!)' - # cheaters gunna cheat - cat expected-std-out.txt - exit -fi - -( - # ensure pip does not complain about a new version being available - export PIP_DISABLE_PIP_VERSION_CHECK=1 - # or that a new version will no longer work with this python version - export PIP_NO_PYTHON_VERSION_WARNING=1 - # ensure pip does not complain about running about root - export PIP_ROOT_USER_ACTION=ignore - - # https://pypi.org/project/hy/#history - # https://pypi.org/project/hyrule/#history - pip install -q 'hy==0.29.0' 'hyrule==0.6.0' > /dev/null -) - -hy ./container.hy diff --git a/test/tests/python-hy/expected-std-out.txt b/test/tests/python-hy/expected-std-out.txt deleted file mode 120000 index 0eaec230a1..0000000000 --- a/test/tests/python-hy/expected-std-out.txt +++ /dev/null @@ -1 +0,0 @@ -../hylang-sh/expected-std-out.txt \ No newline at end of file diff --git a/test/tests/python-hy/run.sh b/test/tests/python-hy/run.sh deleted file mode 120000 index 648246b829..0000000000 --- a/test/tests/python-hy/run.sh +++ /dev/null @@ -1 +0,0 @@ -../run-sh-in-container.sh \ No newline at end of file