test: 조건부 통합 fixture의 시계와 소유권을 격리한다

This commit is contained in:
2026-08-24 09:18:52 +00:00
parent 7a1254cb3a
commit 69000d4cb9
9 changed files with 78 additions and 26 deletions
@@ -13,10 +13,12 @@ NPC_POSSESSION_DIFFERENTIAL_DATABASE_URL reference_npc_possession
PROFILE_SEED_CLI_DATABASE_URL core
PROFILE_SEED_DATABASE_URL core
PROFILE_LOCK_SECONDARY_DATABASE_URL core
PROFILE_MIGRATION_UTC_DATABASE_URL external_fixture
READ_MODEL_JOURNAL_DATABASE_URL read_model_journal
RESERVED_TURN_DATABASE_URL core
SECURITY_TRANSPORT_DATABASE_URL security_transport
SELECT_POOL_DATABASE_URL select_pool
SCENARIO_LIFECYCLE_DATABASE_URL scenario_lifecycle
TURN_DAEMON_LEASE_DATABASE_URL core
TURN_COMMAND_DURABLE_MATRIX_DATABASE_URL reference_command_durable_matrix
TURN_DIFFERENTIAL_DATABASE_URL core
1 # Environment variable Execution mode
13 PROFILE_SEED_CLI_DATABASE_URL core
14 PROFILE_SEED_DATABASE_URL core
15 PROFILE_LOCK_SECONDARY_DATABASE_URL core
16 PROFILE_MIGRATION_UTC_DATABASE_URL external_fixture
17 READ_MODEL_JOURNAL_DATABASE_URL read_model_journal
18 RESERVED_TURN_DATABASE_URL core
19 SECURITY_TRANSPORT_DATABASE_URL security_transport
20 SELECT_POOL_DATABASE_URL select_pool
21 SCENARIO_LIFECYCLE_DATABASE_URL scenario_lifecycle
22 TURN_DAEMON_LEASE_DATABASE_URL core
23 TURN_COMMAND_DURABLE_MATRIX_DATABASE_URL reference_command_durable_matrix
24 TURN_DIFFERENTIAL_DATABASE_URL core
@@ -14,7 +14,7 @@ import {
type RedisConnector,
} from '@sammo-ts/infra';
const databaseUrl = process.env.INPUT_EVENT_DATABASE_URL;
const databaseUrl = process.env.SCENARIO_LIFECYCLE_DATABASE_URL;
const integration = describe.skipIf(!databaseUrl);
const scenarioId = 2900;
const userIds = ['scenario29-betting-winner', 'scenario29-betting-loser'] as const;
+15 -1
View File
@@ -41,7 +41,7 @@ node_tag=$(printf '%s' "${CI_NODE_INDEX:-local}" | tr -cd 'a-zA-Z0-9_' | tr 'A-Z
run_id=$(date -u +%m%d%H%M%S)_$$_${node_tag}
export CONDITIONAL_INTEGRATION_RUN_ID=$run_id
schema_ownership_token="sammo-conditional-integration:$run_id"
supported_registry_modes="core create_general external_fixture gateway_runtime immediate_action npc_possession read_model_journal reference_command_durable_matrix reference_full_lifecycle reference_live_sortie reference_npc_possession security_transport select_pool web_push_gateway"
supported_registry_modes="core create_general external_fixture gateway_runtime immediate_action npc_possession read_model_journal reference_command_durable_matrix reference_full_lifecycle reference_live_sortie reference_npc_possession scenario_lifecycle security_transport select_pool web_push_gateway"
term_grace_seconds=${CONDITIONAL_INTEGRATION_TERM_GRACE_SECONDS:-10}
case "$term_grace_seconds" in
''|*[!0-9]*)
@@ -55,6 +55,7 @@ if [ "$term_grace_seconds" -lt 1 ] || [ "$term_grace_seconds" -gt 60 ]; then
fi
integration_schema=${CONDITIONAL_INTEGRATION_SCHEMA:-ci_${run_id}_integration}
scenario_schema=${SCENARIO_SEED_INTEGRATION_SCHEMA:-ci_${run_id}_scenario_seed}
scenario_lifecycle_schema=${SCENARIO_LIFECYCLE_INTEGRATION_SCHEMA:-ci_${run_id}_scenario_lifecycle}
npc_possession_schema=${NPC_POSSESSION_INTEGRATION_SCHEMA:-ci_${run_id}_npc_possession_integration}
create_general_schema=${CREATE_GENERAL_INTEGRATION_SCHEMA:-ci_${run_id}_create_general_integration}
select_pool_schema=${SELECT_POOL_INTEGRATION_SCHEMA:-ci_${run_id}_select_pool_integration}
@@ -71,6 +72,7 @@ turn_full_lifecycle_schema=${TURN_FULL_LIFECYCLE_PERSISTENCE_SCHEMA:-ci_${run_id
for schema in \
"$integration_schema" \
"$scenario_schema" \
"$scenario_lifecycle_schema" \
"$npc_possession_schema" \
"$create_general_schema" \
"$select_pool_schema" \
@@ -485,6 +487,7 @@ cleanup_resources_started=1
create_owned_schema "$integration_schema"
create_owned_schema "$npc_possession_schema"
create_owned_schema "$scenario_schema"
create_owned_schema "$scenario_lifecycle_schema"
database_url=$(build_database_url "$integration_schema")
export POSTGRES_SCHEMA=$integration_schema
@@ -510,6 +513,17 @@ run_marked_tests app/game-api "$core_database_markers" "game_api_postgresql"
run_marked_tests app/game-engine "$core_database_markers" "game_engine_postgresql"
run_marked_tests tools/integration-tests "$core_database_markers" "snapshot_postgresql"
scenario_lifecycle_database_url=$(build_database_url "$scenario_lifecycle_schema")
(
export POSTGRES_SCHEMA=$scenario_lifecycle_schema
export DATABASE_URL=$scenario_lifecycle_database_url
pnpm --filter @sammo-ts/infra prisma:migrate:deploy:game
)
export SCENARIO_LIFECYCLE_DATABASE_URL=$scenario_lifecycle_database_url
run_marked_tests tools/integration-tests \
"$(markers_for_mode scenario_lifecycle)" \
"scenario_lifecycle_postgresql"
create_owned_schema "$read_model_journal_schema"
read_model_journal_database_url=$(build_database_url "$read_model_journal_schema")
(