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