6060import org .dbsp .sqlCompiler .ir .expression .literal .DBSPUSizeLiteral ;
6161import org .dbsp .sqlCompiler .ir .expression .DBSPArrayExpression ;
6262import org .dbsp .sqlCompiler .ir .expression .DBSPZSetExpression ;
63+ import org .dbsp .sqlCompiler .ir .statement .DBSPComment ;
6364import org .dbsp .sqlCompiler .ir .statement .DBSPLetStatement ;
6465import org .dbsp .sqlCompiler .ir .statement .DBSPStatement ;
6566import org .dbsp .sqlCompiler .ir .type .DBSPType ;
@@ -196,8 +197,7 @@ boolean runBatch(TestStatistics result, boolean cleanup) {
196197 this .writeCodeToFile (compiler , Linq .list (inputFunction ), codeGenerated );
197198 this .startTest ();
198199 if (this .execute ) {
199- String [] extraArgs = new String [0 ];
200- Utilities .compileAndTestRust (Main .getAbsoluteRustDirectory (), true , extraArgs );
200+ Utilities .compileAndTestRust (Main .getAbsoluteRustDirectory (), true );
201201 }
202202 this .queriesToRun .clear ();
203203 System .out .println (elapsedTime (queryNo ));
@@ -290,6 +290,7 @@ ProgramAndTester generateTestCase(
290290 compiler .submitStatementForCompilation (dbspQuery );
291291 compiler .throwIfErrorsOccurred ();
292292 DBSPCircuit circuit = compiler .getFinalCircuit (false );
293+ assert circuit != null ;
293294 circuit .setName ("circuit" + suffix );
294295 DBSPNode .done ();
295296
@@ -310,7 +311,7 @@ ProgramAndTester generateTestCase(
310311 }
311312
312313 return createTesterCode (
313- "tester" + suffix , circuit , outputNumber ,
314+ "tester" + suffix , origQuery , circuit , outputNumber ,
314315 gen .getInputFunction (),
315316 compiler .getTableContents (),
316317 expectedOutput , testQuery .outputDescription );
@@ -416,22 +417,25 @@ public TestStatistics execute(SltTestFile file, OptionsParser.SuppliedOptions op
416417 /**
417418 * Generates a Rust function which tests a DBSP circuit.
418419 * @param name Name of the generated function.
420+ * @param query Query that is being tested.
419421 * @param circuit DBSP circuit that will be tested.
420422 * @param output Expected data from the circuit.
421423 * @param description Description of the expected outputs.
422424 * @param outputNumber Position of data output in output vector.
423425 * @return The code for a function that runs the circuit with the specified
424- * input and tests the produced output.
425- */
426+ * input and tests the produced output. */
426427 static ProgramAndTester createTesterCode (
427428 String name ,
429+ String query ,
428430 DBSPCircuit circuit ,
429431 int outputNumber ,
430432 DBSPFunction inputGeneratingFunction ,
431433 TableContents contents ,
432434 @ Nullable DBSPZSetExpression output ,
433435 SqlTestQueryOutputDescription description ) {
434436 List <DBSPStatement > list = new ArrayList <>();
437+ DBSPComment comment = new DBSPComment (query );
438+ list .add (comment );
435439 DBSPExpression arg = new DBSPApplyExpression (
436440 "CircuitConfig::with_workers" , DBSPTypeAny .getDefault (), new DBSPUSizeLiteral (2 )); // workers
437441 DBSPLetStatement cas = new DBSPLetStatement ("circ" ,
0 commit comments