MCPcopy
hub / github.com/nektos/act / TestStepActionLocalPost

Function TestStepActionLocalPost

pkg/runner/step_action_local_test.go:105–296  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

103}
104
105func TestStepActionLocalPost(t *testing.T) {
106 table := []struct {
107 name string
108 stepModel *model.Step
109 actionModel *model.Action
110 initialStepResults map[string]*model.StepResult
111 err error
112 mocks struct {
113 env bool
114 exec bool
115 }
116 }{
117 {
118 name: "main-success",
119 stepModel: &model.Step{
120 ID: "step",
121 Uses: "./local/action",
122 },
123 actionModel: &model.Action{
124 Runs: model.ActionRuns{
125 Using: "node16",
126 Post: "post.js",
127 PostIf: "always()",
128 },
129 },
130 initialStepResults: map[string]*model.StepResult{
131 "step": {
132 Conclusion: model.StepStatusSuccess,
133 Outcome: model.StepStatusSuccess,
134 Outputs: map[string]string{},
135 },
136 },
137 mocks: struct {
138 env bool
139 exec bool
140 }{
141 env: true,
142 exec: true,
143 },
144 },
145 {
146 name: "main-failed",
147 stepModel: &model.Step{
148 ID: "step",
149 Uses: "./local/action",
150 },
151 actionModel: &model.Action{
152 Runs: model.ActionRuns{
153 Using: "node16",
154 Post: "post.js",
155 PostIf: "always()",
156 },
157 },
158 initialStepResults: map[string]*model.StepResult{
159 "step": {
160 Conclusion: model.StepStatusFailure,
161 Outcome: model.StepStatusFailure,
162 Outputs: map[string]string{},

Callers

nothing calls this directly

Calls 3

postMethod · 0.95
OnMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…