testkube icon indicating copy to clipboard operation
testkube copied to clipboard

Incorrect evaluation of test step condition

Open thradec opened this issue 4 months ago • 2 comments

Describe the bug

The test workflow step condition is incorrectly evaluated as skipped when the step contains definitions of artifacts.

To Reproduce

apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
  name: test1
spec:
  container:
    env:
      - name: TEST
        value: "true"
  steps:
    - condition: env.TEST
      shell: echo "test"

test1 works fine and its execution produce

Context:  (2.2.5)   Namespace: testkube
---------------------------------------
Test Workflow Execution:
Name:                 test1
Execution ID:         690cf0cd0722f9954ad13e2f
Execution name:       test1-1

Creating state... done
Initializing state... done
Configuring init process... skipped
Configuring toolkit... skipped
Configuring shell... skipped

• passed in 1.224s

• (1/1) Run shell command
test

• passed in 16ms

test workflow execution completed with success in 1.339845561s 🥇

but when the step contains definition for artifacts

apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
  name: test2
spec:
  container:
    env:
      - name: TEST
        value: "true"
  steps:
    - condition: env.TEST
      shell: echo "test"
      artifacts:
        paths:
          - "*.xml"

the step condition is evaluated as skipped

Context:  (2.2.5)   Namespace: testkube
---------------------------------------
Test Workflow Execution:
Name:                 test2
Execution ID:         690cf2780722f9954ad13e4a
Execution name:       test2-1

Creating state... done
Initializing state... done
Configuring init process... skipped
Configuring toolkit... skipped
Configuring shell... skipped

• passed in 1.624s

• (1/2) Run shell command
• skipped

• (2/2) Upload artifacts
• skipped

test workflow execution completed with success in 1.87274512s 🥇

Version / Cluster

testkube version: 2.1.166 (standalone agent) kubernetes version: eks 1.33

thradec avatar Nov 06 '25 19:11 thradec

thanks for reporting @thradec - let's see what copilot makes of this 🙏

olensmar avatar Nov 06 '25 20:11 olensmar

hey @thradec sounds like Copilot is stuck to fix this bug. we will need human being for investigation)

vsukhin avatar Nov 10 '25 10:11 vsukhin