File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/cubejs-server-core/test/unit Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -840,10 +840,11 @@ describe('Refresh Scheduler', () => {
840840 const ctx = { authInfo : { tenantId : 'tenant1' } , securityContext : { tenantId : 'tenant1' } , requestId : 'XXX' } ;
841841
842842 let finish = false ;
843+ let jobs : string [ ] ;
843844
844845 while ( ! finish ) {
845846 try {
846- await refreshScheduler . postBuildJobs (
847+ jobs = await refreshScheduler . postBuildJobs (
847848 ctx ,
848849 {
849850 metadata : undefined ,
@@ -882,6 +883,11 @@ describe('Refresh Scheduler', () => {
882883 expect ( mockDriver . createdTables . filter ( o => o . tableName . includes ( 'foo_orphaned' ) && o . timezone === 'America/Los_Angeles' ) . length ) . toEqual ( 5 ) ;
883884 expect ( mockDriver . createdTables . filter ( o => o . tableName . includes ( 'foo_second' ) && o . timezone === 'UTC' ) . length ) . toEqual ( 5 ) ;
884885 expect ( mockDriver . createdTables . filter ( o => o . tableName . includes ( 'foo_second' ) && o . timezone === 'America/Los_Angeles' ) . length ) . toEqual ( 5 ) ;
886+
887+ // Let's also test the getCachedBuildJobs()
888+ const buildJobs = await refreshScheduler . getCachedBuildJobs ( ctx , jobs ) ;
889+ const allTokensExist = jobs . every ( token => buildJobs . some ( job => job . token === token ) ) ;
890+ expect ( allTokensExist ) . toBeTruthy ( ) ;
885891 } ) ;
886892
887893 test ( 'Only `first` pre-aggregation' , async ( ) => {
You can’t perform that action at this time.
0 commit comments