From 1a4bb5ba5e18cf04b9ab8c7d410443d814975673 Mon Sep 17 00:00:00 2001 From: Anthony Dahanne Date: Tue, 19 Sep 2023 15:10:44 +0000 Subject: [PATCH] test with akka --- .../workflows/test-pull-request-java-akka.yml | 29 +++++++++++++++++++ java/{ => akka/smoke_test}/akka_test.go | 14 +++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test-pull-request-java-akka.yml rename java/{ => akka/smoke_test}/akka_test.go (89%) diff --git a/.github/workflows/test-pull-request-java-akka.yml b/.github/workflows/test-pull-request-java-akka.yml new file mode 100644 index 00000000..e97c201b --- /dev/null +++ b/.github/workflows/test-pull-request-java-akka.yml @@ -0,0 +1,29 @@ +name: Test Pull Request (Akka) + +on: + merge_group: + pull_request: + branches: + - main + paths: + - java/akka/** + +jobs: + smoke: + name: Smoke Tests + 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: Test Java Samples + run: | + ./scripts/smoke.sh --suite java/akka/smoke_test \ + --builder paketobuildpacks/builder:full \ + --builder paketobuildpacks/builder:base \ + --builder paketobuildpacks/builder:tiny diff --git a/java/akka_test.go b/java/akka/smoke_test/akka_test.go similarity index 89% rename from java/akka_test.go rename to java/akka/smoke_test/akka_test.go index dc109f5d..936d8d99 100644 --- a/java/akka_test.go +++ b/java/akka/smoke_test/akka_test.go @@ -1,7 +1,9 @@ -package java_test +package akka_test import ( + "flag" "fmt" + "github.com/paketo-buildpacks/samples/tests" "os" "path/filepath" "strings" @@ -16,6 +18,12 @@ 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 TestAkka(t *testing.T) { Expect := NewWithT(t).Expect @@ -73,7 +81,7 @@ func testAkkaWithBuilder(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(ContainSubstring("failed to remove docker image: exit status 1: Error")) } else { Expect(err).ToNot(HaveOccurred()) } @@ -88,7 +96,7 @@ func testAkkaWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { } var err error - source, err = occam.Source(filepath.Join("../java", "akka")) + source, err = occam.Source(filepath.Join("../../", "akka")) Expect(err).NotTo(HaveOccurred()) var logs fmt.Stringer