diff --git a/test/postgres/security-master-catalog.test.ts b/test/postgres/security-master-catalog.test.ts index 67892391..138fb450 100644 --- a/test/postgres/security-master-catalog.test.ts +++ b/test/postgres/security-master-catalog.test.ts @@ -214,7 +214,8 @@ async function expectPgErrorCode(operation: Promise, 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( diff --git a/test/postgres/security-master-contract.test.ts b/test/postgres/security-master-contract.test.ts index 91dc0ed1..c36c07c6 100644 --- a/test/postgres/security-master-contract.test.ts +++ b/test/postgres/security-master-contract.test.ts @@ -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',