浏览代码

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).
Tianon Gravi 8 月之前
父节点
当前提交
8345c4ef4c

+ 14 - 18
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]='

+ 0 - 1
test/config.sh

@@ -207,7 +207,6 @@ imageTests+=(
 		postgres-initdb
 	'
 	[python]='
-		python-hy
 		python-imports
 		python-no-pyc
 		python-pip-requests-ssl

+ 1 - 1
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.

+ 0 - 37
test/tests/python-hy/container.cmd

@@ -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

+ 0 - 1
test/tests/python-hy/container.hy

@@ -1 +0,0 @@
-../hylang-sh/container.hy

+ 0 - 42
test/tests/python-hy/container.sh

@@ -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

+ 0 - 1
test/tests/python-hy/expected-std-out.txt

@@ -1 +0,0 @@
-../hylang-sh/expected-std-out.txt

+ 0 - 1
test/tests/python-hy/run.sh

@@ -1 +0,0 @@
-../run-sh-in-container.sh