@@ -111,11 +111,20 @@ describeWithCodeQL()("using the legacy query server", () => {
111111 let qs : qsClient . QueryServerClient ;
112112 let cliServer : cli . CodeQLCliServer ;
113113
114+ let supportNewQueryServer = false ;
115+
114116 beforeAll ( async ( ) => {
115117 const extension = await getActivatedExtension ( ) ;
116118 cliServer = extension . cliServer ;
117119 cliServer . quiet = true ;
118120
121+ if ( await cliServer . cliConstraints . supportsNewQueryServerForTests ( ) ) {
122+ console . log (
123+ "Skipping legacy-query tests: the CLI supports the new query server" ,
124+ ) ;
125+ supportNewQueryServer = true ;
126+ }
127+
119128 qs = new QueryServerClient (
120129 createMockApp ( { } ) ,
121130 {
@@ -145,10 +154,18 @@ describeWithCodeQL()("using the legacy query server", () => {
145154 const parsedResults = new Checkpoint < void > ( ) ;
146155
147156 it ( "should register the database if necessary" , async ( ) => {
157+ if ( supportNewQueryServer ) {
158+ return ;
159+ }
160+
148161 await qs . sendRequest ( messages . registerDatabases , { databases : [ db ] } ) ;
149162 } ) ;
150163
151164 it ( `should be able to compile query ${ queryName } ` , async ( ) => {
165+ if ( supportNewQueryServer ) {
166+ return ;
167+ }
168+
152169 expect ( existsSync ( queryTestCase . queryPath ) ) . toBe ( true ) ;
153170 try {
154171 const qlProgram : messages . QlProgram = {
@@ -188,6 +205,10 @@ describeWithCodeQL()("using the legacy query server", () => {
188205 } ) ;
189206
190207 it ( `should be able to run query ${ queryName } ` , async ( ) => {
208+ if ( supportNewQueryServer ) {
209+ return ;
210+ }
211+
191212 try {
192213 await compilationSucceeded . done ( ) ;
193214 const callbackId = qs . registerCallback ( ( _res ) => {
@@ -217,6 +238,10 @@ describeWithCodeQL()("using the legacy query server", () => {
217238
218239 const actualResultSets : ResultSets = { } ;
219240 it ( `should be able to parse results of query ${ queryName } ` , async ( ) => {
241+ if ( supportNewQueryServer ) {
242+ return ;
243+ }
244+
220245 await evaluationSucceeded . done ( ) ;
221246 const info = await cliServer . bqrsInfo ( RESULTS_PATH ) ;
222247
@@ -231,6 +256,10 @@ describeWithCodeQL()("using the legacy query server", () => {
231256 } ) ;
232257
233258 it ( `should have correct results for query ${ queryName } ` , async ( ) => {
259+ if ( supportNewQueryServer ) {
260+ return ;
261+ }
262+
234263 await parsedResults . done ( ) ;
235264 expect ( actualResultSets ) . not . toEqual ( { } ) ;
236265 expect ( Object . keys ( actualResultSets ! ) . sort ( ) ) . toEqual (
0 commit comments