File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
rust/cubesql/cubesql/e2e/tests Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -25,17 +25,32 @@ pub struct PostgresIntegrationTestSuite {
2525 // connection: tokio_postgres::Connection<Socket, NoTlsStream>,
2626}
2727
28+ fn get_env_var ( env_name : & ' static str ) -> Option < String > {
29+ if let Ok ( value) = env:: var ( env_name) {
30+ // Variable can be defined, but be empty on the CI
31+ if value. is_empty ( ) {
32+ log:: warn!( "Environment variable {} is declared, but empty" , env_name) ;
33+
34+ None
35+ } else {
36+ Some ( value)
37+ }
38+ } else {
39+ None
40+ }
41+ }
42+
2843impl PostgresIntegrationTestSuite {
2944 pub ( crate ) async fn before_all ( ) -> AsyncTestConstructorResult {
3045 let mut env_defined = false ;
3146
32- if let Ok ( testing_cube_token) = env :: var ( "CUBESQL_TESTING_CUBE_TOKEN" . to_string ( ) ) {
47+ if let Some ( testing_cube_token) = get_env_var ( "CUBESQL_TESTING_CUBE_TOKEN" ) {
3348 env:: set_var ( "CUBESQL_CUBE_TOKEN" , testing_cube_token) ;
3449
3550 env_defined = true ;
3651 } ;
3752
38- if let Ok ( testing_cube_url) = env :: var ( "CUBESQL_TESTING_CUBE_URL" . to_string ( ) ) {
53+ if let Some ( testing_cube_url) = get_env_var ( "CUBESQL_TESTING_CUBE_URL" ) {
3954 env:: set_var ( "CUBESQL_CUBE_URL" , testing_cube_url) ;
4055 } else {
4156 env_defined = false ;
You can’t perform that action at this time.
0 commit comments