Add more steps context support (#887)
* feat: add more steps context support - Add step outcome - Remove step success in favour of conclusion * feat: add conclusion and outcome steps context tests Add corresponding tests and extend pkg/runner/expression.go vmSteps() to handle steps context conclusion and outcome iota as strings. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
@@ -54,10 +54,11 @@ func TestRunContext_EvalBool(t *testing.T) {
|
||||
},
|
||||
StepResults: map[string]*stepResult{
|
||||
"id1": {
|
||||
Conclusion: stepStatusSuccess,
|
||||
Outcome: stepStatusFailure,
|
||||
Outputs: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
Success: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -73,6 +74,10 @@ func TestRunContext_EvalBool(t *testing.T) {
|
||||
{in: "success()", out: true},
|
||||
{in: "cancelled()", out: false},
|
||||
{in: "always()", out: true},
|
||||
{in: "steps.id1.conclusion == 'success'", out: true},
|
||||
{in: "steps.id1.conclusion != 'success'", out: false},
|
||||
{in: "steps.id1.outcome == 'failure'", out: true},
|
||||
{in: "steps.id1.outcome != 'failure'", out: false},
|
||||
{in: "true", out: true},
|
||||
{in: "false", out: false},
|
||||
{in: "!true", wantErr: true},
|
||||
|
Reference in New Issue
Block a user