@@ -18,13 +18,22 @@ async fn main() -> Result<()> {
18
18
tracing_subscriber:: fmt ( ) . compact ( ) . init ( ) ;
19
19
20
20
info ! ( "Installing PostgreSQL" ) ;
21
+ let postgresql_version = VersionReq :: parse ( "=16.4.0" ) ?;
21
22
let settings = Settings {
22
- version : VersionReq :: parse ( "=16.4.0" ) ? ,
23
+ version : postgresql_version . clone ( ) ,
23
24
..Default :: default ( )
24
25
} ;
25
26
let mut postgresql = PostgreSQL :: new ( settings) ;
26
27
postgresql. setup ( ) . await ?;
27
28
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
+
28
37
info ! ( "Installing the vector extension from PortalCorp" ) ;
29
38
postgresql_extensions:: install (
30
39
postgresql. settings ( ) ,
@@ -120,10 +129,12 @@ async fn execute_query(pool: &PgPool, query: &str) -> Result<()> {
120
129
121
130
#[ cfg( test) ]
122
131
mod test {
132
+ #[ cfg( not( all( target_os = "linux" , target_arch = "x86_64" ) ) ) ]
123
133
use super :: * ;
124
134
135
+ #[ cfg( not( all( target_os = "linux" , target_arch = "x86_64" ) ) ) ]
125
136
#[ test]
126
- fn test_main ( ) -> Result < ( ) > {
137
+ fn test_portal_corp_extension_main ( ) -> Result < ( ) > {
127
138
main ( )
128
139
}
129
140
}
0 commit comments