Skip to content

Commit

Permalink
Add tox
Browse files Browse the repository at this point in the history
  • Loading branch information
31z4 committed Mar 24, 2023
1 parent f569dd2 commit 0af0cd0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
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
17 changes: 17 additions & 0 deletions test/tests/tox-basics/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -x

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

0 comments on commit 0af0cd0

Please sign in to comment.