File tree Expand file tree Collapse file tree
crates/smoketests/tests/smoketests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,3 +170,27 @@ fn cli_logging_in_twice_works() {
170170 second_stdout
171171 ) ;
172172}
173+
174+ /// Test that `spacetime login --token <token>` exits immediately after saving
175+ /// the token, without falling through to the interactive web login flow.
176+ ///
177+ /// Without the fix in PR #4579, the command would fall through to the web
178+ /// login flow, which tries to open a browser and fails in CI.
179+ #[ test]
180+ fn cli_login_with_token ( ) {
181+ let test = Smoketest :: builder ( ) . autopublish ( false ) . build ( ) ;
182+
183+ // A dummy token that won't decode to a valid identity.
184+ let output = test. spacetime_cmd ( & [ "login" , "--token" , "test-dummy-token" ] ) ;
185+ let stdout = String :: from_utf8_lossy ( & output. stdout ) ;
186+ let stderr = String :: from_utf8_lossy ( & output. stderr ) ;
187+
188+ assert ! (
189+ output. status. success( ) ,
190+ "Expected `spacetime login --token` to succeed, but it failed.\n stdout: {stdout}\n stderr: {stderr}"
191+ ) ;
192+ assert ! (
193+ stdout. contains( "Token saved." ) ,
194+ "Expected 'Token saved.' in output, got: {stdout}"
195+ ) ;
196+ }
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ mod domains;
1818mod fail_initial_publish;
1919mod filtering;
2020mod http_egress;
21- mod login;
2221mod logs_level_filter;
2322mod module_nested_op;
2423mod modules;
You can’t perform that action at this time.
0 commit comments