Fix integration test failures - support runtime expressions and fix validation#267
Merged
ricardozanini merged 5 commits intoJun 27, 2026
Merged
Conversation
…alidation
This commit fixes 11 failing integration test workflows by addressing three
distinct issues in the SDK:
## 1. PullPolicy Validation (9 workflows)
**Problem:** The `pullPolicy` field in Container had validation `oneof=ifNotPresent always never`
without `omitempty`, causing validation to fail when the field was omitted (empty string "").
**Fix:** Added `omitempty` to the validation tag:
```go
PullPolicy string `validate:"omitempty,oneof=ifNotPresent always never"`
```
**Affected workflows:**
- run-container.yaml
- run-container-stdin-and-arguments.yaml
- run-return-none.yaml
- run-return-code.yaml
- run-container-with-name.yaml
- run-return-all.yaml
- run-container-cleanup-eventually.yaml
- run-container-cleanup-always.yaml
- run-return-stderr.yaml
## 2. SetTask Runtime Expression Support (1 workflow)
**Problem:** The `Set` field was typed as `map[string]interface{}`, but the spec
allows runtime expressions like `${ $workflow.input[0] }`.
**Fix:** Changed Set field type to `*ObjectOrRuntimeExpr`:
```go
Set *ObjectOrRuntimeExpr `validate:"required,object_or_runtime_expr"`
```
Updated validator to handle both pointer and value types of ObjectOrRuntimeExpr.
**Affected workflow:** set-expression.yaml
## 3. HTTPArguments Headers/Query Runtime Expression Support (1 workflow)
**Problem:** The `headers` and `query` fields were typed as maps, but the spec
allows runtime expressions like `${.headers}`.
**Fix:** Changed field types to `*ObjectOrRuntimeExpr`:
```go
Headers *ObjectOrRuntimeExpr `validate:"omitempty,object_or_runtime_expr"`
Query *ObjectOrRuntimeExpr `validate:"omitempty,object_or_runtime_expr"`
```
**Affected workflow:** call-http-query-headers-expressions.yaml
## Results
✅ All 66 integration test workflows now validate successfully (was 55/66)
## Technical Details
- Updated `validateObjectOrRuntimeExpr` to handle both `*ObjectOrRuntimeExpr`
and `ObjectOrRuntimeExpr` value types
- Fixed all test files to use `NewObjectOrRuntimeExpr()` wrapper
- Removed unused import of `utils` package in task_runner_set.go
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
a4929d0 to
b40b0f7
Compare
Changes: - Removed 'continue-on-error: true' from integration tests step so that test failures will properly fail the CI build - Updated paths-ignore to allow integration-test.sh changes to trigger CI while still ignoring other hack/ directory changes This ensures integration tests are enforced in PRs and changes to the integration test script itself are validated. Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
- Remove string case from validateObjectOrRuntimeExpr to fix Input validation tests - Change int32 to int in SUM_Numbers test (gojq doesn't support int32) Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all 11 failing integration test workflows by addressing three distinct issues in the SDK.
Issues Fixed
1. PullPolicy Validation Error (9 workflows) ✅
Problem: The
pullPolicyfield validation was missingomitempty, causing validation failures when the field was omitted (empty string).Fix: Added
omitemptyto validation tag inmodel/task_run.go:Affected workflows:
2. SetTask Runtime Expression Support (1 workflow) ✅
Problem: The
Setfield was typed asmap[string]interface{}, preventing runtime expressions like${ $workflow.input[0] }from being parsed.Fix: Changed Set field type to
*ObjectOrRuntimeExprinmodel/task_set.go:Affected workflow: set-expression.yaml
3. HTTPArguments Headers/Query Runtime Expression Support (1 workflow) ✅
Problem: The
headersandqueryfields were typed as maps, preventing runtime expressions like${.headers}from being used.Fix: Changed field types to
*ObjectOrRuntimeExprinmodel/task_call.go:Affected workflow: call-http-query-headers-expressions.yaml
Technical Changes
Core Model Updates
model/task_run.go- Fixed PullPolicy validationmodel/task_set.go- Changed Set to ObjectOrRuntimeExprmodel/task_call.go- Changed Headers and Query to ObjectOrRuntimeExprmodel/validator.go- Enhanced validateObjectOrRuntimeExpr to handle both pointer and value typesImplementation Updates
impl/task_runner_set.go- Simplified to work with ObjectOrRuntimeExpr, removed unused utils importTest Updates
NewObjectOrRuntimeExpr()wrapperTest Results
Before:
After:
Verification
Run integration tests:
All 66 workflows from the serverlessworkflow specification now validate successfully.
🤖 Generated with Claude Code