Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tox #14328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add tox #14328

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions library/tox
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Maintainers: Elisey Zanko <[email protected]> (@31z4)
GitRepo: https://github.com/31z4/tox-docker.git
GitFetch: refs/heads/main
Architectures: amd64, arm64v8, ppc64le, s390x

Tags: 4-3, 4-3.0, 4-3.0.1, 4, 4.4-3, 4.4-3.0, 4.4-3.0.1, 4.4, 4.4.7-3, 4.4.7-3.0, 4.4.7-3.0.1, 4.4.7, latest
GitCommit: 881e2f195d431ca14d1da7e2e5044c3e0ff932b7
3 changes: 3 additions & 0 deletions test/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ imageTests+=(
[tomcat]='
tomcat-hello-world
'
[tox]='
tox-basics
'
[varnish]='
varnish
'
Expand Down
15 changes: 15 additions & 0 deletions test/tests/tox-basics/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -eo pipefail

dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"

image="$1"

newImage="$("$dir/../image-name.sh" librarytest/tox-basics "$image")"
"$dir/../docker-build.sh" "$dir" "$newImage" <<EOD
FROM $image
COPY dir/test.py dir/tox.ini ./
EOD

docker run --rm "$newImage"
6 changes: 6 additions & 0 deletions test/tests/tox-basics/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import unittest


class Test(unittest.TestCase):
def test(self):
self.assertTrue(True)
11 changes: 11 additions & 0 deletions test/tests/tox-basics/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[tox]
envlist = py{311,310,39,38,37},black
skipsdist = true
skip_missing_interpreters = false

[testenv]
commands = python -m unittest test.py

[testenv:black]
deps = black
commands = black --check test.py
23 changes: 23 additions & 0 deletions test/tests/tox-derivative/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -eo pipefail

dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"

image="$1"

newImage="$("$dir/../image-name.sh" librarytest/tox-derivative "$image")"
"$dir/../docker-build.sh" "$dir" "$newImage" <<EOD
FROM $image
USER root
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
python3.12; \
rm -rf /var/lib/apt/lists/*
USER tox
COPY dir/test.py dir/tox.ini ./
EOD

docker run --rm "$newImage"
6 changes: 6 additions & 0 deletions test/tests/tox-derivative/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import unittest


class Test(unittest.TestCase):
def test(self):
self.assertTrue(True)
11 changes: 11 additions & 0 deletions test/tests/tox-derivative/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[tox]
envlist = py{312,311,310,39,38,37},black
skipsdist = true
skip_missing_interpreters = false

[testenv]
commands = python -m unittest test.py

[testenv:black]
deps = black
commands = black --check test.py