Skip to content

Commit

Permalink
Merge branch 'develop' into task/RDMP-224-DQE-update
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel authored Jan 6, 2025
2 parents 851416e + 188afdb commit 91dcf0d
Show file tree
Hide file tree
Showing 28 changed files with 446 additions and 409 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: setup .NET
uses: actions/setup-dotnet@v4.1.0
uses: actions/setup-dotnet@v4.2.0
- name: Populate Databases.yaml
shell: bash
run: |
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: setup .NET
uses: actions/setup-dotnet@v4.1.0
uses: actions/setup-dotnet@v4.2.0
- name: Populate Databases.yaml
shell: bash
run: |
Expand Down Expand Up @@ -154,13 +154,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: setup .NET
uses: actions/setup-dotnet@v4.1.0
uses: actions/setup-dotnet@v4.2.0
- name: Determine RDMP build version
id: version
shell: bash
run: perl -ne "print \"rdmpversion=\$1\n\" if /AssemblyInformationalVersion\(\"([0-9a-z.-]+)\"\)/;" SharedAssemblyInfo.cs >> $GITHUB_OUTPUT
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.1.0
uses: actions/setup-dotnet@v4.2.0
with:
dotnet-version: 7.0.x
- name: BundleSource
Expand Down Expand Up @@ -293,7 +293,7 @@ jobs:
path: ${{ github.workspace }}/
key: ${{ github.sha }}-your-cache-key-bundled
- name: setup .NET
uses: actions/setup-dotnet@v4.1.0
uses: actions/setup-dotnet@v4.2.0
- name: Determine RDMP build version
id: version
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: setup .NET
uses: actions/setup-dotnet@v4.1.0
uses: actions/setup-dotnet@v4.2.0

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
submodules: true
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.1.0
uses: actions/setup-dotnet@v4.2.0
with:
dotnet-version: 6.0.x
- name: Cache Nuget
Expand Down
18 changes: 9 additions & 9 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project>
<ItemGroup>
<PackageVersion Include="AWSSDK.S3" Version="3.7.410.6" />
<PackageVersion Include="AWSSDK.SecurityToken" Version="3.7.401.13" />
<PackageVersion Include="AWSSDK.SSO" Version="3.7.400.64" />
<PackageVersion Include="AWSSDK.SSOOIDC" Version="3.7.400.64" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.411" />
<PackageVersion Include="AWSSDK.SecurityToken" Version="3.7.401.21" />
<PackageVersion Include="AWSSDK.SSO" Version="3.7.400.72" />
<PackageVersion Include="AWSSDK.SSOOIDC" Version="3.7.400.72" />
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="Equ" Version="2.3.0" />
<PackageVersion Include="ExcelNumberFormat" Version="1.1.0" />
Expand All @@ -16,7 +16,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Minio" Version="6.0.3" />
<PackageVersion Include="Minio" Version="6.0.4" />
<PackageVersion Include="MongoDB.Driver" Version="3.1.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NPOI" Version="2.7.2" />
Expand All @@ -27,23 +27,23 @@
<PackageVersion Include="SSH.NET" Version="2024.2.0" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="Terminal.Gui" Version="1.17.1" />
<PackageVersion Include="YamlDotNet" Version="16.2.1" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="ConsoleControl" Version="1.3.0" />
<PackageVersion Include="Autoupdater.NET.Official" Version="1.9.2" />
<PackageVersion Include="DockPanelSuite.ThemeVS2015" Version="3.1.1" />
<PackageVersion Include="System.Threading.ThreadPool" Version="4.3.0" />
<PackageVersion Include="WeCantSpell.Hunspell" Version="5.2.1" />
<PackageVersion Include="NUnit" Version="4.3.0" />
<PackageVersion Include="NUnit" Version="4.3.2" />
<PackageVersion Include="ObjectListView.Repack.NET6Plus" Version="2.9.5" />
<PackageVersion Include="Scintilla.NET" Version="5.3.2.9" />
<PackageVersion Include="System.Resources.Extensions" Version="9.0.0" />
<PackageVersion Include="VPKSoft.ScintillaLexers.NET" Version="1.1.16" />
<PackageVersion Include="HIC.System.Windows.Forms.DataVisualization" Version="1.0.1" />
<PackageVersion Include="NunitXml.TestLogger" Version="4.1.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="NUnit.Analyzers" Version="4.4.0" />
<PackageVersion Include="NUnit.Analyzers" Version="4.5.0" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.collector" Version="6.0.3" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ private void CreateCatalogue()
if (CatalogueRepository.GetAllObjects<Pipeline>().Length == 0)
creator.CreatePipelines(new PlatformDatabaseCreationOptions());

var pipe = CatalogueRepository.GetAllObjects<Pipeline>().OrderByDescending(p => p.ID)
.FirstOrDefault(p => p.Name.Contains("BULK INSERT: CSV Import File (automated column-type detection)"));
var pipe = CatalogueRepository.GetAllObjects<Pipeline>().OrderByDescending(static p => p.ID)
.FirstOrDefault(static p => p.Name.Contains("BULK INSERT: CSV Import File (automated column-type detection)"));
var cmd = new ExecuteCommandCreateNewCatalogueByImportingFile(new ThrowImmediatelyActivator(RepositoryLocator),
info, "Column1", db, pipe, null);
cmd.Execute();
originalTableInfoID = RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>().First().ColumnInfo
.TableInfo_ID;
var column1 = RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Name == "Column1").First();
column1.ExtractionInformation.SelectSQL = column1.ExtractionInformation.SelectSQL + " as SOME_ALIAS";
var column1 = RepositoryLocator.CatalogueRepository
.GetAllObjects<CatalogueItem>().First(static c => c.Name == "Column1");
column1.ExtractionInformation.SelectSQL += " as SOME_ALIAS";
column1.ExtractionInformation.SaveToDatabase();
}

private void CreateSecondaryCatalogue()
{
var fileName = Path.GetTempPath() + Guid.NewGuid() + ".csv";
var fileName = $"{Path.GetTempPath()}{Guid.NewGuid()}.csv";
using (var outputFile = new StreamWriter(fileName, true))
{
outputFile.WriteLine("Column,Other");
Expand Down Expand Up @@ -149,8 +149,8 @@ public void UpdateLocationColumnBadType()
[Test]
public void UpdateLocationCheckOK()
{
goodCatalogueID = RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Name == "Column2").First().Catalogue_ID;
goodCatalogueID = RepositoryLocator.CatalogueRepository
.GetAllObjects<CatalogueItem>().First(static c => c.Name == "Column2").Catalogue_ID;
var cmd = new ExecuteCommandUpdateCatalogueDataLocation(new ThrowImmediatelyActivator(RepositoryLocator),
RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Catalogue_ID == goodCatalogueID).ToArray(), RemoteTable, null);
Expand All @@ -171,47 +171,53 @@ public void UpdateLocationExecuteNoCheck_Bad()
[Test]
public void UpdateLocationExecuteNoCheck_OK()
{
goodCatalogueID = RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Name == "Column2").First().Catalogue_ID;
goodCatalogueID = RepositoryLocator.CatalogueRepository
.GetAllObjects<CatalogueItem>().First(static c => c.Name == "Column2").Catalogue_ID;
var cmd = new ExecuteCommandUpdateCatalogueDataLocation(new ThrowImmediatelyActivator(RepositoryLocator),
RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Catalogue_ID == goodCatalogueID).ToArray(), RemoteTable, null);
Assert.DoesNotThrow(() => cmd.Execute());
var ci = RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Name == "Column2" && c.Catalogue_ID == goodCatalogueID).First();
Assert.That(ci.ColumnInfo.Name, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column2]"));
Assert.That(ci.ExtractionInformation.SelectSQL, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column2]"));
Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID));
var ci = RepositoryLocator.CatalogueRepository
.GetAllObjects<CatalogueItem>().First(c => c.Name == "Column2" && c.Catalogue_ID == goodCatalogueID);
Assert.Multiple(() =>
{
Assert.That(ci.ColumnInfo.Name, Is.EqualTo($"{RemoteTable.GetFullyQualifiedName()}.[Column2]"));
Assert.That(ci.ExtractionInformation.SelectSQL, Is.EqualTo($"{RemoteTable.GetFullyQualifiedName()}.[Column2]"));
Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID));
});
}

[Test]
public void UpdateLocationExecuteNoCheck_AliasCheck()
{
goodCatalogueID = RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Name == "Column2").First().Catalogue_ID;
goodCatalogueID = RepositoryLocator.CatalogueRepository
.GetAllObjects<CatalogueItem>().First(static c => c.Name == "Column2").Catalogue_ID;
var cmd = new ExecuteCommandUpdateCatalogueDataLocation(new ThrowImmediatelyActivator(RepositoryLocator),
RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Catalogue_ID == goodCatalogueID).ToArray(), RemoteTable, null);
Assert.DoesNotThrow(() => cmd.Execute());
var ci = RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Name == "Column1" && c.Catalogue_ID == goodCatalogueID).First();
var ci = RepositoryLocator.CatalogueRepository
.GetAllObjects<CatalogueItem>().First(c => c.Name == "Column1" && c.Catalogue_ID == goodCatalogueID);
Assert.That(ci.ColumnInfo.Name, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column1]"));
var ei = RepositoryLocator.CatalogueRepository.GetAllObjects<ExtractionInformation>()
.Where(e => e.ID == ci.ExtractionInformation.ID).First();
Assert.That(ei.SelectSQL, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column1] as SOME_ALIAS"));
Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID));
var ei = RepositoryLocator.CatalogueRepository
.GetAllObjects<ExtractionInformation>().First(e => e.ID == ci.ExtractionInformation.ID);
Assert.Multiple(() =>
{
Assert.That(ei.SelectSQL, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column1] as SOME_ALIAS"));
Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID));
});
}

[Test]
public void UpdateLocationWithMultipleExtractionIdentifiers()
{
goodCatalogueID = RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Name == "Column2").First().Catalogue_ID;
var ci = RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Name == "Column2" && c.Catalogue_ID == goodCatalogueID).First();
goodCatalogueID = RepositoryLocator.CatalogueRepository
.GetAllObjects<CatalogueItem>().First(static c => c.Name == "Column2").Catalogue_ID;
var ci = RepositoryLocator.CatalogueRepository
.GetAllObjects<CatalogueItem>().First(c => c.Name == "Column2" && c.Catalogue_ID == goodCatalogueID);

var otherci = RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>()
.Where(c => c.Name == "Column").First();
var otherci = RepositoryLocator.CatalogueRepository
.GetAllObjects<CatalogueItem>().First(static c => c.Name == "Column");
var cmd1 = new ExecuteCommandAddNewCatalogueItem(new ThrowImmediatelyActivator(RepositoryLocator), ci.Catalogue,
new List<ColumnInfo> { otherci.ColumnInfo }.ToArray());
Assert.DoesNotThrow(() => cmd1.Execute());
Expand All @@ -221,9 +227,12 @@ public void UpdateLocationWithMultipleExtractionIdentifiers()
.Where(c => c.Catalogue_ID == goodCatalogueID && c.Name == "Column2").ToArray(), RemoteTable, null);
Assert.DoesNotThrow(() => cmd.Execute());
Assert.That(ci.ColumnInfo.Name, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column2]"));
var ei = RepositoryLocator.CatalogueRepository.GetAllObjects<ExtractionInformation>()
.Where(e => e.ID == ci.ExtractionInformation.ID).First();
Assert.That(ei.SelectSQL, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column2]"));
Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID));
var ei = RepositoryLocator.CatalogueRepository
.GetAllObjects<ExtractionInformation>().First(e => e.ID == ci.ExtractionInformation.ID);
Assert.Multiple(() =>
{
Assert.That(ei.SelectSQL, Is.EqualTo($"{RemoteTable.GetFullyQualifiedName()}.[Column2]"));
Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID));
});
}
}
Loading

0 comments on commit 91dcf0d

Please sign in to comment.