test: restore validation baseline
This commit is contained in:
@@ -178,6 +178,7 @@ describe('CreateManyNPC monthly action', () => {
|
||||
"dex4": 0,
|
||||
"dex5": 0,
|
||||
"killturn": 323,
|
||||
"legacyScanOrder": 1,
|
||||
"npcType": 3,
|
||||
"npc_org": 3,
|
||||
"specage": 27,
|
||||
|
||||
@@ -417,10 +417,17 @@ describe('NPC 건국/통일 장기 시뮬레이션', () => {
|
||||
undefined,
|
||||
observeProfileMonth
|
||||
);
|
||||
memoryProfiler?.sample('all-cities-occupied');
|
||||
|
||||
await runUntil(
|
||||
(current) =>
|
||||
world.listCities().every((city) => city.nationId > 0) ||
|
||||
current.currentYear > 184 ||
|
||||
(current.currentYear === 184 && current.currentMonth >= 6),
|
||||
undefined,
|
||||
observeProfileMonth
|
||||
);
|
||||
const neutralCities = world.listCities().filter((city) => city.nationId <= 0);
|
||||
expect(neutralCities.length).toBe(0);
|
||||
memoryProfiler?.sample('all-cities-occupied');
|
||||
|
||||
const hasHighOfficer = world
|
||||
.listGenerals()
|
||||
@@ -569,6 +576,18 @@ describe('NPC 건국/통일 장기 시뮬레이션', () => {
|
||||
prevNationCount = activeNationCount;
|
||||
|
||||
if (activeNationCount === 1 && !unifiedAt) {
|
||||
const currentState = world.getState();
|
||||
const currentMeta = currentState.meta as Record<string, unknown>;
|
||||
// The processor intentionally stops calendar advancement after unification.
|
||||
// Waiting for another month from this state would rerun due generals forever.
|
||||
if ((currentMeta.isUnited ?? currentMeta.isunited ?? 0) !== 0) {
|
||||
unifiedAt = {
|
||||
year: currentState.currentYear,
|
||||
month: currentState.currentMonth,
|
||||
};
|
||||
memoryProfiler?.sample('unified');
|
||||
break;
|
||||
}
|
||||
const nextMonth = addMonths(world.getState().currentYear, world.getState().currentMonth, 1);
|
||||
await runUntil(
|
||||
(current) =>
|
||||
|
||||
@@ -130,8 +130,8 @@ const chiefCenter = {
|
||||
|
||||
const install = async (page: Page, rejectGeneral = false) => {
|
||||
const requests: unknown[] = [];
|
||||
let generalTurns = turns(30);
|
||||
let nationTurns = turns(12);
|
||||
const generalTurns = turns(30);
|
||||
const nationTurns = turns(12);
|
||||
let generalRevision = 0;
|
||||
let nationRevision = 0;
|
||||
await page.addInitScript((profile) => {
|
||||
|
||||
@@ -62,6 +62,7 @@ const candidates = computed(() =>
|
||||
);
|
||||
const totalAmount = computed(() => summary.value?.totalAmount ?? 0);
|
||||
const myAmount = computed(() => summary.value?.myAmount ?? 0);
|
||||
const betTotals = computed(() => summary.value?.totals as Record<number, number> | undefined);
|
||||
const ratio = (id: number) => {
|
||||
const totals = summary.value?.totals as Record<number, number> | undefined;
|
||||
const amount = totals?.[id] ?? 0;
|
||||
@@ -125,7 +126,7 @@ const placeBet = async (targetId: number) => {
|
||||
:participants="snapshot?.participants ?? []"
|
||||
:matches="snapshot?.matches ?? []"
|
||||
:winner-id="snapshot?.state?.winnerId"
|
||||
:bet-totals="summary?.totals as Record<number, number> | undefined"
|
||||
:bet-totals="betTotals"
|
||||
:total-bet="totalAmount"
|
||||
:show-legend="false"
|
||||
force-desktop
|
||||
|
||||
@@ -231,19 +231,14 @@ export const accountRouter = router({
|
||||
contentType: ICON_CONTENT_TYPES[extension]!,
|
||||
body: buffer,
|
||||
});
|
||||
let stored;
|
||||
try {
|
||||
stored = await ctx.users.addIconForWindow(
|
||||
user.id,
|
||||
uploaded.picture,
|
||||
0,
|
||||
now,
|
||||
new Date(now.getTime() - ICON_UPLOAD_COOLDOWN_MS),
|
||||
MAX_ACTIVE_ICONS
|
||||
);
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
const stored = await ctx.users.addIconForWindow(
|
||||
user.id,
|
||||
uploaded.picture,
|
||||
0,
|
||||
now,
|
||||
new Date(now.getTime() - ICON_UPLOAD_COOLDOWN_MS),
|
||||
MAX_ACTIVE_ICONS
|
||||
);
|
||||
if (!stored.ok) {
|
||||
if (stored.reason === 'LIMIT') {
|
||||
throw new TRPCError({
|
||||
|
||||
@@ -166,8 +166,8 @@ describe('Blank Start Scenario', () => {
|
||||
const world = new InMemoryWorld(snapshot);
|
||||
const runner = new TestGameRunner(world, 189, 1);
|
||||
|
||||
const gen0 = world.getAllGenerals().find((g) => g.name === 'General_0')!;
|
||||
const gen1 = world.getAllGenerals().find((g) => g.name === 'General_1')!;
|
||||
const gen0 = world.getAllGenerals().find((g) => g.name.endsWith('General_0'))!;
|
||||
const gen1 = world.getAllGenerals().find((g) => g.name.endsWith('General_1'))!;
|
||||
|
||||
const foundNationDef = foundNationSpec.createDefinition(systemEnv);
|
||||
const uprisingDef = uprisingSpec.createDefinition(systemEnv);
|
||||
@@ -288,7 +288,7 @@ describe('Blank Start Scenario', () => {
|
||||
options: { includeNeutralNation: true, defaultGeneralGold: 1000, defaultGeneralRice: 1000 },
|
||||
});
|
||||
const world = new InMemoryWorld(bootstrapResult.snapshot);
|
||||
const gen0 = world.getAllGenerals().find((g) => g.name === 'General_0')!;
|
||||
const gen0 = world.getAllGenerals().find((g) => g.name.endsWith('General_0'))!;
|
||||
|
||||
// Setup monarch in wandering nation but city level is 1 (수)
|
||||
const newNation: Nation = {
|
||||
@@ -334,7 +334,7 @@ describe('Blank Start Scenario', () => {
|
||||
options: { includeNeutralNation: true },
|
||||
});
|
||||
const world = new InMemoryWorld(bootstrapResult.snapshot);
|
||||
const gen0 = world.getAllGenerals().find((g) => g.name === 'General_0')!;
|
||||
const gen0 = world.getAllGenerals().find((g) => g.name.endsWith('General_0'))!;
|
||||
|
||||
const foundNationDef = foundNationSpec.createDefinition(systemEnv);
|
||||
// Setup monarch and enough generals
|
||||
|
||||
@@ -265,9 +265,9 @@ describe('Reserved Turn Execution', () => {
|
||||
|
||||
// 3. Define Reserved Turns
|
||||
// This is "Setting all generals' reserved turns"
|
||||
const gen0 = world.getAllGenerals().find((g) => g.name === 'General_0')!;
|
||||
const gen1 = world.getAllGenerals().find((g) => g.name === 'General_1')!;
|
||||
const gen2 = world.getAllGenerals().find((g) => g.name === 'General_2')!;
|
||||
const gen0 = world.getAllGenerals().find((g) => g.name.endsWith('General_0'))!;
|
||||
const gen1 = world.getAllGenerals().find((g) => g.name.endsWith('General_1'))!;
|
||||
const gen2 = world.getAllGenerals().find((g) => g.name.endsWith('General_2'))!;
|
||||
|
||||
const reservedTurns: ReservedTurnMap = {
|
||||
[gen0.id]: [
|
||||
|
||||
@@ -278,6 +278,7 @@ describe('auction integration flow', () => {
|
||||
});
|
||||
await gatewayClient.admin.profiles.updateMeta.mutate({
|
||||
profileName: 'che:908',
|
||||
reason: 'integration test setup',
|
||||
patch: {
|
||||
localAccountGeneralCreationGraceDays: 7,
|
||||
},
|
||||
|
||||
@@ -242,6 +242,7 @@ describe('integration initialization flow', () => {
|
||||
});
|
||||
await gatewayClient.admin.profiles.updateMeta.mutate({
|
||||
profileName: 'che:2',
|
||||
reason: 'integration test setup',
|
||||
patch: {
|
||||
localAccountGeneralCreationGraceDays: 7,
|
||||
},
|
||||
|
||||
@@ -564,6 +564,7 @@ describe('pm2 orchestrator e2e', () => {
|
||||
});
|
||||
await gatewayClient.admin.profiles.updateMeta.mutate({
|
||||
profileName,
|
||||
reason: 'integration test setup',
|
||||
patch: {
|
||||
localAccountGeneralCreationGraceDays: 7,
|
||||
},
|
||||
|
||||
@@ -208,6 +208,7 @@ describe('actual tournament lifecycle', () => {
|
||||
});
|
||||
await gatewayClient.admin.profiles.updateMeta.mutate({
|
||||
profileName: 'che:908',
|
||||
reason: 'integration test setup',
|
||||
patch: {
|
||||
localAccountGeneralCreationGraceDays: 7,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user