Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Fix schema integration test
Browse files Browse the repository at this point in the history
I was setting the path after the command constructor
but the constructor checks if the path to the command exists and sets a
flag to fail on Start when it cannot be found. So in this case if docker
isn't in your path, it will fail even though I set the full path to the
docker mixin on the next line.

The proper way to use exec.Command is to set the full path to the
command to call in the constructor and it cannot be changed later.
  • Loading branch information
carolynvs committed Jul 30, 2020
1 parent 4696209 commit 48f14f3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/schema_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ func TestSchema(t *testing.T) {
require.NoError(t, err, "failed to sabotage the schema.json")

output := &bytes.Buffer{}
cmd := exec.Command("helm", "schema")
cmd.Path = "../bin/mixins/helm/helm"
cmd := exec.Command("../bin/mixins/helm/helm", "schema")
cmd.Stdout = output
cmd.Stderr = output

Expand Down

0 comments on commit 48f14f3

Please sign in to comment.