From 7d71adaced825e43239e44ee44212137dd1eabe0 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Thu, 19 Dec 2019 07:04:06 -0700 Subject: [PATCH] Remove the unused ListValidation code --- Wabbajack.Test.ListValidation/App.config | 11 -- .../ListValidation.cs | 101 ------------------ .../Properties/AssemblyInfo.cs | 19 ---- Wabbajack.Test.ListValidation/Readme.md | 4 - .../Wabbajack.Test.ListValidation.csproj | 98 ----------------- Wabbajack.sln | 20 ---- 6 files changed, 253 deletions(-) delete mode 100644 Wabbajack.Test.ListValidation/App.config delete mode 100644 Wabbajack.Test.ListValidation/ListValidation.cs delete mode 100644 Wabbajack.Test.ListValidation/Properties/AssemblyInfo.cs delete mode 100644 Wabbajack.Test.ListValidation/Readme.md delete mode 100644 Wabbajack.Test.ListValidation/Wabbajack.Test.ListValidation.csproj diff --git a/Wabbajack.Test.ListValidation/App.config b/Wabbajack.Test.ListValidation/App.config deleted file mode 100644 index c764f532..00000000 --- a/Wabbajack.Test.ListValidation/App.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/Wabbajack.Test.ListValidation/ListValidation.cs b/Wabbajack.Test.ListValidation/ListValidation.cs deleted file mode 100644 index fd9af43d..00000000 --- a/Wabbajack.Test.ListValidation/ListValidation.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Wabbajack.Common; -using Wabbajack.Lib; -using Wabbajack.Lib.Downloaders; -using Wabbajack.Lib.ModListRegistry; -using Wabbajack.Lib.NexusApi; - -namespace Wabbajack.Test.ListValidation -{ - [TestClass] - public class ListValidation - { - [ClassInitialize] - public static async Task SetupNexus(TestContext context) - { - Utils.LogMessages.Subscribe(m => context.WriteLine(m.ToString())); - var api = await NexusApiClient.Get(); - await api.ClearUpdatedModsInCache(); - } - - private WorkQueue Queue { get; set; } - [TestInitialize] - public void Setup() - { - Directory.CreateDirectory(Consts.ModListDownloadFolder); - Utils.LogMessages.Subscribe(s => TestContext.WriteLine(s.ToString())); - Queue = new WorkQueue(); - } - - [TestCleanup] - public void Cleanup() - { - Queue.Dispose(); - Queue = null; - } - - - public TestContext TestContext { get; set; } - - [TestCategory("ListValidation")] - [DataTestMethod] - [DynamicData(nameof(GetModLists), DynamicDataSourceType.Method)] - public async Task ValidateModLists(string name, ModlistMetadata list) - { - Log($"Testing {list.Links.MachineURL} - {list.Title}"); - var modlist_path = Path.Combine(Consts.ModListDownloadFolder, list.Links.MachineURL + ".wabbajack"); - - if (list.NeedsDownload(modlist_path)) - { - var state = DownloadDispatcher.ResolveArchive(list.Links.Download); - Log($"Downloading {list.Links.MachineURL} - {list.Title}"); - await state.Download(modlist_path); - } - else - { - Log($"No changes detected from downloaded modlist"); - } - - - Log($"Loading {modlist_path}"); - - var installer = AInstaller.LoadFromFile(modlist_path); - - Log($"{installer.Archives.Count} archives to validate"); - - var invalids = (await installer.Archives - .PMap(Queue, async archive => - { - Log($"Validating: {archive.Name}"); - return new {archive, is_valid = await archive.State.Verify()}; - })) - .Where(a => !a.is_valid) - .ToList(); - - DownloadDispatcher.PrepareAll(installer.Archives.Select(a => a.State)); - - Log("Invalid Archives"); - foreach (var invalid in invalids) - { - Log(invalid.archive.State.GetReportEntry(invalid.archive)); - } - - Assert.AreEqual(invalids.Count, 0, "There were invalid archives"); - } - - void Log(string msg) - { - TestContext.WriteLine(msg); - } - - public static async Task> GetModLists() - { - return (await ModlistMetadata.LoadFromGithub()).Select(l => new object[] {l.Title, l}); - } - } -} diff --git a/Wabbajack.Test.ListValidation/Properties/AssemblyInfo.cs b/Wabbajack.Test.ListValidation/Properties/AssemblyInfo.cs deleted file mode 100644 index 12444874..00000000 --- a/Wabbajack.Test.ListValidation/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Wabbajack.Test.ListValidation")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wabbajack.Test.ListValidation")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -[assembly: ComVisible(false)] - -[assembly: Guid("ba013d05-1d70-452f-bb8f-272b31e6c74e")] - -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Wabbajack.Test.ListValidation/Readme.md b/Wabbajack.Test.ListValidation/Readme.md deleted file mode 100644 index 9e6a1279..00000000 --- a/Wabbajack.Test.ListValidation/Readme.md +++ /dev/null @@ -1,4 +0,0 @@ -# Wabbajack.Test.ListValidation - -This project is not part of `Wabbajack.Test` as the `ListValidation` test validates every ModList from [this](https://github.com/wabbajack-tools/mod-lists) repository and checks if all ModLists are valid. -The gets called when you push to master or to the repo linked above. diff --git a/Wabbajack.Test.ListValidation/Wabbajack.Test.ListValidation.csproj b/Wabbajack.Test.ListValidation/Wabbajack.Test.ListValidation.csproj deleted file mode 100644 index 679516a1..00000000 --- a/Wabbajack.Test.ListValidation/Wabbajack.Test.ListValidation.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - - Debug - AnyCPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E} - Library - Properties - Wabbajack.Test.ListValidation - Wabbajack.Test.ListValidation - v4.8 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - x64 - CS1998 - CS4014 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - CS1998 - CS4014 - - - true - bin\x64\Debug\ - DEBUG;TRACE - full - x64 - prompt - MinimumRecommendedRules.ruleset - - - bin\x64\Release\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - - - - - - - - - - {B3F3FB6E-B9EB-4F49-9875-D78578BC7AE5} - Wabbajack.Common - - - {0a820830-a298-497d-85e0-e9a89efef5fe} - Wabbajack.Lib - - - - - 2.0.0 - - - 2.0.0 - - - 12.0.3 - - - - - - - - \ No newline at end of file diff --git a/Wabbajack.sln b/Wabbajack.sln index 430adcd9..25351f39 100644 --- a/Wabbajack.sln +++ b/Wabbajack.sln @@ -24,8 +24,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.Test", "Wabbajack EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.Lib", "Wabbajack.Lib\Wabbajack.Lib.csproj", "{0A820830-A298-497D-85E0-E9A89EFEF5FE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.Test.ListValidation", "Wabbajack.Test.ListValidation\Wabbajack.Test.ListValidation.csproj", "{BA013D05-1D70-452F-BB8F-272B31E6C74E}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compression.BSA.Test", "Compression.BSA.Test\Compression.BSA.Test.csproj", "{9C004392-571A-4D28-A9F6-0E25115E6727}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.Common.CSP", "Wabbajack.Common.CSP\Wabbajack.Common.CSP.csproj", "{9E69BC98-1512-4977-B683-6E7E5292C0B8}" @@ -141,24 +139,6 @@ Global {0A820830-A298-497D-85E0-E9A89EFEF5FE}.Release|x64.Build.0 = Release|Any CPU {0A820830-A298-497D-85E0-E9A89EFEF5FE}.Release|x86.ActiveCfg = Release|Any CPU {0A820830-A298-497D-85E0-E9A89EFEF5FE}.Release|x86.Build.0 = Release|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug (no commandargs)|Any CPU.ActiveCfg = Debug|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug (no commandargs)|Any CPU.Build.0 = Debug|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug (no commandargs)|x64.ActiveCfg = Debug|x64 - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug (no commandargs)|x64.Build.0 = Debug|x64 - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug (no commandargs)|x86.ActiveCfg = Debug|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug (no commandargs)|x86.Build.0 = Debug|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug|x64.ActiveCfg = Debug|x64 - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug|x64.Build.0 = Debug|x64 - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug|x86.ActiveCfg = Debug|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Debug|x86.Build.0 = Debug|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Release|Any CPU.Build.0 = Release|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Release|x64.ActiveCfg = Release|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Release|x64.Build.0 = Release|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Release|x86.ActiveCfg = Release|Any CPU - {BA013D05-1D70-452F-BB8F-272B31E6C74E}.Release|x86.Build.0 = Release|Any CPU {9C004392-571A-4D28-A9F6-0E25115E6727}.Debug (no commandargs)|Any CPU.ActiveCfg = Debug|Any CPU {9C004392-571A-4D28-A9F6-0E25115E6727}.Debug (no commandargs)|Any CPU.Build.0 = Debug|Any CPU {9C004392-571A-4D28-A9F6-0E25115E6727}.Debug (no commandargs)|x64.ActiveCfg = Debug|Any CPU