mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
* InsightsGenerator project template files * Add insights projects to SLN * Setting up siggen class (#1003) * Setting up siggen class * fixed the learn method * Refactoring code Fixed compile errors * renamed results to result * Basic transformation logic (#1004) * Fix a couple bugs and add a simple test (#1007) * Fix a couple bugs and add a simple test * More tests and bug fix * Nara/workflow (#1006) * added a queue processor * ordered using statements * Armemon/analytics (#1008) * Basic transformation logic * changed some structure of siggen * added sum and average method, as well as select rows by input name * add insights to results * min, max added Co-authored-by: Karl Burtram <karlb@microsoft.com> Co-authored-by: Aasim Khan <aasimkhan30@gmail.com> Co-authored-by: Arslan Memon <armemon@microsoft.com> * Added rules engine base implementation (#1005) * Added rules engine base implementation * update comments * addressing comments * adding template text to columnheaders object * adding template text to columnheaders object * fixing columnheaders class * Added test * Added Template Parser unit test in Test project * Deleted unnecessary files and reverted the files that were modified by mistake Co-authored-by: Jinjing Arima <jiarima@microsoft.com> * Insights generator message handler placeholder (#1013) * Aasim/insights/insight methods (#1014) * Basic transformation logic * changed some structure of siggen * Added top and bottom insight functions * Added top, bottom insights Added tests for top, bottom insights * Armemon/insights2 (#1011) * max and min insightsperslice, and tests * got rid of unneccesssary function * get indexes Co-authored-by: Arslan Memon <armemon@microsoft.com> * Armemon/insights2 (#1012) * max and min insightsperslice, and tests * got rid of unneccesssary function * get indexes * learn for stringinputtyype * add learn implentation Co-authored-by: Arslan Memon <armemon@microsoft.com> * Added Tests Removed duplicate methods Co-authored-by: Karl Burtram <karlb@microsoft.com> Co-authored-by: arslan9955 <53170027+arslan9955@users.noreply.github.com> Co-authored-by: Arslan Memon <armemon@microsoft.com> * Armemon/insights2 (#1016) * Basic transformation logic * changed some structure of siggen * Added top and bottom insight functions * Added top, bottom insights Added tests for top, bottom insights * max and min insightsperslice, and tests * got rid of unneccesssary function * get indexes * learn for stringinputtyype * add learn implentation * add unique inputs * fix merge error * add to result Co-authored-by: Karl Burtram <karlb@microsoft.com> Co-authored-by: Aasim Khan <aasimkhan30@gmail.com> Co-authored-by: Arslan Memon <armemon@microsoft.com> * Added all the templates (#1015) * Added all the templates Added a method to find matched template * Added a function to replace # and ## values in a template * Added ReplaceHashesInTemplate call * Added comments * Updated the template txt * Updated GetTopHeadersWithHash function to add #toplist * Updated the logic per offline discussion with Hermineh * Update request handler contract to take array (#1020) * added rulesengine findmatchingtemplate (#1019) * Add support for getting DacFx deploy options from a publish profile (#995) * add support for getting options from a publish profile * update comments * set values for default options if they aren't specified in the publish profile * addressing comments * Updating to latest DacFx for a bug fix (#1010) * added rulesengine findmatchingtemplate * Update DacFx deploy and generate script with options (#998) * update deploy and generate script to accept deployment options * add tests * add test with option set to true * merge * merge * incorporated FindMatchedTemplate Co-authored-by: Kim Santiago <31145923+kisantia@users.noreply.github.com> Co-authored-by: Udeesha Gautam <46980425+udeeshagautam@users.noreply.github.com> * -Added logic for Insights Generator Service Handler (#1017) * -Added logic for Insights Generator Service Handler * Fixed some logic * Adding workflow test * Update transform and add tests (#1024) * Jiarima/fix rules engine logic (#1021) * Added all the templates Added a method to find matched template * Added a function to replace # and ## values in a template * Added ReplaceHashesInTemplate call * Added comments * Updated the template txt * Updated GetTopHeadersWithHash function to add #toplist * Updated the logic per offline discussion with Hermineh * Update with the fixes * Updated template and foreach conditions * Added distinct * Updated tests according to the logic change (#1026) * Nara/remove queing (#1023) * loc update (#914) * loc update * loc updates * Add support for getting DacFx deploy options from a publish profile (#995) * add support for getting options from a publish profile * update comments * set values for default options if they aren't specified in the publish profile * addressing comments * Updating to latest DacFx for a bug fix (#1010) * Update DacFx deploy and generate script with options (#998) * update deploy and generate script to accept deployment options * add tests * add test with option set to true * intermediate check in for merge, transformed not working * intermediate check in for merge, transformed not working * added test case * merged Co-authored-by: khoiph1 <khoiph@microsoft.com> Co-authored-by: Kim Santiago <31145923+kisantia@users.noreply.github.com> Co-authored-by: Udeesha Gautam <46980425+udeeshagautam@users.noreply.github.com> * Output data types from transform (#1029) * Fix bug process input_g (#1030) * Fixed the insight generator service (#1028) * Jiarima/added more testings (#1031) * Added another test Updated ReplaceHashesInTemplate function to return string instead of Template * Added third test * Merged * Reverted the workflow file to match with the one in hack/insights * Bugs fixes to hook insights up to ADS (#1033) * Bug fixes for hack insights (#1032) * Fixed the minColumn index bug in Data Transformation Fixed the template matching logic. * Adding changes from PR * Try to fix Workflow tests * Readd workflow tests * Fix template load location Co-authored-by: Aasim Khan <aasimkhan30@gmail.com> Co-authored-by: Nara <NaraVen@users.noreply.github.com> Co-authored-by: arslan9955 <53170027+arslan9955@users.noreply.github.com> Co-authored-by: Arslan Memon <armemon@microsoft.com> Co-authored-by: gadudhbh <68879970+gadudhbh@users.noreply.github.com> Co-authored-by: Jinjing Arima <jiarima@microsoft.com> Co-authored-by: jiarima <68882862+jiarima@users.noreply.github.com> Co-authored-by: Kim Santiago <31145923+kisantia@users.noreply.github.com> Co-authored-by: Udeesha Gautam <46980425+udeeshagautam@users.noreply.github.com> Co-authored-by: khoiph1 <khoiph@microsoft.com>
95 lines
2.2 KiB
C#
95 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using Xunit;
|
|
|
|
namespace Microsoft.InsightsGenerator.UnitTests
|
|
{
|
|
public class WorkFlowTests
|
|
{
|
|
[Fact]
|
|
public async void mainWorkFlowTest()
|
|
{
|
|
Workflow instance = new Workflow();
|
|
string insight = await instance.ProcessInputData(getSampleDataArray());
|
|
Assert.NotNull(insight);
|
|
}
|
|
|
|
public DataArray getSampleDataArray()
|
|
{
|
|
string sampleTableString =
|
|
@"Country Count Category
|
|
China 455 Category1
|
|
Turkey 254 Category1
|
|
United States 188 Category1
|
|
Japan 171 Category2
|
|
United States 106 Category3
|
|
Brazil 91 Category3
|
|
Thailand 67 Category1
|
|
Korea 61 Category3
|
|
Russia 61 Category1
|
|
China 60 Category3
|
|
Brazil 57 Category1
|
|
Germany 51 Category3
|
|
Turkey 49 Category3
|
|
Russia 45 Category3
|
|
Japan 44 Category3
|
|
United States 38 Category4
|
|
Thailand 37 Category3
|
|
India 36 Category3
|
|
Germany 35 Category1
|
|
France 33 Category1
|
|
India 31 Category1
|
|
Japan 28 Category1
|
|
Mexico 27 Category3
|
|
Canada 23 Category3
|
|
Mexico 22 Category1
|
|
Vietnam 22 Category3
|
|
Korea 21 Category1
|
|
Korea 21 Category5
|
|
United Kingdom 20 Category3
|
|
Vietnam 18 Category1
|
|
Canada 17 Category1
|
|
United Kingdom 17 Category1
|
|
China 12 Category4
|
|
France 12 Category3
|
|
China 10 Category2
|
|
Korea 8 Category4
|
|
Brazil 6 Category4
|
|
Russia 6 Category4
|
|
United States 6 Category5
|
|
France 5 Category4
|
|
Germany 5 Category4
|
|
United Kingdom 5 Category4
|
|
Thailand 4 Category4
|
|
Turkey 4 Category4
|
|
Canada 3 Category5
|
|
Mexico 3 Category4
|
|
United States 3 Category2
|
|
Canada 2 Category4
|
|
Germany 1 Category2
|
|
India 1 Category4
|
|
India 1 Category5
|
|
Japan 1 Category4
|
|
Japan 1 Category5
|
|
Korea 1 Category2";
|
|
|
|
string[] sampleRows = sampleTableString.Split(Environment.NewLine);
|
|
|
|
|
|
var columnNames = sampleRows[0].Split(" ");
|
|
|
|
List<string[]> sampleRowList = new List<string[]>();
|
|
|
|
for (int i = 1; i < sampleRows.Length; i++)
|
|
{
|
|
sampleRowList.Add(sampleRows[i].Split(" "));
|
|
}
|
|
|
|
DataArray result = new DataArray();
|
|
result.ColumnNames = columnNames;
|
|
result.Cells = sampleRowList.ToArray();
|
|
return result;
|
|
}
|
|
}
|
|
} |