1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

fix: task level vars are not ignored in requires (#1960)

Co-authored-by: MOKEKO <Anthurium.1605@gmail.com>
This commit is contained in:
Valentin Maerten
2024-12-30 19:11:27 +01:00
committed by GitHub
parent 8ce9bdc8c7
commit da40aabcc7
3 changed files with 13 additions and 1 deletions

View File

@@ -203,6 +203,9 @@ func TestRequires(t *testing.T) {
require.NoError(t, e.Setup())
require.ErrorContains(t, e.Run(context.Background(), &ast.Call{Task: "require-before-compile"}), "task: Task \"require-before-compile\" cancelled because it is missing required variables: MY_VAR")
buff.Reset()
require.NoError(t, e.Run(context.Background(), &ast.Call{Task: "var-defined-in-task"}))
buff.Reset()
}
func TestSpecialVars(t *testing.T) {
@@ -1671,6 +1674,7 @@ func TestIncludesInterpolation(t *testing.T) { // nolint:paralleltest // cannot
func TestIncludesWithExclude(t *testing.T) {
t.Parallel()
var buff bytes.Buffer
e := task.Executor{
Dir: "testdata/includes_with_excludes",