@@ -115,15 +115,15 @@ self.inputs.nixpkgs.lib.nixos.runTest {
115115
116116 def check_upgrade_path(pg_version):
117117 with subtest("Check ${ pname } upgrade path"):
118- firstVersion = versions[pg_version][0]
118+ firstVersion = lib.versions.majorMinor versions[pg_version][0]
119119 server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS ${ pname } ;'")
120120 run_sql(f"""CREATE EXTENSION ${ pname } WITH VERSION '{firstVersion}' CASCADE;""")
121121 installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${ pname } ';""")
122122 assert installed_version == firstVersion, f"Expected ${ pname } version {firstVersion}, but found {installed_version}"
123123 for version in versions[pg_version][1:]:
124- run_sql(f"""ALTER EXTENSION ${ pname } UPDATE TO '{version}';""")
124+ run_sql(f"""ALTER EXTENSION ${ pname } UPDATE TO '{lib.versions.majorMinor version}';""")
125125 installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${ pname } ';""")
126- assert installed_version == version, f"Expected ${ pname } version {version}, but found {installed_version}"
126+ assert installed_version == lib.versions.majorMinor version, f"Expected ${ pname } version {version}, but found {installed_version}"
127127
128128 start_all()
129129
@@ -136,7 +136,7 @@ self.inputs.nixpkgs.lib.nixos.runTest {
136136 server.succeed("sudo -u postgres psql -c 'DROP EXTENSION ${ pname } ;'")
137137 server.succeed("sudo -u postgres psql -c 'CREATE EXTENSION ${ pname } CASCADE;'")
138138 installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""")
139- latestVersion = versions["15"][-1]
139+ latestVersion = lib.versions.majorMinor versions["15"][-1]
140140 assert f"${ pname } ,{latestVersion}" in installed_extensions
141141
142142 with subtest("switch to postgresql 17"):
@@ -146,7 +146,7 @@ self.inputs.nixpkgs.lib.nixos.runTest {
146146
147147 with subtest("Check ${ pname } latest extension version after upgrade"):
148148 installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""")
149- latestVersion = versions["17"][-1]
149+ latestVersion = lib.versions.majorMinor versions["17"][-1]
150150 assert f"${ pname } ,{latestVersion}" in installed_extensions
151151
152152 check_upgrade_path("17")
0 commit comments