99 DEFAULT_ENCODING_FOR_FILE_HANDLING ,
1010 DEFAULT_UNICODE_ERROR_HANDLER ,
1111)
12- from dotenv import dotenv_values
1312from ..update_docker import (
1413 update_docker_file_for_latest_postgres ,
1514 update_regular_docker_compose_file ,
1615 update_docker_file_alpine ,
17- update_docker_file_for_postgres15 ,
18- update_docker_file_for_postgres14 ,
16+ update_docker_file_for_postgres16 ,
1917 update_changelog ,
2018)
19+ from dotenv import dotenv_values
2120
2221BASE_PATH = os .getenv ("BASE_PATH" , default = pathlib2 .Path (__file__ ).parents [2 ])
2322TEST_BASE_PATH = f"{ BASE_PATH } /docker"
2423PROJECT_VERSION = "12.0.0"
2524
26- POSTGRES_15_VERSION = "15.4"
27- POSTGRES_14_VERSION = "14.9"
25+ POSTGRES_16_VERSION = "16.4"
2826
2927PROJECT_NAME = "citus"
3028version_details = get_version_details (PROJECT_VERSION )
@@ -45,7 +43,7 @@ def teardown_module():
4543
4644def test_update_docker_file_for_latest_postgres ():
4745 update_docker_file_for_latest_postgres (
48- PROJECT_VERSION , TEMPLATE_PATH , TEST_BASE_PATH , POSTGRES_14_VERSION
46+ PROJECT_VERSION , TEMPLATE_PATH , TEST_BASE_PATH , POSTGRES_16_VERSION
4947 )
5048 with open (
5149 f"{ TEST_BASE_PATH } /Dockerfile" ,
@@ -55,7 +53,7 @@ def test_update_docker_file_for_latest_postgres():
5553 ) as reader :
5654 content = reader .read ()
5755 lines = content .splitlines ()
58- assert lines [2 ].strip () == f"FROM postgres:{ POSTGRES_14_VERSION } "
56+ assert lines [2 ].strip () == f"FROM postgres:{ POSTGRES_16_VERSION } "
5957 assert lines [3 ].strip () == f"ARG VERSION={ PROJECT_VERSION } "
6058 assert (
6159 f"postgresql-$PG_MAJOR-{ PROJECT_NAME } -"
@@ -83,7 +81,7 @@ def test_update_regular_docker_compose_file():
8381
8482def test_update_docker_file_alpine ():
8583 update_docker_file_alpine (
86- PROJECT_VERSION , TEMPLATE_PATH , TEST_BASE_PATH , POSTGRES_14_VERSION
84+ PROJECT_VERSION , TEMPLATE_PATH , TEST_BASE_PATH , POSTGRES_16_VERSION
8785 )
8886 with open (
8987 f"{ TEST_BASE_PATH } /alpine/Dockerfile" ,
@@ -93,46 +91,24 @@ def test_update_docker_file_alpine():
9391 ) as reader :
9492 content = reader .read ()
9593 lines = content .splitlines ()
96- assert lines [2 ].strip () == f"FROM postgres:{ POSTGRES_14_VERSION } -alpine"
94+ assert lines [2 ].strip () == f"FROM postgres:{ POSTGRES_16_VERSION } -alpine"
9795 assert lines [3 ].strip () == f"ARG VERSION={ PROJECT_VERSION } "
9896 assert len (lines ) == 58
9997
10098
101- def test_update_docker_file_for_postgres14 ():
102- update_docker_file_for_postgres14 (
103- PROJECT_VERSION , TEMPLATE_PATH , TEST_BASE_PATH , POSTGRES_14_VERSION
104- )
105- with open (
106- f"{ TEST_BASE_PATH } /postgres-14/Dockerfile" ,
107- "r" ,
108- encoding = DEFAULT_ENCODING_FOR_FILE_HANDLING ,
109- errors = DEFAULT_UNICODE_ERROR_HANDLER ,
110- ) as reader :
111- content = reader .read ()
112- lines = content .splitlines ()
113- assert lines [2 ].strip () == f"FROM postgres:{ POSTGRES_14_VERSION } "
114- assert lines [3 ].strip () == f"ARG VERSION={ PROJECT_VERSION } "
115- assert (
116- f"postgresql-$PG_MAJOR-{ PROJECT_NAME } -"
117- f"{ version_details ['major' ]} .{ version_details ['minor' ]} =$CITUS_VERSION"
118- in lines [21 ]
119- )
120- assert len (lines ) == 42
121-
122-
123- def test_update_docker_file_for_postgres15 ():
124- update_docker_file_for_postgres15 (
125- PROJECT_VERSION , TEMPLATE_PATH , TEST_BASE_PATH , POSTGRES_15_VERSION
99+ def test_update_docker_file_for_postgres16 ():
100+ update_docker_file_for_postgres16 (
101+ PROJECT_VERSION , TEMPLATE_PATH , TEST_BASE_PATH , POSTGRES_16_VERSION
126102 )
127103 with open (
128- f"{ TEST_BASE_PATH } /postgres-15 /Dockerfile" ,
104+ f"{ TEST_BASE_PATH } /postgres-16 /Dockerfile" ,
129105 "r" ,
130106 encoding = DEFAULT_ENCODING_FOR_FILE_HANDLING ,
131107 errors = DEFAULT_UNICODE_ERROR_HANDLER ,
132108 ) as reader :
133109 content = reader .read ()
134110 lines = content .splitlines ()
135- assert lines [2 ].strip () == f"FROM postgres:{ POSTGRES_15_VERSION } "
111+ assert lines [2 ].strip () == f"FROM postgres:{ POSTGRES_16_VERSION } "
136112 assert lines [3 ].strip () == f"ARG VERSION={ PROJECT_VERSION } "
137113 assert (
138114 f"postgresql-$PG_MAJOR-{ PROJECT_NAME } -"
@@ -177,5 +153,4 @@ def test_update_changelog_without_postgres():
177153
178154def test_pkgvar_postgres_version_existence ():
179155 config = dotenv_values (PKGVARS_FILE )
180- assert config ["postgres_15_version" ]
181- assert config ["postgres_14_version" ]
156+ assert config ["postgres_16_version" ]
0 commit comments