diff --git a/.github/workflows/test-pull-request-java-node.yml b/.github/workflows/test-pull-request-java-node.yml deleted file mode 100644 index 7b78f61d..00000000 --- a/.github/workflows/test-pull-request-java-node.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Test Pull Request (Java-Node) - -on: - merge_group: - pull_request: - branches: - - main - paths: - - 'java/java-node/**' - -jobs: - smoke: - name: Smoke Tests Java-Node - runs-on: ubuntu-latest - steps: - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: 1.18.x - - - name: Checkout - uses: actions/checkout@v4 - - - name: Cache local Gradle repository - uses: actions/cache@v3 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('java/**/*.gradle*', 'java/**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- - - - name: Cache local Maven repository - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository - ~/.m2/wrapper - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', 'java/**/maven-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: Setup Directories - run: | - #!/usr/bin/env bash - set -euo pipefail - - mkdir -p ~/.m2/repository - mkdir -p ~/.m2/repository/wrapper/dists - mkdir -p ~/.gradle/caches - mkdir -p ~/.gradle/wrapper/dists - chmod -R 775 ~/.m2 - chmod -R 775 ~/.gradle - - - name: Test Java-Node Samples - run: | - ./scripts/smoke.sh --suite java/java-node \ - --builder paketobuildpacks/builder:full \ - --builder paketobuildpacks/builder:base \ diff --git a/java/java-node/gradle_node_test.go b/java/java-node/gradle-node/smoke_test/gradle_node_test.go similarity index 92% rename from java/java-node/gradle_node_test.go rename to java/java-node/gradle-node/smoke_test/gradle_node_test.go index 280ab011..5f56a363 100644 --- a/java/java-node/gradle_node_test.go +++ b/java/java-node/gradle-node/smoke_test/gradle_node_test.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "testing" "time" @@ -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()) } @@ -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 diff --git a/java/java-node/maven_node_test.go b/java/java-node/maven-yarn/smoke_test/maven_node_test.go similarity index 88% rename from java/java-node/maven_node_test.go rename to java/java-node/maven-yarn/smoke_test/maven_node_test.go index a59c026c..a748897a 100644 --- a/java/java-node/maven_node_test.go +++ b/java/java-node/maven-yarn/smoke_test/maven_node_test.go @@ -1,9 +1,12 @@ package java_node_test import ( + "flag" "fmt" + "github.com/paketo-buildpacks/samples/tests" "os" "path/filepath" + "strings" "testing" "time" @@ -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 @@ -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()) } @@ -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