bloblang import does not work in unittest
Running Unit tests for a pipeline with import ".blobl file" fails with: failed to read import: open /home/nixos/repo/OpenIntegration/src/streams/fxmanager/maps/quoterequest.blobl: no such file or directory: impor
This works fine when running the pipeline.
pipeline:
processors:
- try:
- branch:
request_map: |
import "./src/streams/fxmanager/maps/quoterequest.blobl"
root = this.request.apply("secondary_currency")
processors:
- log:
level: INFO
message: "hello world"
result_map: |
root = this
tests:
- name: Failing
input_batch:
- content: |
{
}
output_batches:
- - json_equals: |
{
}
Hey @henrikschristensen 👋 Have you tried using the target_mapping parameter as a workaround?
See docs for unit testing bloblang
I haven't confirmed this, but I'm assuming that bloblang environment for unit testing is likely sandboxed -- preventing you from directly reading envars and files from the host OS.
Let me know if this solves the issue!
@henrikschristensen can we close this or are you stille experiencing issues?