Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API for processing groups of plugin-defined DataSource groups #210

Merged
merged 24 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,7 @@ public void Create_WhenProcessorsWithParsersPresent_SourcesDependOnCds()

cds.CreateProcessorReturnValue = p;
r.CreateProcessor(
new[]
{
Any.DataSource(),
},
Any.DataSourceGroup(),
Any.ProcessorEnvironment(),
ProcessorOptions.Default);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Performance.SDK.Processing;
using Microsoft.Performance.SDK.Processing.DataSourceGrouping;
using Microsoft.Performance.Testing;
using Microsoft.Performance.Testing.SDK;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand Down Expand Up @@ -52,10 +53,7 @@ public void ExecuteSourceThatReturnsNullThrows()
DataProcessor = null,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -68,7 +66,7 @@ public void ExecuteSourceThatReturnsNullThrows()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand All @@ -89,10 +87,7 @@ public void ExecutePassesEnvironmentToProcessor()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -108,7 +103,7 @@ public void ExecutePassesEnvironmentToProcessor()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
env,
options);
Expand All @@ -132,10 +127,7 @@ public void ExecutePassesOptionsToProcessor()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -150,7 +142,7 @@ public void ExecutePassesOptionsToProcessor()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
options);
Expand All @@ -174,10 +166,7 @@ public void ExecuteEnablesTheCorrectTables()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -190,7 +179,7 @@ public void ExecuteEnablesTheCorrectTables()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand All @@ -216,10 +205,7 @@ public async Task ExecuteRequestedtablesSetCorrectly()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -232,7 +218,7 @@ public async Task ExecuteRequestedtablesSetCorrectly()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand All @@ -259,10 +245,7 @@ public void ExecuteEnableTableFailureContinuesAnyway()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -277,7 +260,7 @@ public void ExecuteEnableTableFailureContinuesAnyway()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand All @@ -303,10 +286,7 @@ public async Task ExecuteEnableTableFailureNotedCorrectly()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -321,7 +301,7 @@ public async Task ExecuteEnableTableFailureNotedCorrectly()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand Down Expand Up @@ -350,10 +330,7 @@ public async Task ExecuteDoesNotBuildTables()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -366,7 +343,7 @@ public async Task ExecuteDoesNotBuildTables()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand All @@ -392,10 +369,7 @@ public async Task ExecuteFailureToBuildMetadataTablesNoted()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tablesToEnable = new[]
{
Expand All @@ -408,7 +382,7 @@ public async Task ExecuteFailureToBuildMetadataTablesNoted()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tablesToEnable,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand All @@ -433,10 +407,7 @@ public async Task ExecuteDataSourceInfoSetCorrectly()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -447,7 +418,7 @@ public async Task ExecuteDataSourceInfoSetCorrectly()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand All @@ -474,10 +445,7 @@ public async Task ExecuteDataSourceInfoIsNullCoalescesIntoDefault()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -488,7 +456,7 @@ public async Task ExecuteDataSourceInfoIsNullCoalescesIntoDefault()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand Down Expand Up @@ -516,10 +484,7 @@ public async Task ExecuteDatSourceInfoFailureNoted()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -530,7 +495,7 @@ public async Task ExecuteDatSourceInfoFailureNoted()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand All @@ -554,10 +519,7 @@ public async Task ExecuteMetadataNameSetToSourceName()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -568,7 +530,7 @@ public async Task ExecuteMetadataNameSetToSourceName()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand All @@ -591,10 +553,7 @@ public async Task ExecuteContextSetToArgument()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -605,7 +564,7 @@ public async Task ExecuteContextSetToArgument()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand All @@ -631,10 +590,7 @@ public async Task ExecuteCallsProcessCorrectly()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -645,7 +601,7 @@ public async Task ExecuteCallsProcessCorrectly()
progress,
_ => logger,
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand Down Expand Up @@ -674,10 +630,7 @@ public async Task ExecuteProcessorFailsSetsFaultProperties()
DataProcessor = mockProcessor,
};

var dataSources = new[]
{
Any.DataSource(),
};
var dataSourceGroup = Any.DataSourceGroup();

var tables = new[]
{
Expand All @@ -688,7 +641,7 @@ public async Task ExecuteProcessorFailsSetsFaultProperties()
progress,
_ => new NullLogger(),
CreateReference(fakeProcessingSource),
dataSources,
dataSourceGroup,
tables,
Any.ProcessorEnvironment(),
ProcessorOptions.Default);
Expand Down Expand Up @@ -744,6 +697,13 @@ public ICustomDataProcessor CreateProcessor(IEnumerable<IDataSource> dataSources
return this.DataProcessor;
}

public ICustomDataProcessor CreateProcessor(IDataSourceGroup dataSourceGroup, IProcessorEnvironment processorEnvironment,
ProcessorOptions options)
{
this.CreateProcessorCalls.Add(Tuple.Create((IEnumerable<IDataSource>)dataSourceGroup.DataSources, processorEnvironment, options));
return this.DataProcessor;
}

public Stream GetSerializationStream(SerializationSource source)
{
throw new NotImplementedException();
Expand Down
Loading