Remove legacy path for determining plugin name (#350)

* Remove legacy path for determining plugin name

* Remove test
This commit is contained in:
Luke Bordonaro 2024-04-02 10:05:03 -07:00 коммит произвёл GitHub
Родитель 1a8afeb667
Коммит 56ceedba70
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 0 добавлений и 54 удалений

Просмотреть файл

@ -422,30 +422,6 @@ namespace Microsoft.Performance.SDK.Runtime.NetCoreApp.Plugins.Tests
AssertObservedCDSs(expectedCDSs, consumer);
}
//
// Legacy schema tests
//
[TestMethod]
[UnitTest]
public void LegacyPluginTest()
{
(var loader, var consumer) = Setup(true);
var success = loader.TryLoadPlugin(GetLegacyPath("LegacyA"), out var error);
Assert.IsTrue(success);
Assert.AreEqual(ErrorInfo.None, error);
var expectedPlugins = new List<Tuple<string, Version>>
{
new Tuple<string, Version>("LegacyA", null),
};
AssertExpectedPlugins(expectedPlugins, consumer);
var expectedCDSs = new Type[] { typeof(LegacySchemaA) };
AssertNumberProcessingSourcesLoaded(expectedCDSs.Length, loader, consumer);
AssertLoadedCDSs(expectedCDSs, loader);
AssertObservedCDSs(expectedCDSs, consumer);
}
//
// Fake directory/directories tests
//
@ -742,11 +718,6 @@ namespace Microsoft.Performance.SDK.Runtime.NetCoreApp.Plugins.Tests
return Path.Combine(compilePath, Valid, "InstalledPlugins", "1.0.0", pluginName, pluginVersion.ToString(3));
}
private static string GetLegacyPath(string pluginName)
{
return Path.Combine(compilePath, Legacy, ProcessingSourceConstants.ProcessingSourceRootFolderName, pluginName);
}
/// <summary>
/// Checks that every expected plugin in <paramref name="expected"/>
/// was observed by <paramref name="consumer"/>

Просмотреть файл

@ -479,13 +479,6 @@ namespace Microsoft.Performance.SDK.Runtime.NetCoreApp.Plugins
pluginName = parentFolder.Parent.Name;
pluginVersion = Version.TryParse(parentFolder.Name, out var version) ? version : null;
}
else if (parentFolder?.Parent?.Name == ProcessingSourceConstants.ProcessingSourceRootFolderName)
{
// Legacy: this plugin was bundled with WPA. It has its binaries inside of one folder
// named after the plugin itself.
pluginName = parentFolder.Name;
pluginVersion = null;
}
else
{
// Unknown file system schema. Do not attempt to make assumptions about the plugin's name.

Просмотреть файл

@ -1,18 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.Performance.SDK.Runtime
{
public static class ProcessingSourceConstants
{
/// <summary>
/// Default <see cref="IProcessingSource"/> root folder for loading plugins.
/// </summary>
/// <remarks>
/// This is "CustomDataSources" because processing sources were historically
/// called custom data sources. This folder name is unchanged to increase
/// backwards compatibility of plugins.
/// </remarks>
public const string ProcessingSourceRootFolderName = "CustomDataSources";
}
}