Skip to content

printf template function broken in v1.3.0 custom executors #895

@jeanschmitt

Description

@jeanschmitt

Hello,

Using printf template function in custom executors doesn't work since v1.3.0 update.

Here is a minimal reproductible example:

# lib/custom_executor.yaml
executor: custom_executor
steps:
  - type: exec
    script: echo '{{ .testvar }}'
    vars:
      out1:
        from: result.systemout
  - type: exec
    script: echo '{{ printf "%s" .testvar }}'
    vars:
      out2:
        from: result.systemout
output:
  out1: "{{ .out1 }}"
  out2: "{{ .out2 }}"
# suite.yaml
vars:
  testvar: "hello"
testcases:
  - name: direct
    steps:
      - type: exec
        script: echo '{{ printf "%s" .testvar }}'
        assertions:
          - result.systemout ShouldEqual hello
  - name: cust
    steps:
      - type: custom_executor
        assertions:
          - result.out1 ShouldEqual hello
          - result.out2 ShouldEqual hello
venom run --lib-dir=lib suite.yaml

In v1.2.0, the suite runs successfully.

In v1.3.0, we get the following error:

Testcase "cust", step #1-0: Assertion "result.out2 ShouldEqual hello" failed. expected: hello  got: %!s(<nil>) (suite.yaml:0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions