From 20b86a3ac925148d48b24e9882302ae7ef21d510 Mon Sep 17 00:00:00 2001 From: Ryan Fu Date: Mon, 18 Nov 2024 11:33:01 -0800 Subject: [PATCH] clean up test properly --- src/AppInstallerCLIE2ETests/ConfigureCommand.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/AppInstallerCLIE2ETests/ConfigureCommand.cs b/src/AppInstallerCLIE2ETests/ConfigureCommand.cs index 6335cb6e7b..2da6ed714b 100644 --- a/src/AppInstallerCLIE2ETests/ConfigureCommand.cs +++ b/src/AppInstallerCLIE2ETests/ConfigureCommand.cs @@ -129,8 +129,15 @@ public void ConfigureFromTestRepo_SettingsDefaultModuleRoot() var result = TestCommon.RunAICLICommand(CommandAndAgreementsAndVerbose, args); WinGetSettingsHelper.ConfigureInstallBehavior(Constants.DefaultModuleRoot, string.Empty); + bool moduleExists = Directory.Exists(Path.Combine(moduleTestDir, Constants.SimpleTestModuleName)); + if (moduleExists) + { + // Clean test directory to avoid impacting other tests. + Directory.Delete(moduleTestDir, true); + } + Assert.AreEqual(0, result.ExitCode); - Assert.True(Directory.Exists(Path.Combine(moduleTestDir, Constants.SimpleTestModuleName))); + Assert.True(moduleExists); } ///