|
9 | 9 | "github.com/cloudfoundry/cf-acceptance-tests/helpers/random_name" |
10 | 10 | "github.com/cloudfoundry/cf-test-helpers/v2/cf" |
11 | 11 | "github.com/cloudfoundry/cf-test-helpers/v2/helpers" |
| 12 | + "github.com/cloudfoundry/cf-test-helpers/v2/workflowhelpers" |
12 | 13 |
|
13 | 14 | . "github.com/onsi/ginkgo/v2" |
14 | 15 | . "github.com/onsi/gomega" |
@@ -43,17 +44,41 @@ var _ = CNBDescribe("CloudNativeBuildpacks lifecycle", func() { |
43 | 44 | }) |
44 | 45 | }) |
45 | 46 |
|
46 | | - Describe("pushing Node.js application with CNB lifecycle and no buildpacks", func() { |
47 | | - It("fails", func() { |
48 | | - Skip("System buildpacks are supported in latest CAPI version") |
49 | | - push := cf.Cf("push", |
50 | | - appName, |
51 | | - "-p", assets.NewAssets().CNBNode, |
52 | | - "-f", filepath.Join(assets.NewAssets().CNBNode, "manifest.yml"), |
53 | | - ).Wait(Config.CfPushTimeoutDuration()) |
| 47 | + Describe("creating system CNB buildpacks", func() { |
| 48 | + var buildpackName string |
| 49 | + |
| 50 | + BeforeEach(func() { |
| 51 | + buildpackName = random_name.CATSRandomName("CNB-BUILDPACK") |
| 52 | + }) |
| 53 | + |
| 54 | + AfterEach(func() { |
| 55 | + workflowhelpers.AsUser(TestSetup.AdminUserContext(), Config.DefaultTimeoutDuration(), func() { |
| 56 | + Expect(cf.Cf("delete-buildpack", buildpackName, "-f").Wait(Config.CfPushTimeoutDuration())).To(Exit(0)) |
| 57 | + }) |
| 58 | + }) |
| 59 | + |
| 60 | + Describe("uploading a .cnb extension cnb", func() { |
| 61 | + It("makes the app reachable by its bound route", func() { |
| 62 | + workflowhelpers.AsUser(TestSetup.AdminUserContext(), Config.DefaultTimeoutDuration(), func() { |
| 63 | + Expect(cf.Cf("create-buildpack", |
| 64 | + buildpackName, |
| 65 | + assets.NewAssets().CNBNodeBuildpack, |
| 66 | + "1", |
| 67 | + "--lifecycle", "cnb", |
| 68 | + ).Wait(Config.CfPushTimeoutDuration())).To(Exit(0)) |
| 69 | + }) |
| 70 | + |
| 71 | + Expect(cf.Cf("push", |
| 72 | + appName, |
| 73 | + "-p", assets.NewAssets().CNBNode, |
| 74 | + "-b", buildpackName, |
| 75 | + "-f", filepath.Join(assets.NewAssets().CNBNode, "manifest.yml"), |
| 76 | + ).Wait(Config.CfPushTimeoutDuration())).To(Exit(0)) |
54 | 77 |
|
55 | | - Expect(push).To(Exit(1)) |
56 | | - Expect(combineOutput(push.Out, push.Err)).To(Say("Buildpack\\(s\\) must be specified when using Cloud Native Buildpacks")) |
| 78 | + Eventually(func() string { |
| 79 | + return helpers.CurlAppRoot(Config, appName) |
| 80 | + }).Should(ContainSubstring("Hello from a node app!")) |
| 81 | + }) |
57 | 82 | }) |
58 | 83 | }) |
59 | 84 | }) |
|
0 commit comments