(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestGetSpecialVarsRemote(t *testing.T) { |
| 14 | t.Parallel() |
| 15 | |
| 16 | uwd := t.TempDir() |
| 17 | uwdSlash := filepath.ToSlash(uwd) |
| 18 | localProj := filepath.Join(uwd, "proj") |
| 19 | localProjSlash := filepath.ToSlash(localProj) |
| 20 | localTaskfile := filepath.Join(localProj, "Taskfile.yml") |
| 21 | localTaskfileSlash := filepath.ToSlash(localTaskfile) |
| 22 | absTaskDir := filepath.Join(uwd, "opt", "work") |
| 23 | absTaskDirSlash := filepath.ToSlash(absTaskDir) |
| 24 | |
| 25 | tests := []struct { |
| 26 | name string |
| 27 | entrypoint string |
| 28 | compilerDir string |
| 29 | taskDir string |
| 30 | taskfileLocation string |
| 31 | wantRootTaskfile string |
| 32 | wantRootDir string |
| 33 | wantTaskfile string |
| 34 | wantTaskfileDir string |
| 35 | wantTaskDir string |
| 36 | }{ |
| 37 | { |
| 38 | name: "local entrypoint, local task", |
| 39 | entrypoint: localTaskfile, |
| 40 | compilerDir: localProj, |
| 41 | taskDir: "", |
| 42 | taskfileLocation: localTaskfile, |
| 43 | wantRootTaskfile: localTaskfileSlash, |
| 44 | wantRootDir: localProjSlash, |
| 45 | wantTaskfile: localTaskfileSlash, |
| 46 | wantTaskfileDir: localProjSlash, |
| 47 | wantTaskDir: localProjSlash, |
| 48 | }, |
| 49 | { |
| 50 | name: "https entrypoint, empty task.dir", |
| 51 | entrypoint: "https://taskfile.dev/Taskfile.yml", |
| 52 | compilerDir: "", |
| 53 | taskDir: "", |
| 54 | taskfileLocation: "https://taskfile.dev/Taskfile.yml", |
| 55 | wantRootTaskfile: "https://taskfile.dev/Taskfile.yml", |
| 56 | wantRootDir: "", |
| 57 | wantTaskfile: "https://taskfile.dev/Taskfile.yml", |
| 58 | wantTaskfileDir: "", |
| 59 | wantTaskDir: uwdSlash, |
| 60 | }, |
| 61 | { |
| 62 | name: "https entrypoint, relative task.dir", |
| 63 | entrypoint: "https://taskfile.dev/Taskfile.yml", |
| 64 | compilerDir: "", |
| 65 | taskDir: "subdir", |
| 66 | taskfileLocation: "https://taskfile.dev/Taskfile.yml", |
| 67 | wantRootTaskfile: "https://taskfile.dev/Taskfile.yml", |
| 68 | wantRootDir: "", |
| 69 | wantTaskfile: "https://taskfile.dev/Taskfile.yml", |
| 70 | wantTaskfileDir: "", |
nothing calls this directly
no test coverage detected
searching dependent graphs…