Skip to content

Commit d222188

Browse files
committed
Add Container PyTest for s2i-nodejs-container
Signed-off-by: Petr "Stone" Hracek <[email protected]>
1 parent 936ee6d commit d222188

File tree

4 files changed

+508
-0
lines changed

4 files changed

+508
-0
lines changed

test/conftest.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from collections import namedtuple
2+
import os
3+
from pathlib import Path
4+
import sys
5+
6+
from container_ci_suite.utils import check_variables
7+
8+
if not check_variables():
9+
sys.exit(1)
10+
11+
Vars = namedtuple("Vars", [
12+
"OS", "VERSION", "IMAGE_NAME", "IS_MINIMAL", "VERSION_NO_MINIMAL", "SHORT_VERSION", "TEST_DIR"
13+
])
14+
VERSION = os.getenv("VERSION")
15+
VARS = Vars(
16+
OS=os.getenv("TARGET").lower(),
17+
VERSION=VERSION,
18+
IMAGE_NAME=os.getenv("IMAGE_NAME"),
19+
IS_MINIMAL="minimal" in VERSION,
20+
VERSION_NO_MINIMAL=VERSION.replace("-minimal", ""),
21+
SHORT_VERSION=VERSION.replace("-minimal", "").replace(".", ""),
22+
TEST_DIR=Path(__file__).parent.absolute()
23+
)
24+
25+
TAGS = {
26+
"rhel8": "-ubi8",
27+
"rhel9": "-ubi9",
28+
"rhel10": "-ubi10",
29+
}
30+
31+
MYSQL_TAGS = {
32+
"rhel8": "-el8",
33+
"rhel9": "-el9",
34+
"rhel10": "-el10",
35+
}
36+
37+
DEPLOYED_PGSQL_IMAGE = "quay.io/sclorg/postgresql-15-c9s"
38+
39+
PGSQL_IMAGE_TAG = "postgresql:15-c9s"
40+
IMAGE_TAG = "15-c9s"

test/run-pytest

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
#
3+
# IMAGE_NAME specifies a name of the candidate image used for testing.
4+
# The image has to be available before this script is executed.
5+
# SINGLE_VERSION specifies the major version of httpd
6+
# OS specifies RHEL version (e.g. OS=rhel8)
7+
#
8+
9+
THISDIR=$(dirname ${BASH_SOURCE[0]})
10+
11+
PYTHON_VERSION="3.12"
12+
if [[ ! -f "/usr/bin/python$PYTHON_VERSION" ]]; then
13+
PYTHON_VERSION="3.13"
14+
fi
15+
cd "${THISDIR}" && "python${PYTHON_VERSION}" -m pytest -s -rA --showlocals -vv test_container_apps.py

0 commit comments

Comments
 (0)