@@ -18,13 +18,22 @@ async fn main() -> Result<()> {
1818 tracing_subscriber:: fmt ( ) . compact ( ) . init ( ) ;
1919
2020 info ! ( "Installing PostgreSQL" ) ;
21+ let postgresql_version = VersionReq :: parse ( "=16.4.0" ) ?;
2122 let settings = Settings {
22- version : VersionReq :: parse ( "=16.4.0" ) ? ,
23+ version : postgresql_version . clone ( ) ,
2324 ..Default :: default ( )
2425 } ;
2526 let mut postgresql = PostgreSQL :: new ( settings) ;
2627 postgresql. setup ( ) . await ?;
2728
29+ let settings = postgresql. settings ( ) ;
30+ // Skip the test if the PostgreSQL version does not match; when testing with the 'bundled'
31+ // feature, the version may vary and the test will fail.
32+ if settings. version != postgresql_version {
33+ eprintln ! ( "Postgresql version does not match" ) ;
34+ return Ok ( ( ) ) ;
35+ }
36+
2837 info ! ( "Installing the vector extension from PortalCorp" ) ;
2938 postgresql_extensions:: install (
3039 postgresql. settings ( ) ,
@@ -120,10 +129,12 @@ async fn execute_query(pool: &PgPool, query: &str) -> Result<()> {
120129
121130#[ cfg( test) ]
122131mod test {
132+ #[ cfg( not( all( target_os = "linux" , target_arch = "x86_64" ) ) ) ]
123133 use super :: * ;
124134
135+ #[ cfg( not( all( target_os = "linux" , target_arch = "x86_64" ) ) ) ]
125136 #[ test]
126- fn test_main ( ) -> Result < ( ) > {
137+ fn test_portal_corp_extension_main ( ) -> Result < ( ) > {
127138 main ( )
128139 }
129140}
0 commit comments