File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,3 +120,27 @@ async fn proxy() {
120120 . success ( ) ;
121121 }
122122}
123+
124+ #[ tokio:: test]
125+ async fn env ( ) {
126+ let server = start_server ( ) . await ;
127+ server. respond ( 200 , TEST_DATA . join ( "search/ids.json" ) ) . await ;
128+
129+ // override base url
130+ for var in [ "BUGBITE_BASE" , "BUGBITE_GENTOO_BASE" ] {
131+ cmd ( "bite bugzilla" )
132+ . env ( "BUGBITE_CONNECTION" , "gentoo" )
133+ . env ( var, server. uri ( ) )
134+ . args ( [ "search" , "bugbite" , "--fields" , "id" ] )
135+ . assert ( )
136+ . stdout ( predicate:: str:: diff ( indoc:: indoc! { "
137+ 924847
138+ 924852
139+ 924854
140+ 924855
141+ 924856
142+ " } ) )
143+ . stderr ( "" )
144+ . success ( ) ;
145+ }
146+ }
Original file line number Diff line number Diff line change @@ -138,13 +138,19 @@ impl Config {
138138 let mut builder = config:: Config :: builder ( ) . add_source ( default_source) ;
139139
140140 // load custom user service options from non-connection specific env vars
141- builder = builder. add_source ( config:: Environment :: with_prefix ( "BUGBITE" ) . try_parsing ( true ) ) ;
141+ builder = builder. add_source (
142+ config:: Environment :: with_prefix ( "BUGBITE" )
143+ . try_parsing ( true )
144+ . prefix_separator ( "_" )
145+ . separator ( "__" ) ,
146+ ) ;
142147
143148 // load custom user service options from connection specific env vars
144149 let env_prefix = format ! ( "BUGBITE_{}" , connection. to_uppercase( ) ) ;
145150 builder = builder. add_source (
146151 config:: Environment :: with_prefix ( & env_prefix)
147152 . try_parsing ( true )
153+ . prefix_separator ( "_" )
148154 . separator ( "__" ) ,
149155 ) ;
150156
You can’t perform that action at this time.
0 commit comments