T-40: M1.1c — Pass 1 exchanges: ISO MIC seed, source-code role classifier and reviewable seed-SQL generator
This commit is contained in:
parent
c36f89352c
commit
d0d2ebdfc8
2 changed files with 10 additions and 6 deletions
|
|
@ -214,7 +214,8 @@ async function expectPgErrorCode(operation: Promise<unknown>, expectedCode: stri
|
|||
async function seedListing(pool: Pool) {
|
||||
await pool.query(
|
||||
`INSERT INTO exchange (mic, operating_mic, name, country_iso, currency, timezone, calendar_code)
|
||||
VALUES ('XNYS', 'XNYS', 'New York Stock Exchange', 'US', 'USD', 'America/New_York', 'XNYS')`
|
||||
VALUES ('XNYS', 'XNYS', 'New York Stock Exchange', 'US', 'USD', 'America/New_York', 'XNYS')
|
||||
ON CONFLICT (mic) DO NOTHING`
|
||||
);
|
||||
const instrumentId = (
|
||||
await pool.query(
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ describe('34-security-master.sql static contract', () => {
|
|||
});
|
||||
|
||||
describe('34-security-master.sql track registration', () => {
|
||||
test('master track runs 01-05 then 34, and nothing else', async () => {
|
||||
test('master track runs 01-05 then 34-35, and nothing else', async () => {
|
||||
expect(await filesForTrack('master')).toEqual([
|
||||
'01-init-database.sql',
|
||||
'02-master-schema.sql',
|
||||
|
|
@ -260,22 +260,25 @@ describe('34-security-master.sql track registration', () => {
|
|||
'04-provider-exchange-mapping-schema.sql',
|
||||
'05-add-visible-column.sql',
|
||||
'34-security-master.sql',
|
||||
'35-security-master-exchange-seed.sql',
|
||||
]);
|
||||
});
|
||||
|
||||
test('research track (web-api startup default) never runs 34-security-master.sql', async () => {
|
||||
test('research track (web-api startup default) never runs 34-security-master.sql or 35-security-master-exchange-seed.sql', async () => {
|
||||
const research = await filesForTrack('research');
|
||||
expect(research).not.toContain('34-security-master.sql');
|
||||
expect(research).not.toContain('35-security-master-exchange-seed.sql');
|
||||
expect(research.length).toBeGreaterThan(0);
|
||||
|
||||
const { postgres } = recordingClient();
|
||||
expect(await runPostgresMigrations(postgres as never)).toEqual(research);
|
||||
});
|
||||
|
||||
test('all track runs 34-security-master.sql last, after research 09-33, and skips 06-08', async () => {
|
||||
test('all track runs 34-security-master.sql and 35-security-master-exchange-seed.sql last, after research 09-33, and skips 06-08', async () => {
|
||||
const all = await filesForTrack('all');
|
||||
expect(all.at(-1)).toBe('34-security-master.sql');
|
||||
expect(all.indexOf('33-candidate-decimal-normalization.sql')).toBe(all.length - 2);
|
||||
expect(all.at(-2)).toBe('34-security-master.sql');
|
||||
expect(all.at(-1)).toBe('35-security-master-exchange-seed.sql');
|
||||
expect(all.indexOf('33-candidate-decimal-normalization.sql')).toBe(all.length - 3);
|
||||
for (const bootstrap of [
|
||||
'06-create-backtest-tables.sql',
|
||||
'07-fix-execution-time-type.sql',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue