Skip to content

Commit

Permalink
remove not needed parts
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Dec 19, 2024
1 parent 40bd01b commit d12c072
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 96 deletions.
70 changes: 0 additions & 70 deletions plugin-server/tests/cdp/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,76 +481,6 @@ export const HOG_INPUTS_EXAMPLES: Record<string, Pick<HogFunctionType, 'inputs'
},
},
},

inputs_reference_working: {
inputs_schema: [
{
key: 'simple',
type: 'string',
secret: false,
required: true,
},
{
key: 'json',
type: 'json',
secret: false,
required: false,
},
{
key: 'mixed',
type: 'string',
secret: false,
required: false,
},
],
inputs: {
json: {
value: {
mixed: '{inputs.mixed}',
simple: '{inputs.simple}',
},
bytecode: {
mixed: ['_H', 1, 32, 'mixed', 32, 'inputs', 1, 2],
simple: ['_H', 1, 32, 'simple', 32, 'inputs', 1, 2],
},
},
mixed: {
value: 'Message: {inputs.simple}',
bytecode: ['_H', 1, 32, 'Message: ', 32, 'simple', 32, 'inputs', 1, 2, 2, 'concat', 2],
},
simple: {
value: 'Hello {event.properties.email}',
bytecode: ['_H', 1, 32, 'Hello ', 32, 'email', 32, 'properties', 32, 'event', 1, 3, 2, 'concat', 2],
},
},
},

inputs_reference_circular: {
inputs_schema: [
{
key: 'circular',
type: 'string',
secret: false,
required: true,
},
{
key: 'circular_2',
type: 'string',
secret: false,
required: false,
},
],
inputs: {
circular_2: {
value: '{inputs.circular}',
bytecode: ['_H', 1, 32, 'circular', 32, 'inputs', 1, 2],
},
circular: {
value: '{inputs.circular_2}',
bytecode: ['_H', 1, 32, 'circular_2', 32, 'inputs', 1, 2],
},
},
},
}

export const HOG_FILTERS_EXAMPLES: Record<string, Pick<HogFunctionType, 'filters'>> = {
Expand Down
26 changes: 0 additions & 26 deletions plugin-server/tests/cdp/hog-executor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,30 +662,4 @@ describe('Hog Executor', () => {
)
})
})

describe('inputs building', () => {
// TODO: Fix these tests
it('builds inputs from bytecode with input dependencies', () => {
const fn = createHogFunction({
...HOG_EXAMPLES.simple_fetch,
...HOG_INPUTS_EXAMPLES.inputs_reference_working,
...HOG_FILTERS_EXAMPLES.no_filters,
})

const result = executor.buildHogFunctionGlobals(createInvocation(fn))
expect(result.inputs).toMatchInlineSnapshot()
})

it('throws an error if there is a circular dependency', () => {
const fn = createHogFunction({
...HOG_EXAMPLES.simple_fetch,
...HOG_INPUTS_EXAMPLES.inputs_reference_circular,
...HOG_FILTERS_EXAMPLES.no_filters,
})

expect(() => executor.buildHogFunctionGlobals(createInvocation(fn))).toThrow(
'Circular dependency detected in inputs: circular_2 -> circular'
)
})
})
})

0 comments on commit d12c072

Please sign in to comment.