Skip to content

Commit 3c4c901

Browse files
committed
Do not process test step commands
These should not be processed since any variable substitution should be handled by env. Also to note: This use of arg expansion was causing tests to fail, though we didn't see it due to some issues with CI infra. Signed-off-by: Brian Goff <[email protected]>
1 parent bc2a9e1 commit 3c4c901

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

load_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ tests: &tests
732732
starts_with: ${SOME_ARG}
733733
ends_with: ${SOME_ARG}
734734
steps:
735-
- command: ${SOME_ARG}
735+
- command: hello
736736
stdout: *check-output
737737
stderr: *check-output
738738
stdin: ${SOME_ARG}
@@ -844,7 +844,6 @@ targets:
844844
assert.Check(t, cmp.Equal(spec.Tests[0].Steps[0].Stderr.Contains[0], "test"))
845845
assert.Check(t, cmp.Equal(spec.Tests[0].Steps[0].Stderr.StartsWith, "test"))
846846
assert.Check(t, cmp.Equal(spec.Tests[0].Steps[0].Stderr.EndsWith, "test"))
847-
assert.Check(t, cmp.Equal(spec.Tests[0].Steps[0].Command, "test"))
848847

849848
assert.Check(t, cmp.Equal(spec.PackageConfig.Signer.Args["FOO"], "test"))
850849

@@ -873,7 +872,6 @@ targets:
873872
assert.Check(t, cmp.Equal(target.Tests[0].Steps[0].Stderr.Contains[0], "test"))
874873
assert.Check(t, cmp.Equal(target.Tests[0].Steps[0].Stderr.StartsWith, "test"))
875874
assert.Check(t, cmp.Equal(target.Tests[0].Steps[0].Stderr.EndsWith, "test"))
876-
assert.Check(t, cmp.Equal(target.Tests[0].Steps[0].Command, "test"))
877875

878876
assert.Check(t, cmp.Equal(target.Dependencies.ExtraRepos[0].Keys["img"].DockerImage.Cmd.Env["TEST"], "test"))
879877
assert.Check(t, cmp.Equal(target.Dependencies.ExtraRepos[0].Keys["git"].Git.URL, "https://test"))

test/azlinux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,7 @@ func testLinuxPackageTestsFail(ctx context.Context, t *testing.T, cfg testLinuxC
21362136
Command: "/bin/sh -c 'test -d /mount1'",
21372137
},
21382138
{
2139-
Command: `/bin/sh -c 'grep "some file" /mont1/some_file'`,
2139+
Command: `/bin/sh -c 'grep "some file" /mount1/some_file'`,
21402140
},
21412141
{
21422142
Command: "/bin/sh -c 'test -f /mount2'",

tests.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,6 @@ func (s *TestStep) processBuildArgs(lex *shell.Lex, args map[string]string, allo
187187
}
188188
s.Stderr = stderr
189189

190-
updated, err = expandArgs(lex, s.Command, args, allowArg)
191-
if err != nil {
192-
appendErr(errors.Wrap(err, "command"))
193-
}
194-
if updated != s.Command {
195-
s.Command = updated
196-
}
197-
198190
return goerrors.Join(errs...)
199191
}
200192

0 commit comments

Comments
 (0)