feat: migrate legacy playout workflow and scenes
This commit is contained in:
@@ -5,7 +5,7 @@ using MBN_STOCK_WEBVIEW.Infrastructure;
|
||||
using MMoneyCoderSharp.Data;
|
||||
|
||||
Console.OutputEncoding = Encoding.UTF8;
|
||||
using var cancellation = new CancellationTokenSource(TimeSpan.FromMinutes(3));
|
||||
using var cancellation = new CancellationTokenSource(TimeSpan.FromMinutes(10));
|
||||
Console.CancelKeyPress += (_, eventArgs) =>
|
||||
{
|
||||
eventArgs.Cancel = true;
|
||||
@@ -27,7 +27,8 @@ try
|
||||
|
||||
if (statuses.Any(status => status.State != DatabaseHealthState.Healthy))
|
||||
{
|
||||
Console.Error.WriteLine("Smoke test stopped because both database health probes must be healthy.");
|
||||
Console.Error.WriteLine(
|
||||
"Smoke test stopped because both database health probes must be healthy.");
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -38,6 +39,7 @@ try
|
||||
await VerifySnapshotAsync(service, MarketDataView.Kosdaq, cancellation.Token);
|
||||
await VerifySnapshotAsync(service, MarketDataView.Index, cancellation.Token);
|
||||
await VerifySnapshotAsync(service, MarketDataView.Overseas, cancellation.Token);
|
||||
await RealSceneDbSmoke.RunAsync(runtime.Executor, cancellation.Token);
|
||||
|
||||
Console.WriteLine("REAL_DB_SMOKE: PASS");
|
||||
return 0;
|
||||
@@ -54,7 +56,8 @@ catch (DatabaseInfrastructureException exception)
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.Error.WriteLine("REAL_DB_SMOKE: FAIL - An unexpected error occurred. No provider details were printed.");
|
||||
Console.Error.WriteLine(
|
||||
"REAL_DB_SMOKE: FAIL - An unexpected error occurred. No provider details were printed.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -65,12 +68,14 @@ static string? GetConfigurationPath(string[] arguments)
|
||||
return null;
|
||||
}
|
||||
|
||||
if (arguments.Length == 2 && arguments[0].Equals("--config", StringComparison.OrdinalIgnoreCase))
|
||||
if (arguments.Length == 2 &&
|
||||
arguments[0].Equals("--config", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return arguments[1];
|
||||
}
|
||||
|
||||
throw new DatabaseConfigurationException("Usage: MBN_STOCK_WEBVIEW.DbSmoke [--config <path>]");
|
||||
throw new DatabaseConfigurationException(
|
||||
"Usage: MBN_STOCK_WEBVIEW.DbSmoke [--config <path>]");
|
||||
}
|
||||
|
||||
static async Task VerifyOracleServerVersionAsync(
|
||||
@@ -89,22 +94,33 @@ static async Task VerifyOracleServerVersionAsync(
|
||||
|
||||
if (table.Rows.Count == 0 || table.Columns.Count == 0)
|
||||
{
|
||||
throw new DatabaseConfigurationException("Oracle 서버 버전을 확인할 수 없습니다.");
|
||||
throw new DatabaseConfigurationException(
|
||||
"The Oracle server version query returned no version.");
|
||||
}
|
||||
|
||||
var version = Convert.ToString(table.Rows[0][0], CultureInfo.InvariantCulture) ?? string.Empty;
|
||||
var match = Regex.Match(version, @"(?<!\d)(?<major>\d{2})(?:\.\d+)", RegexOptions.CultureInvariant);
|
||||
var version = Convert.ToString(
|
||||
table.Rows[0][0],
|
||||
CultureInfo.InvariantCulture) ?? string.Empty;
|
||||
var match = Regex.Match(
|
||||
version,
|
||||
@"(?<!\d)(?<major>\d{2})(?:\.\d+)",
|
||||
RegexOptions.CultureInvariant);
|
||||
if (!match.Success ||
|
||||
!int.TryParse(match.Groups["major"].Value, NumberStyles.None, CultureInfo.InvariantCulture, out var major))
|
||||
!int.TryParse(
|
||||
match.Groups["major"].Value,
|
||||
NumberStyles.None,
|
||||
CultureInfo.InvariantCulture,
|
||||
out var major))
|
||||
{
|
||||
throw new DatabaseConfigurationException("Oracle 서버 주 버전을 판별할 수 없습니다.");
|
||||
throw new DatabaseConfigurationException(
|
||||
"The Oracle server major version could not be determined.");
|
||||
}
|
||||
|
||||
Console.WriteLine($"Oracle server major version: {major}");
|
||||
if (major < 19)
|
||||
{
|
||||
throw new DatabaseConfigurationException(
|
||||
"Oracle.ManagedDataAccess.Core 23.26.200은 Oracle Database 19c 이상이 필요합니다.");
|
||||
"Oracle.ManagedDataAccess.Core requires Oracle Database 19c or newer.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,20 +129,26 @@ static async Task VerifySnapshotAsync(
|
||||
MarketDataView view,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var snapshot = await service.GetAsync(view, maximumRowsPerTable: 5, cancellationToken);
|
||||
var snapshot = await service.GetAsync(
|
||||
view,
|
||||
maximumRowsPerTable: 5,
|
||||
cancellationToken);
|
||||
if (snapshot.Tables.Count == 0)
|
||||
{
|
||||
throw new DatabaseConfigurationException($"{view} 조회 결과에 데이터셋이 없습니다.");
|
||||
throw new DatabaseConfigurationException(
|
||||
$"{view} returned no database result set.");
|
||||
}
|
||||
|
||||
foreach (var table in snapshot.Tables)
|
||||
{
|
||||
if (table.Columns.Count == 0)
|
||||
{
|
||||
throw new DatabaseConfigurationException($"{view}/{table.Name} 결과 열이 없습니다.");
|
||||
throw new DatabaseConfigurationException(
|
||||
$"{view}/{table.Name} returned no columns.");
|
||||
}
|
||||
|
||||
Console.WriteLine(
|
||||
$"{view}/{table.Source}/{table.Name}: {table.TotalRowCount.ToString(CultureInfo.InvariantCulture)} rows");
|
||||
$"{view}/{table.Source}/{table.Name}: " +
|
||||
$"{table.TotalRowCount.ToString(CultureInfo.InvariantCulture)} rows");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user