@@ -88,8 +88,9 @@ def self.run(params)
8888 get_value_from_value_or_file ( params [ :test_devices ] , params [ :test_devices_file ] )
8989 if present? ( test_devices )
9090 UI . message ( "🤖 Starting automated tests. Note: This feature is in beta." )
91- release_test = test_release ( alpha_client , release , test_devices , params [ :test_username ] , params [ :test_password ] , params [ :test_username_resource ] , params [ :test_password_resource ] )
92- unless params [ :test_async ]
91+ test_password = test_password_from_params ( params )
92+ release_test = test_release ( alpha_client , release , test_devices , params [ :test_username ] , test_password , params [ :test_username_resource ] , params [ :test_password_resource ] )
93+ unless params [ :test_non_blocking ]
9394 poll_test_finished ( alpha_client , release_test . name )
9495 end
9596 end
@@ -133,6 +134,12 @@ def self.details
133134 "Release your beta builds with Firebase App Distribution"
134135 end
135136
137+ def self . test_password_from_params ( params )
138+ test_password = get_value_from_value_or_file ( params [ :test_password ] , params [ :test_password_file ] )
139+ # Remove trailing newline if present
140+ test_password && test_password . sub ( /\r ?\n $/ , "" )
141+ end
142+
136143 def self . app_id_from_params ( params )
137144 if params [ :app ]
138145 app_id = params [ :app ]
@@ -522,23 +529,33 @@ def self.available_options
522529 optional : true ,
523530 type : String ) ,
524531 FastlaneCore ::ConfigItem . new ( key : :test_username ,
532+ env_name : "FIREBASEAPPDISTRO_TEST_USERNAME" ,
525533 description : "Username for automatic login" ,
526534 optional : true ,
527535 type : String ) ,
528536 FastlaneCore ::ConfigItem . new ( key : :test_password ,
529- description : "Password for automatic login" ,
537+ env_name : "FIREBASEAPPDISTRO_TEST_PASSWORD" ,
538+ description : "Password for automatic login. If using a real password consider using test_password_file or setting FIREBASEAPPDISTRO_TEST_PASSWORD to avoid exposing sensitive info" ,
530539 optional : true ,
531540 type : String ) ,
541+ FastlaneCore ::ConfigItem . new ( key : :test_password_file ,
542+ env_name : "FIREBASEAPPDISTRO_TEST_PASSWORD_FILE" ,
543+ description : "Path to file containing password for automatic login" ,
544+ optional : true ,
545+ type : String ) ,
532546 FastlaneCore ::ConfigItem . new ( key : :test_username_resource ,
547+ env_name : "FIREBASEAPPDISTRO_TEST_USERNAME_RESOURCE" ,
533548 description : "Resource name for the username field for automatic login" ,
534549 optional : true ,
535550 type : String ) ,
536551 FastlaneCore ::ConfigItem . new ( key : :test_password_resource ,
552+ env_name : "FIREBASEAPPDISTRO_TEST_PASSWORD_RESOURCE" ,
537553 description : "Resource name for the password field for automatic login" ,
538554 optional : true ,
539555 type : String ) ,
540- FastlaneCore ::ConfigItem . new ( key : :test_async ,
541- description : "Run tests asynchronously. Visit the Firebase console for the automatic test results" ,
556+ FastlaneCore ::ConfigItem . new ( key : :test_non_blocking ,
557+ env_name : "FIREBASEAPPDISTRO_TEST_NON_BLOCKING" ,
558+ description : "Run automated tests without waiting for them to finish. Visit the Firebase console for the test results" ,
542559 optional : false ,
543560 default_value : false ,
544561 type : Boolean ) ,
0 commit comments