Skip to content

Commit

Permalink
adding rest of the buildpacks and using npm to start the app
Browse files Browse the repository at this point in the history
  • Loading branch information
pacostas committed Jan 25, 2024
1 parent 38093e8 commit f6a306f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ func TestAcceptance(t *testing.T) {
Execute(settings.Config.BuildPlan)
Expect(err).ToNot(HaveOccurred())

settings.Buildpacks.NodeEngine.Online, err = buildpackStore.Get.
Execute(settings.Config.NodeEngine)
Expect(err).ToNot(HaveOccurred())

settings.Buildpacks.NPMInstall.Online, err = buildpackStore.Get.
Execute(settings.Config.NPMInstall)
Expect(err).ToNot(HaveOccurred())

buildImageID, runImageID, builderConfigFilepath, builderImageID, err = generateBuilder(root)
Expect(err).NotTo(HaveOccurred())

Expand Down
3 changes: 2 additions & 1 deletion integration/testdata/nodejs_simple_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.0.1",
"description": "some app",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"author": "",
"license": "",
Expand Down
6 changes: 6 additions & 0 deletions integration/testdata/nodejs_simple_app/plan.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@

[requires.metadata]
launch = true

[[requires]]
name = "node_modules"

[requires.metadata]
launch = true
4 changes: 3 additions & 1 deletion nodejs_stack_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ func testNodejsStackIntegration(t *testing.T, context spec.G, it spec.S) {
settings.Extensions.UbiNodejsExtension.Online,
).
WithBuildpacks(
settings.Buildpacks.NodeEngine.Online,
settings.Buildpacks.NPMInstall.Online,
settings.Buildpacks.BuildPlan.Online,
).
WithBuilder(builderImageID).
Expand All @@ -98,7 +100,7 @@ func testNodejsStackIntegration(t *testing.T, context spec.G, it spec.S) {

container, err = docker.Container.Run.
WithPublish("8080").
WithCommand("node server.js").
WithCommand("npm start").
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Expand Down

0 comments on commit f6a306f

Please sign in to comment.