From fde2129002cc872cc2aeb94dc5aba181e48a307e Mon Sep 17 00:00:00 2001 From: Brett Buddin Date: Tue, 25 Aug 2020 17:32:36 -0400 Subject: [PATCH] fix(task/executor): Use correct name for last success time extern (#19435) * fix(task/executor): Use correct name for last success time extern. * chore(tasks/executor): Don't reuse this constant in the tests. Test the name. --- task/backend/executor/executor.go | 5 ++--- task/backend/executor/executor_test.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/task/backend/executor/executor.go b/task/backend/executor/executor.go index 941392773c..806c6b1dff 100644 --- a/task/backend/executor/executor.go +++ b/task/backend/executor/executor.go @@ -25,8 +25,7 @@ const ( maxPromises = 1000 defaultMaxWorkers = 100 - latestSuccessOption = "tasks.latestSuccessTime" - latestFailureOption = "tasks.latestFailureTime" + lastSuccessOption = "tasks.lastSuccessTime" ) var _ scheduler.Executor = (*Executor)(nil) @@ -90,7 +89,7 @@ func (ts CompilerBuilderTimestamps) Extern() *ast.File { if !ts.LatestSuccess.IsZero() { body = append(body, &ast.OptionStatement{ Assignment: &ast.VariableAssignment{ - ID: &ast.Identifier{Name: latestSuccessOption}, + ID: &ast.Identifier{Name: lastSuccessOption}, Init: &ast.DateTimeLiteral{ Value: ts.LatestSuccess, }, diff --git a/task/backend/executor/executor_test.go b/task/backend/executor/executor_test.go index 4b74d84187..9e719ef411 100644 --- a/task/backend/executor/executor_test.go +++ b/task/backend/executor/executor_test.go @@ -189,7 +189,7 @@ func TestTaskExecutor_QuerySuccessWithExternInjection(t *testing.T) { extern := &ast.File{ Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ - ID: &ast.Identifier{Name: latestSuccessOption}, + ID: &ast.Identifier{Name: "tasks.lastSuccessTime"}, Init: &ast.DateTimeLiteral{ Value: latestSuccess, },