@@ -32,7 +32,7 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
3232
3333 let connectionId = 0 ;
3434
35- async function createPostgresClient ( user : string , password : string , pgPort : number | undefined ) {
35+ async function createPostgresClient ( user : string = 'admin' , password : string = 'admin_password' , pgPort : number | undefined = env . cube . pgPort ) {
3636 if ( ! pgPort ) {
3737 throw new Error ( 'port must be defined' ) ;
3838 }
@@ -1513,7 +1513,7 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
15131513 }
15141514
15151515 executePg ( 'SQL API: powerbi min max push down' , async ( ) => {
1516- const connection = await createPostgresClient ( 'admin' , 'admin_password' , env . cube . pgPort ) ;
1516+ const connection = await createPostgresClient ( ) ;
15171517 const res = await connection . query ( `
15181518 select
15191519 max("rows"."orderDate") as "a0",
@@ -1530,7 +1530,7 @@ from
15301530 } ) ;
15311531
15321532 executePg ( 'SQL API: powerbi min max ungrouped flag' , async ( ) => {
1533- const connection = await createPostgresClient ( 'admin' , 'admin_password' , env . cube . pgPort ) ;
1533+ const connection = await createPostgresClient ( ) ;
15341534 const res = await connection . query ( `
15351535 select
15361536 count(distinct("rows"."totalSales")) + max(
@@ -1553,7 +1553,7 @@ from
15531553 } ) ;
15541554
15551555 executePg ( 'SQL API: ungrouped pre-agg' , async ( ) => {
1556- const connection = await createPostgresClient ( 'admin' , 'admin_password' , env . cube . pgPort ) ;
1556+ const connection = await createPostgresClient ( ) ;
15571557 const res = await connection . query ( `
15581558 select
15591559 "productName",
@@ -1564,5 +1564,16 @@ from
15641564 ` ) ;
15651565 expect ( res . rows ) . toMatchSnapshot ( 'ungrouped_pre_agg' ) ;
15661566 } ) ;
1567+
1568+ executePg ( 'SQL API: post-aggregate percentage of total' , async ( ) => {
1569+ const connection = await createPostgresClient ( ) ;
1570+ const res = await connection . query ( `
1571+ select
1572+ sum("BigECommerce"."percentageOfTotalForStatus")
1573+ from
1574+ "public"."BigECommerce" "BigECommerce"
1575+ ` ) ;
1576+ expect ( res . rows ) . toMatchSnapshot ( 'post_aggregate_percentage_of_total' ) ;
1577+ } ) ;
15671578 } ) ;
15681579}
0 commit comments