summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Hupp <adam@hupp.org>2022-04-25 06:47:40 -0700
committerAdam Hupp <adam@hupp.org>2022-04-25 06:55:20 -0700
commit6b34bde052be74334dad71963d92a1c49eecd168 (patch)
tree586d4ff533a2d486bff65a26e237b2516fa11973
parent0fb1922da4a7b27bd19b75a03dca2f51bff4362f (diff)
downloadpython-magic-6b34bde052be74334dad71963d92a1c49eecd168.tar.gz
improve test script name clarity; expand test docs; cleanup docker run script
-rw-r--r--test/README12
-rwxr-xr-xtest/run_all_docker_test.sh13
-rw-r--r--test/run_all_versions.py (renamed from test/run.py)0
-rwxr-xr-xtest_docker.sh18
4 files changed, 17 insertions, 26 deletions
diff --git a/test/README b/test/README
index 12d4e4f..c34cb6a 100644
--- a/test/README
+++ b/test/README
@@ -1,10 +1,6 @@
-To run the tests across a selection of Ubuntu LTS versions:
+There are a few ways to run the python-magic tests
-docker build -t "python_magic/xenial:latest" -f test/Dockerfile_xenial .
-docker build -t "python_magic/bionic:latest" -f test/Dockerfile_bionic .
-docker build -t "python_magic/focal:latest" -f test/Dockerfile_focal .
-
-docker run python_magic/xenial:latest
-docker run python_magic/bionic:latest
-docker run python_magic/focal:latest
+ 1. `pytest` will run the test suite against your default version of python
+ 2. `./test/run_all_versions.py` will run the tests against all installed versions of python.
+ 3. `./test/run_all_docker_test.sh` will run against a variety of different Linux distributions, using docker.
diff --git a/test/run_all_docker_test.sh b/test/run_all_docker_test.sh
new file mode 100755
index 0000000..68a2808
--- /dev/null
+++ b/test/run_all_docker_test.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+set -x
+
+ROOT=$(dirname $0)/..
+cd $ROOT
+
+for f in test/docker/*; do
+ H=$(docker build -q -f ${f} .)
+ docker run --rm $H
+done
+
diff --git a/test/run.py b/test/run_all_versions.py
index cf62eee..cf62eee 100644
--- a/test/run.py
+++ b/test/run_all_versions.py
diff --git a/test_docker.sh b/test_docker.sh
deleted file mode 100755
index ad2bc5d..0000000
--- a/test_docker.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-# Test with various versions of ubuntu. This more or less re-creates the
-# Travis CI test environment
-
-set -e
-
-DEFAULT_TARGETS="xenial bionic focal centos7 centos8 archlinux alpine"
-
-TARGETS=${1:-${DEFAULT_TARGETS}}
-
-HERE=`dirname $0`
-
-for i in $TARGETS; do
- TAG="python_magic/${i}:latest"
- docker build -t $TAG -f ${HERE}/test/docker/$i .
- docker run $TAG
-done