mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Dropped Ledger Tables Folder (#1625)
* support and testing for Dropped Ledger Table folder * appending DroppedLedgerTables nodetype * fixing unit tests * undoing string.Empty
This commit is contained in:
@@ -10,6 +10,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||
@@ -242,8 +243,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
||||
//This takes take long to run so not a good test for CI builds
|
||||
public async Task VerifySystemObjects()
|
||||
{
|
||||
string queryFileName = null;
|
||||
string baselineFileName = null;
|
||||
string queryFileName = string.Empty;
|
||||
string baselineFileName = string.Empty;
|
||||
string databaseName = "#testDb#";
|
||||
await TestServiceProvider.CalculateRunTime(() => VerifyObjectExplorerTest(databaseName, queryFileName, "SystemOBjects", baselineFileName, true), true);
|
||||
}
|
||||
@@ -473,9 +474,13 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
||||
{
|
||||
string actual = stringBuilder.ToString();
|
||||
|
||||
// write output to a bin directory for easier comparison
|
||||
string outputRegeneratedFolder = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
|
||||
@"ObjectExplorerServiceTests\Baselines\Regenerated");
|
||||
// Dropped ledger objects have a randomly generated GUID appended to their name when they are deleted
|
||||
// For testing purposes, those guids need to be replaced with a deterministic string
|
||||
actual = Regex.Replace(actual, "[A-Z0-9]{32}", "<<NonDeterministic>>");
|
||||
|
||||
// Write output to a bin directory for easier comparison
|
||||
string assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty;
|
||||
string outputRegeneratedFolder = Path.Combine(assemblyPath, @"ObjectExplorerServiceTests\Baselines\Regenerated");
|
||||
string outputRegeneratedFilePath = Path.Combine(outputRegeneratedFolder, baselineFileName);
|
||||
string msg = "";
|
||||
|
||||
@@ -488,8 +493,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//We don't want to fail the test completely if we failed to write the regenerated baseline
|
||||
//(especially if the test passed).
|
||||
// We don't want to fail the test completely if we failed to write the regenerated baseline
|
||||
// (especially if the test passed).
|
||||
msg = $"Errors also occurred while attempting to write the new baseline file {outputRegeneratedFilePath} : {e.Message}";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user