forked from sclorg/nginx-container
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
59 lines (49 loc) · 1.25 KB
/
conftest.py
File metadata and controls
59 lines (49 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import os
import sys
from pathlib import Path
from collections import namedtuple
from pytest import skip
from container_ci_suite.utils import check_variables
if not check_variables():
sys.exit(1)
TAGS = {
"rhel8": "-ubi8",
"rhel9": "-ubi9",
"rhel10": "-ubi10",
}
Vars = namedtuple(
"Vars",
[
"OS",
"TAG",
"VERSION",
"IMAGE_NAME",
"VERSION_NO_MICRO",
"SHORT_VERSION",
"TEST_DIR",
],
)
OS = os.getenv("TARGET").lower()
VERSION = os.getenv("VERSION")
BRANCH_TO_TEST = "master"
VARS = Vars(
OS=OS,
TAG=TAGS.get(OS),
VERSION=VERSION,
IMAGE_NAME=os.getenv("IMAGE_NAME"),
VERSION_NO_MICRO=VERSION.replace("-micro", ""),
SHORT_VERSION=VERSION.replace("-micro", "").replace(".", ""),
TEST_DIR=Path(__file__).parent.absolute(),
)
def skip_clear_env_tests():
"""
Skip the test if the OS is RHEL 8 and the version is 8.2.
"""
if VARS.OS == "rhel8" and VERSION == "8.2":
skip(f"Skipping clear env tests for {VARS.VERSION} on {VARS.OS}.")
def skip_if_version_not_minimal():
"""
Skip the test if the version is not minimal.
"""
if "minimal" not in VARS.VERSION:
skip("Skipping container size comparison for non-minimal version.")