From 3a7597b8a62d354bdebd3606333e22d3198bd345 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Thu, 27 Jul 2023 13:57:52 +0200 Subject: [PATCH] test-driver: add persistent history across sessions of interactive testing --- nixos/lib/test-driver/test_driver/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/lib/test-driver/test_driver/__init__.py b/nixos/lib/test-driver/test_driver/__init__.py index db7e0ed33a89..c90e3d9e1cdb 100755 --- a/nixos/lib/test-driver/test_driver/__init__.py +++ b/nixos/lib/test-driver/test_driver/__init__.py @@ -106,7 +106,13 @@ def main() -> None: args.keep_vm_state, ) as driver: if args.interactive: - ptpython.repl.embed(driver.test_symbols(), {}) + history_dir = os.getcwd() + history_path = os.path.join(history_dir, ".nixos-test-history") + ptpython.repl.embed( + driver.test_symbols(), + {}, + history_filename=history_path, + ) else: tic = time.time() driver.run_tests()