|
| 1 | +/* |
| 2 | +Copyright 2019 The Skaffold Authors |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package integration |
| 18 | + |
| 19 | +import ( |
| 20 | + "io/ioutil" |
| 21 | + "testing" |
| 22 | + |
| 23 | + "github.com/GoogleContainerTools/skaffold/integration/skaffold" |
| 24 | + "github.com/GoogleContainerTools/skaffold/testutil" |
| 25 | +) |
| 26 | + |
| 27 | +func TestCredits(t *testing.T) { |
| 28 | + if testing.Short() || RunOnGCP() { |
| 29 | + t.Skip("skipping kind integration test") |
| 30 | + } |
| 31 | + |
| 32 | + testutil.Run(t, "credits", func(t *testutil.T) { |
| 33 | + tmpDir := t.NewTempDir().Chdir() |
| 34 | + |
| 35 | + out, err := skaffold.Credits().RunWithCombinedOutput(t.T) |
| 36 | + t.CheckNoError(err) |
| 37 | + t.CheckContains("Successfully exported third party notices", string(out)) |
| 38 | + |
| 39 | + content, err := ioutil.ReadFile(tmpDir.Path("skaffold-credits/github.com/docker/docker/LICENSE")) |
| 40 | + t.CheckNoError(err) |
| 41 | + t.CheckContains("Apache License", string(content)) |
| 42 | + }) |
| 43 | +} |
0 commit comments