mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
making expression debug info serializable (#78727)
This commit is contained in:
parent
69ac94c4bd
commit
bddf8ed64a
3 changed files with 6 additions and 7 deletions
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
|
||||
import { ExpressionValue, ExpressionValueError } from '../expression_types';
|
||||
import { ExpressionFunction } from '../../common';
|
||||
|
||||
export type ExpressionAstNode =
|
||||
| ExpressionAstExpression
|
||||
|
@ -48,9 +47,9 @@ export interface ExpressionAstFunctionDebug {
|
|||
success: boolean;
|
||||
|
||||
/**
|
||||
* Reference to the expression function this AST node represents.
|
||||
* Id of expression function.
|
||||
*/
|
||||
fn: ExpressionFunction;
|
||||
fn: string;
|
||||
|
||||
/**
|
||||
* Input that expression function received as its first argument.
|
||||
|
|
|
@ -491,7 +491,7 @@ describe('Execution', () => {
|
|||
await execution.result;
|
||||
|
||||
for (const node of execution.state.get().ast.chain) {
|
||||
expect(node.debug?.fn.name).toBe('add');
|
||||
expect(node.debug?.fn).toBe('add');
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -667,7 +667,7 @@ describe('Execution', () => {
|
|||
|
||||
expect(node2.debug).toMatchObject({
|
||||
success: false,
|
||||
fn: expect.any(Object),
|
||||
fn: 'throws',
|
||||
input: expect.any(Object),
|
||||
args: expect.any(Object),
|
||||
error: expect.any(Object),
|
||||
|
|
|
@ -235,7 +235,7 @@ export class Execution<
|
|||
const timeEnd: number = now();
|
||||
(link as ExpressionAstFunction).debug = {
|
||||
success: true,
|
||||
fn,
|
||||
fn: fn.name,
|
||||
input,
|
||||
args: resolvedArgs,
|
||||
output,
|
||||
|
@ -253,7 +253,7 @@ export class Execution<
|
|||
if (this.params.debug) {
|
||||
(link as ExpressionAstFunction).debug = {
|
||||
success: false,
|
||||
fn,
|
||||
fn: fn.name,
|
||||
input,
|
||||
args,
|
||||
error,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue