File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ addons:
17
17
postgresql : 10
18
18
19
19
before_script :
20
- - sudo -u postgres psql -c "CREATE USER foo WITH PASSWORD 'bar';" -h localhost -p $PGPORT - U postgres
21
- - sudo -u postgres createdb -O foo -h localhost -p $PGPORT foo
20
+ - sudo -u postgres psql -c "CREATE USER foo WITH PASSWORD 'bar';" -U postgres
21
+ - sudo -u postgres createdb -O foo foo
22
22
23
23
script :
24
24
- cargo test -- --nocapture || travis_terminate 1
30
30
global :
31
31
- ODBC_SYS_STATIC_PATH=/usr/lib/x86_64-linux-gnu/
32
32
- POSTGRES_SERVER=localhost
33
- - POSTGRES_PORT=5433
33
+ - POSTGRES_PORT=5432
34
34
- POSTGRES_USERNAME=foo
35
35
- POSTGRES_PASSWORD=bar
36
- - PGPORT=5433
37
36
- RUST_BACKTRACE=1
38
37
- POSTGRES_DRIVER=/usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so
39
38
- SQLITE_DRIVER=/usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so
Original file line number Diff line number Diff line change @@ -137,17 +137,17 @@ mod test {
137
137
138
138
#[ test]
139
139
#[ cfg_attr( postgres_driver = "" , ignore) ]
140
- fn test_postgres_with_no_server ( ) {
140
+ fn test_postgres_with_wrong_server ( ) {
141
141
let err = connect ( & Opts :: new ( ) . connection_string ( format ! (
142
- "Driver={};" ,
142
+ "Driver={};Server=tevp.net " ,
143
143
std:: env:: var( "POSTGRES_DRIVER" ) . unwrap( )
144
144
) ) )
145
145
. unwrap_err ( ) ;
146
146
assert_eq ! ( err. kind, DbErrorLifetime :: Temporary , "{:?}" , err) ;
147
147
if let DbErrorType :: OdbcError { error } = err. error {
148
148
let desc = format ! ( "{}" , error) ;
149
149
assert ! (
150
- desc. contains( "could not connect to server: No such file or directory " ) ,
150
+ desc. contains( "could not connect to server: Connection refused " ) ,
151
151
desc
152
152
) ;
153
153
}
You can’t perform that action at this time.
0 commit comments