Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,962 changes: 3,200 additions & 1,762 deletions api/v1/api.gen.go

Large diffs are not rendered by default.

729 changes: 716 additions & 13 deletions api/v1/api.yaml

Large diffs are not rendered by default.

35 changes: 33 additions & 2 deletions conformance/cli/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,39 @@ func TestStartOnlyKeepsReference(t *testing.T) {
dagu.ExpectFileContent("consume.out", "${steps.produce.outputs.value}\nmissing\n")
}

// TestStartOnlySetsOutput proves --output feeds a declared output to the
// selected step with no earlier run, through a strict step-output reference.
// TestStartOnlyOutputFrom proves --output-from feeds the declared outputs of
// one finished run to the selected step.
func TestStartOnlyOutputFrom(t *testing.T) {
t.Parallel()

dagu := harness.NewRunner(t)
env := sharedEnv(t)

source := dagu.RunWithEnv(env, "start", "--run-id=cli-start-output-from", "only_outputs.yaml")
source.ExpectExitCode(0)
dagu.WriteFile("consume.out", "")

result := dagu.RunWithEnv(env, "start", "--only=consume", "--output-from=produce=cli-start-output-from", "only_outputs.yaml")
result.ExpectExitCode(0)
// Only --outputs-from carries the work directory of the source run.
dagu.ExpectFileContent("consume.out", "from-source\nmissing\n")
}

// TestStartOnlyOutputFromMissingRun proves that a run that does not exist
// stops the command before any step runs.
func TestStartOnlyOutputFromMissingRun(t *testing.T) {
t.Parallel()

dagu := harness.NewRunner(t)
result := dagu.RunWithEnv(sharedEnv(t), "start", "--only=consume", "--output-from=produce=cli-start-no-such-run", "only_outputs.yaml")
result.ExpectNonZeroExitCode()
result.ExpectStderrContains("step produce cannot be reused from run cli-start-no-such-run")
dagu.ExpectNoFile("consume.out")
}

// TestStartOnlySetsOutput proves the deprecated --output still feeds a
// declared output to the selected step with no earlier run, through a strict
// step-output reference.
func TestStartOnlySetsOutput(t *testing.T) {
t.Parallel()

Expand Down
Loading