Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

Commit

Set up's elevated path has a test of its own: through Windows' prompt with nothing to do, done (#50).

G1t-Session:
ses_01m4yfkg80ev2t3yyd05fak46z
syntaqxcommitted Parent32aadadBrowse files
1 file+18−00/1 viewed
+18−0
407407 assert_eq!(encoded("a"), "YQA=");
408408 }
409409
410+ /// Runs the script as administrator, through Windows' prompt, with
411+ /// nothing to do: the prompt shows, and its answer comes back.
412+ /// `cargo test -- --ignored as_administrator --nocapture`, and say Yes.
413+ #[test]
414+ #[ignore]
415+ fn as_administrator_with_nothing_to_do_it_is_done() {
416+ let dir = std::env::temp_dir().join(format!("g1t-setup-admin-{}", std::process::id()));
417+ std::fs::create_dir_all(&dir).unwrap();
418+ let (log, marker) = (dir.join("setup.log"), dir.join(RESTART_FILE));
419+ let outcome = run_elevated(&script(&Plan::default(), &log, &marker), 0);
420+ let said = std::fs::read_to_string(&log).unwrap_or_default();
421+ println!("{outcome:?}\n{said}");
422+ assert_eq!(outcome, Outcome::Done, "{said}");
423+ assert_eq!(said.trim(), "g1t setup: Done.");
424+ assert!(!marker.exists());
425+ let _ = std::fs::remove_dir_all(&dir);
426+ }
427+
410428 /// Runs the script's WSL step as this user with `--version`, which
411429 /// changes nothing: wsl.exe started hidden, what it said logged line by
412430 /// line, and its exit code read. `cargo test -- --ignored the_wsl_step --nocapture`.

Comments

Sign in to comment.