Skip to content

Commit

Permalink
client: skip broken test and fix assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
schmichael committed Nov 19, 2020
1 parent 503e286 commit cc8280f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions client/allocrunner/taskrunner/template/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,9 @@ func TestTaskTemplateManager_Escapes(t *testing.T) {
Name string
Config func() *TaskTemplateManagerConfig

// Set to skip a test; remove once bugs are fixed
Skip bool

// Expected paths to be returned if Err is nil
SourcePath string
DestPath string
Expand Down Expand Up @@ -1578,8 +1581,9 @@ func TestTaskTemplateManager_Escapes(t *testing.T) {
},
//TODO: Fix this test. I *think* it should pass. The double
// joining of the task dir onto the destination seems like
// a bug.
// a bug. https://github.com/hashicorp/nomad/issues/9389
{
Skip: true,
Name: "RawExecOk",
Config: func() *TaskTemplateManagerConfig {
return &TaskTemplateManagerConfig{
Expand Down Expand Up @@ -1614,11 +1618,8 @@ func TestTaskTemplateManager_Escapes(t *testing.T) {
},
Err: sourceEscapesErr,
},
//TODO: Fix this test. I *think* it should fail instead of
// forcing it relative. The double joining of the task dir
// onto the destination seems like a bug.
{
Name: "RawExecDstEscapesErr",
Name: "RawExecDstAbsoluteOk",
Config: func() *TaskTemplateManagerConfig {
return &TaskTemplateManagerConfig{
ClientConfig: clientConf,
Expand All @@ -1627,18 +1628,22 @@ func TestTaskTemplateManager_Escapes(t *testing.T) {
Templates: []*structs.Template{
{
SourcePath: "${NOMAD_TASK_DIR}/src",
DestPath: "/etc/dst_escapes",
DestPath: "/etc/absolutely_relative",
},
},
}
},
Err: destEscapesErr,
SourcePath: filepath.Join(taskDir.Dir, "local/src"),
DestPath: filepath.Join(taskDir.Dir, "etc/absolutely_relative"),
},
}

for i := range cases {
tc := cases[i]
t.Run(tc.Name, func(t *testing.T) {
if tc.Skip {
t.Skip("FIXME: Skipping broken test")
}
config := tc.Config()
mapping, err := parseTemplateConfigs(config)
if tc.Err == nil {
Expand Down

0 comments on commit cc8280f

Please sign in to comment.