Skip to content

Commit ba60095

Browse files
committed
First PoC of PostgreSQL image minimalization.
Building of PostgreSQL 18-minimal image is based on centos-stream-10 image. Building of PostgreSQL 18-minimal image is based on ubi10-minimal image. No s2i-core image is used for building 18-minimal image. Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
1 parent 3a546c9 commit ba60095

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

test/test_ocp_container_size.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import pytest
2+
3+
from container_ci_suite.compare_images import ContainerCompareClass
4+
from container_ci_suite.utils import get_public_image_name, get_previous_os_version
5+
6+
from conftest import VARS
7+
8+
9+
class TestPostgreSQLContainerSize:
10+
"""
11+
Test the size of the PostgreSQL container against the
12+
already published container images.
13+
"""
14+
15+
def test_psql_container_size(self):
16+
"""
17+
Test the size of the PostgreSQL container against the
18+
already published container images.
19+
"""
20+
published_image_name = get_public_image_name(
21+
os_name=get_previous_os_version(VARS.OS),
22+
base_image_name="postgresql",
23+
version=VARS.VERSION,
24+
stage_registry=True,
25+
)
26+
is_less_uncopressed = ContainerCompareClass.is_uncompressed_image_smaller(
27+
built_image_name=VARS.IMAGE_NAME,
28+
published_image=published_image_name,
29+
)
30+
is_less_compressed = ContainerCompareClass.is_compressed_image_smaller(
31+
built_image_name=VARS.IMAGE_NAME,
32+
published_image_name=published_image_name,
33+
)
34+
if not is_less_uncopressed or not is_less_compressed:
35+
pytest.skip(
36+
f"Container size is not less than the published image {published_image_name}. "
37+
f"Uncompressed image size: {is_less_uncopressed}, Compressed image size: {is_less_compressed}"
38+
)

0 commit comments

Comments
 (0)