Skip to content

Commit

Permalink
Add Java Node to new smoke_test layout
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonydahanne committed Sep 25, 2023
1 parent 6c18446 commit d192190
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 64 deletions.
60 changes: 0 additions & 60 deletions .github/workflows/test-pull-request-java-node.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -79,7 +80,7 @@ func testGradleNodeWithBuilder(builder string) func(*testing.T, spec.G, spec.S)

err = docker.Image.Remove.Execute(image.ID)
if err != nil {
Expect(err).To(MatchError("failed to remove docker image: exit status 1: Error: No such image:"))
Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error")))
} else {
Expect(err).ToNot(HaveOccurred())
}
Expand All @@ -89,8 +90,12 @@ func testGradleNodeWithBuilder(builder string) func(*testing.T, spec.G, spec.S)

context("app uses gradle and node", func() {
it("builds successfully", func() {
if strings.HasSuffix(builder, "tiny") {
return // this sample requires bash, does not run on tiny
}

var err error
source, err = occam.Source(filepath.Join(".", "gradle-node"))
source, err = occam.Source(filepath.Join("../"))
Expect(err).NotTo(HaveOccurred())

var logs fmt.Stringer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package java_node_test

import (
"flag"
"fmt"
"github.com/paketo-buildpacks/samples/tests"
"os"
"path/filepath"
"strings"
"testing"
"time"

Expand All @@ -15,6 +18,11 @@ import (
. "github.com/paketo-buildpacks/occam/matchers"
)

var builders tests.BuilderFlags

func init() {
flag.Var(&builders, "name", "the name a builder to test with")
}
func TestMavenNode(t *testing.T) {
Expect := NewWithT(t).Expect

Expand Down Expand Up @@ -71,7 +79,7 @@ func testMavenNodeWithBuilder(builder string) func(*testing.T, spec.G, spec.S) {

err = docker.Image.Remove.Execute(image.ID)
if err != nil {
Expect(err).To(MatchError("failed to remove docker image: exit status 1: Error: No such image:"))
Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error")))
} else {
Expect(err).ToNot(HaveOccurred())
}
Expand All @@ -81,8 +89,12 @@ func testMavenNodeWithBuilder(builder string) func(*testing.T, spec.G, spec.S) {

context("app uses maven and yarn", func() {
it("builds successfully", func() {
if strings.HasSuffix(builder, "tiny") {
return // this sample requires bash, does not run on tiny
}

var err error
source, err = occam.Source(filepath.Join(".", "maven-yarn"))
source, err = occam.Source(filepath.Join("../"))
Expect(err).NotTo(HaveOccurred())

var logs fmt.Stringer
Expand Down

0 comments on commit d192190

Please sign in to comment.