From a7f57b8c883c4fe3f7a441f7df2ff5785156188e Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Mon, 2 Oct 2023 15:35:18 -0400 Subject: [PATCH] Upgrade Spring Boot & Gradle Wrapper versions across the board (#615) * Upgrade Spring Boot & Gradle Wrapper versions across the board Signed-off-by: Daniel Mikusa * WIP: move to having a single test suite per application Signed-off-by: Daniel Mikusa * test with akka * Upgrade pack cli version for smoke tests * Make Java Smoke Test PR workflow generic * so that it can be used for every Java samples * Add Java native to new smoke_test layout * Add Java Node to new smoke_test layout * Make "test-all-samples" find java modules * Add failfast to embedded shell scripts * Adapt to new jammy builders names --------- Signed-off-by: Daniel Mikusa Co-authored-by: Anthony Dahanne --- ...public-static-main-native-image-maven.yml} | 13 +- .../java-quarkus-native-image-maven.yml | 27 + .../java-spring-boot-native-image-gradle.yml | 27 + .../java-spring-boot-native-image-maven.yml | 27 + .github/workflows/test-all-samples.yml | 74 +-- .../test-pull-request-java-native-image.yml | 61 -- .../workflows/test-pull-request-java-node.yml | 60 -- .github/workflows/test-pull-request-java.yml | 126 +++-- java/akka/smoke_test/akka_test.go | 124 +++++ java/application-insights/pom.xml | 2 +- .../smoke_test/application_insights_test.go | 120 ++++ java/aspectj/pom.xml | 2 +- java/aspectj/smoke_test/aspectj_test.go | 119 ++++ java/deps/smoke_test/deps_test.go | 125 +++++ java/dist-zip/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- java/dist-zip/smoke_test/dist_zip_test.go | 127 +++++ java/gradle/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- java/gradle/smoke_test/gradle_test.go | 122 ++++ java/jar/smoke_test/jar_test.go | 118 ++++ java/java-node/gradle-node/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../smoke_test/gradle_node_test.go | 136 +++++ java/java-node/maven-yarn/pom.xml | 2 +- .../smoke_test/maven_node_test.go} | 65 +-- java/java_test.go | 524 ------------------ java/kotlin/build.gradle.kts | 4 +- java/kotlin/gradle/wrapper/gradle-wrapper.jar | Bin 58910 -> 59536 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- java/kotlin/gradlew | 4 +- java/kotlin/gradlew.bat | 21 +- java/kotlin/smoke_test/kotlin_test.go | 122 ++++ java/leiningen/smoke_test/leiningen_test.go | 125 +++++ java/maven/pom.xml | 2 +- java/maven/smoke_test/maven_test.go | 120 ++++ java/native-image/java_native_image_test.go | 220 -------- .../.gitignore | 0 .../.mvn/wrapper/MavenWrapperDownloader.java | 0 .../.mvn/wrapper/maven-wrapper.jar | Bin .../.mvn/wrapper/maven-wrapper.properties | 0 .../mvnw | 0 .../pom.xml | 0 ...va_native_image_public_static_main_test.go | 106 ++++ .../src/main/java/io/paketo/App.java | 0 .../.gitignore | 0 .../.mvn/wrapper/MavenWrapperDownloader.java | 0 .../.mvn/wrapper/maven-wrapper.jar | Bin .../.mvn/wrapper/maven-wrapper.properties | 0 .../.s2i/environment | 0 .../README.md | 0 .../mvnw | 0 .../mvnw.cmd | 0 .../pom.xml | 0 .../java_native_image_quarkus_native_test.go | 115 ++++ .../getting/started/GreetingResource.java | 0 .../acme/getting/started/GreetingService.java | 0 .../resources/META-INF/resources/index.html | 0 .../src/main/resources/application.properties | 0 .../getting/started/GreetingResourceTest.java | 0 .../started/NativeGreetingResourceIT.java | 0 .../.gitignore | 0 .../README.md | 0 .../build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../gradlew | 0 .../gradlew.bat | 0 .../settings.gradle | 0 .../java_native_image_gradle_test.go | 112 ++++ .../java/io/paketo/demo/DemoApplication.java | 0 .../src/main/resources/application.properties | 0 .../io/paketo/demo/DemoApplicationTests.java | 0 .../.gitignore | 0 .../.mvn/wrapper/MavenWrapperDownloader.java | 0 .../.mvn/wrapper/maven-wrapper.jar | Bin .../.mvn/wrapper/maven-wrapper.properties | 0 .../README.md | 0 .../mvnw | 0 .../mvnw.cmd | 0 .../pom.xml | 0 .../java_native_image_maven_test.go | 113 ++++ .../java/io/paketo/demo/DemoApplication.java | 0 .../src/main/resources/application.properties | 0 .../io/paketo/demo/DemoApplicationTests.java | 0 java/opentelemetry/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../smoke_test/opentelemetry_test.go | 127 +++++ .../smoke_test/tools_build_test.go | 127 +++++ java/war/pom.xml | 2 +- java/war/smoke_test/war_test.go | 117 ++++ 91 files changed, 2400 insertions(+), 1068 deletions(-) rename .github/workflows/{java-native-image.yml => java-public-static-main-native-image-maven.yml} (52%) create mode 100644 .github/workflows/java-quarkus-native-image-maven.yml create mode 100644 .github/workflows/java-spring-boot-native-image-gradle.yml create mode 100644 .github/workflows/java-spring-boot-native-image-maven.yml create mode 100644 java/akka/smoke_test/akka_test.go create mode 100644 java/application-insights/smoke_test/application_insights_test.go create mode 100644 java/aspectj/smoke_test/aspectj_test.go create mode 100644 java/deps/smoke_test/deps_test.go create mode 100644 java/dist-zip/smoke_test/dist_zip_test.go create mode 100644 java/gradle/smoke_test/gradle_test.go create mode 100644 java/jar/smoke_test/jar_test.go create mode 100644 java/java-node/gradle-node/smoke_test/gradle_node_test.go rename java/java-node/{java_node_test.go => maven-yarn/smoke_test/maven_node_test.go} (59%) delete mode 100644 java/java_test.go create mode 100644 java/kotlin/smoke_test/kotlin_test.go create mode 100644 java/leiningen/smoke_test/leiningen_test.go create mode 100644 java/maven/smoke_test/maven_test.go delete mode 100644 java/native-image/java_native_image_test.go rename java/native-image/{public-static-main => public-static-main-native-image-maven}/.gitignore (100%) rename java/native-image/{public-static-main => public-static-main-native-image-maven}/.mvn/wrapper/MavenWrapperDownloader.java (100%) rename java/native-image/{java-native-image-sample => public-static-main-native-image-maven}/.mvn/wrapper/maven-wrapper.jar (100%) rename java/native-image/{java-native-image-sample => public-static-main-native-image-maven}/.mvn/wrapper/maven-wrapper.properties (100%) rename java/native-image/{public-static-main => public-static-main-native-image-maven}/mvnw (100%) rename java/native-image/{public-static-main => public-static-main-native-image-maven}/pom.xml (100%) create mode 100644 java/native-image/public-static-main-native-image-maven/smoke_test/java_native_image_public_static_main_test.go rename java/native-image/{public-static-main => public-static-main-native-image-maven}/src/main/java/io/paketo/App.java (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/.gitignore (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/.mvn/wrapper/MavenWrapperDownloader.java (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/.mvn/wrapper/maven-wrapper.jar (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/.mvn/wrapper/maven-wrapper.properties (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/.s2i/environment (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/README.md (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/mvnw (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/mvnw.cmd (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/pom.xml (100%) create mode 100644 java/native-image/quarkus-native-image-maven/smoke_test/java_native_image_quarkus_native_test.go rename java/native-image/{quarkus-native => quarkus-native-image-maven}/src/main/java/org/acme/getting/started/GreetingResource.java (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/src/main/java/org/acme/getting/started/GreetingService.java (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/src/main/resources/META-INF/resources/index.html (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/src/main/resources/application.properties (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/src/test/java/org/acme/getting/started/GreetingResourceTest.java (100%) rename java/native-image/{quarkus-native => quarkus-native-image-maven}/src/test/java/org/acme/getting/started/NativeGreetingResourceIT.java (100%) rename java/native-image/{java-native-image-sample-gradle => spring-boot-native-image-gradle}/.gitignore (100%) rename java/native-image/{java-native-image-sample-gradle => spring-boot-native-image-gradle}/README.md (100%) rename java/native-image/{java-native-image-sample-gradle => spring-boot-native-image-gradle}/build.gradle (87%) rename java/native-image/{java-native-image-sample-gradle => spring-boot-native-image-gradle}/gradle/wrapper/gradle-wrapper.jar (100%) rename java/native-image/{java-native-image-sample-gradle => spring-boot-native-image-gradle}/gradle/wrapper/gradle-wrapper.properties (92%) rename java/native-image/{java-native-image-sample-gradle => spring-boot-native-image-gradle}/gradlew (100%) rename java/native-image/{java-native-image-sample-gradle => spring-boot-native-image-gradle}/gradlew.bat (100%) rename java/native-image/{java-native-image-sample-gradle => spring-boot-native-image-gradle}/settings.gradle (100%) create mode 100644 java/native-image/spring-boot-native-image-gradle/smoke_test/java_native_image_gradle_test.go rename java/native-image/{java-native-image-sample-gradle => spring-boot-native-image-gradle}/src/main/java/io/paketo/demo/DemoApplication.java (100%) rename java/native-image/{java-native-image-sample-gradle => spring-boot-native-image-gradle}/src/main/resources/application.properties (100%) rename java/native-image/{java-native-image-sample-gradle => spring-boot-native-image-gradle}/src/test/java/io/paketo/demo/DemoApplicationTests.java (100%) rename java/native-image/{java-native-image-sample => spring-boot-native-image-maven}/.gitignore (100%) rename java/native-image/{java-native-image-sample => spring-boot-native-image-maven}/.mvn/wrapper/MavenWrapperDownloader.java (100%) rename java/native-image/{public-static-main => spring-boot-native-image-maven}/.mvn/wrapper/maven-wrapper.jar (100%) rename java/native-image/{public-static-main => spring-boot-native-image-maven}/.mvn/wrapper/maven-wrapper.properties (100%) rename java/native-image/{java-native-image-sample => spring-boot-native-image-maven}/README.md (100%) rename java/native-image/{java-native-image-sample => spring-boot-native-image-maven}/mvnw (100%) rename java/native-image/{java-native-image-sample => spring-boot-native-image-maven}/mvnw.cmd (100%) rename java/native-image/{java-native-image-sample => spring-boot-native-image-maven}/pom.xml (100%) create mode 100644 java/native-image/spring-boot-native-image-maven/smoke_test/java_native_image_maven_test.go rename java/native-image/{java-native-image-sample => spring-boot-native-image-maven}/src/main/java/io/paketo/demo/DemoApplication.java (100%) rename java/native-image/{java-native-image-sample => spring-boot-native-image-maven}/src/main/resources/application.properties (100%) rename java/native-image/{java-native-image-sample => spring-boot-native-image-maven}/src/test/java/io/paketo/demo/DemoApplicationTests.java (100%) create mode 100644 java/opentelemetry/smoke_test/opentelemetry_test.go create mode 100644 java/tools-build/smoke_test/tools_build_test.go create mode 100644 java/war/smoke_test/war_test.go diff --git a/.github/workflows/java-native-image.yml b/.github/workflows/java-public-static-main-native-image-maven.yml similarity index 52% rename from .github/workflows/java-native-image.yml rename to .github/workflows/java-public-static-main-native-image-maven.yml index a05186a3..617147d3 100644 --- a/.github/workflows/java-native-image.yml +++ b/.github/workflows/java-public-static-main-native-image-maven.yml @@ -1,14 +1,14 @@ -name: native-image +name: java-public-static-main-native-image-maven "on": merge_group: pull_request: paths: - - java/native-image/java-native-image-sample/** + - java/native-image/public-static-main-native-image-maven/** push: branches: - main paths: - - java/native-image/java-native-image-sample/** + - java/native-image/public-static-main-native-image-maven/** jobs: test: @@ -23,10 +23,5 @@ jobs: with: java-version: ${{ matrix.java }} distribution: 'zulu' - - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('java/native-image/java-native-image-sample/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - run: ./mvnw -B package -Djava.version=${{ matrix.java }} - working-directory: java/native-image/java-native-image-sample + working-directory: java/native-image/public-static-main-native-image-maven diff --git a/.github/workflows/java-quarkus-native-image-maven.yml b/.github/workflows/java-quarkus-native-image-maven.yml new file mode 100644 index 00000000..800ba68a --- /dev/null +++ b/.github/workflows/java-quarkus-native-image-maven.yml @@ -0,0 +1,27 @@ +name: java-quarkus-native-image-maven +"on": + merge_group: + pull_request: + paths: + - java/native-image/quarkus-native-image-maven/** + push: + branches: + - main + paths: + - java/native-image/quarkus-native-image-maven/** + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + java: [17] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java }} + distribution: 'zulu' + - run: ./mvnw -B package -Djava.version=${{ matrix.java }} + working-directory: java/native-image/quarkus-native-image-maven diff --git a/.github/workflows/java-spring-boot-native-image-gradle.yml b/.github/workflows/java-spring-boot-native-image-gradle.yml new file mode 100644 index 00000000..4a8769c2 --- /dev/null +++ b/.github/workflows/java-spring-boot-native-image-gradle.yml @@ -0,0 +1,27 @@ +name: java-spring-boot-native-image-gradle +"on": + merge_group: + pull_request: + paths: + - java/native-image/spring-boot-native-image-gradle/** + push: + branches: + - main + paths: + - java/native-image/spring-boot-native-image-gradle/** + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + java: [17] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java }} + distribution: 'zulu' + - run: ./gradlew build + working-directory: java/native-image/spring-boot-native-image-gradle diff --git a/.github/workflows/java-spring-boot-native-image-maven.yml b/.github/workflows/java-spring-boot-native-image-maven.yml new file mode 100644 index 00000000..f462b233 --- /dev/null +++ b/.github/workflows/java-spring-boot-native-image-maven.yml @@ -0,0 +1,27 @@ +name: java-spring-boot-native-image-maven +"on": + merge_group: + pull_request: + paths: + - java/native-image/spring-boot-native-image-maven/** + push: + branches: + - main + paths: + - java/native-image/spring-boot-native-image-maven/** + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + java: [17] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java }} + distribution: 'zulu' + - run: ./mvnw -B package -Djava.version=${{ matrix.java }} + working-directory: java/native-image/spring-boot-native-image-maven diff --git a/.github/workflows/test-all-samples.yml b/.github/workflows/test-all-samples.yml index 51cd65d8..61b69228 100644 --- a/.github/workflows/test-all-samples.yml +++ b/.github/workflows/test-all-samples.yml @@ -12,70 +12,46 @@ on: - 'scripts/.util/tools.json' jobs: + prepare: + name: Prepare + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.paths.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Discover changed paths + id: paths + run: | + set -eo pipefail + all_java_smoke_test_paths=$( find ./java -iname "smoke_test" | jq --raw-input | jq --slurp --compact-output ) + all_other_smoke_test_paths='["ca-certificates","dotnet-core","git","go","nodejs","php","procfile","python","ruby","web-servers"]' + all_paths=$( echo -e "$all_java_smoke_test_paths\n$all_other_smoke_test_paths" | jq -s 'add' -c ) + + echo "These are the Java projects we'll run smoke tests against: $all_java_smoke_test_paths" >> $GITHUB_STEP_SUMMARY + echo "These are the other folders we'll run smoke tests against: : $all_other_smoke_test_paths" >> $GITHUB_STEP_SUMMARY + echo "These are all the smoke test locations: $all_paths" >> $GITHUB_STEP_SUMMARY + echo "matrix={\"suite\":$all_paths}" >> $GITHUB_OUTPUT + echo "This is how the matrix will look like: $(cat $GITHUB_OUTPUT)" + smoke: + needs: prepare name: Smoke Tests runs-on: ubuntu-latest strategy: fail-fast: false max-parallel: 3 - matrix: - suite: - - 'ca-certificates' - - 'dotnet-core' - - 'git' - - 'go' - - 'java' - - 'nodejs' - - 'php' - - 'procfile' - - 'python' - - 'ruby' - - 'web-servers' + matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} steps: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: 1.18.x + go-version: 1.20.x - name: Checkout uses: actions/checkout@v4 - - name: Cache local Gradle repository - if: ${{ matrix.suite == 'java' }} - 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 - if: ${{ matrix.suite == 'java' }} - 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 - if: ${{ matrix.suite == 'java' }} - 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 ${{ matrix.suite }} run: | ./scripts/smoke.sh --builder paketobuildpacks/builder-jammy-full:latest --suite ${{ matrix.suite }} diff --git a/.github/workflows/test-pull-request-java-native-image.yml b/.github/workflows/test-pull-request-java-native-image.yml index 3356dfd2..e69de29b 100644 --- a/.github/workflows/test-pull-request-java-native-image.yml +++ b/.github/workflows/test-pull-request-java-native-image.yml @@ -1,61 +0,0 @@ -name: Test Pull Request (Java Native Image) - -on: - merge_group: - pull_request: - branches: - - main - paths: - - 'java/native-image/**' - -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: 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 Native Image Samples - run: | - ./scripts/smoke.sh --suite java/native-image \ - --builder paketobuildpacks/builder-jammy-full:latest \ - --builder paketobuildpacks/builder-jammy-base:latest \ - --builder paketobuildpacks/builder-jammy-tiny:latest diff --git a/.github/workflows/test-pull-request-java-node.yml b/.github/workflows/test-pull-request-java-node.yml index 3e0b6f87..e69de29b 100644 --- a/.github/workflows/test-pull-request-java-node.yml +++ b/.github/workflows/test-pull-request-java-node.yml @@ -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-jammy-full:latest \ - --builder paketobuildpacks/builder-jammy-base:latest \ diff --git a/.github/workflows/test-pull-request-java.yml b/.github/workflows/test-pull-request-java.yml index 74dd0ab2..b2597e8a 100644 --- a/.github/workflows/test-pull-request-java.yml +++ b/.github/workflows/test-pull-request-java.yml @@ -1,63 +1,87 @@ -name: Test Pull Request (Java) +name: Smoke Test Pull Request (Java) on: merge_group: pull_request: branches: - - main + - main paths: - - 'java/**' - - '!java/native-image/**' - - '!java/java-node/**' + - 'java/**' jobs: + prepare: + name: Prepare + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.paths.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Discover changed paths + id: paths + run: | + set -eo pipefail + # 1st step: we get the list of files changed between the tip of this PR branch and main + # Since we're only interested in the folders containing those files, we get them, sort them alphabetically (`sort`), de duplicate them (`uniq`) and filter out dot folders (.github for example) + # we end up with, for example, changed_java_folders="java/akka/smoke_test\njava/kotlin/gradle/wrapper\njava/application-insights" + changed_java_folders=$( git diff --name-only --merge-base origin/$GITHUB_BASE_REF $GITHUB_SHA | xargs -n 1 dirname | sort -k 2 | uniq | grep -v "^\." ) + + # 2nd step: we only want to keep the folders that contain a `smoke_test` subfolder -> those contain the tests we can run + # To do that, we loop through all the changed_java_folders and test (`-s`) for a sub folder named `smoke_test`; if there's none, we go to the parent directory (`dirname`) + # eventually, we'll find a `smoke_test` folder and add it to `smoke_test_folders`; if not, we move on to the next changed_java_folders entry (until the `.` folder in which case we give up) + + smoke_test_folders="" + while read -r changed_folder + do + echo "working on $changed_folder" + smoke_test="" + current_folder=$changed_folder + while [ -z "$smoke_test" ] && [ "$current_folder" != "." ] + do + echo "--smoke_test is $smoke_test" + echo "--current_folder is $current_folder" + if [[ -s $current_folder/smoke_test ]]; then + smoke_test="$current_folder/smoke_test" + else + current_folder=$(dirname $current_folder) + fi + done + if [ "$current_folder" != "." ]; then + smoke_test_folders="$smoke_test_folders\"$smoke_test\"\n" + fi + done <<<"$changed_java_folders" + + # Once the smoke_test_folders are all found, we de duplicate them (`uniq`), remove extra empty lines (`\S`), and format them into a string + # we end up with, for example, smoke_test_folders='"java/akka/smoke_test","java/kotlin/smoke_test","java/application-insights/smoke_test"' + # see: https://stackoverflow.com/a/8721550/24069 for usage of paste + smoke_test_folders=$( echo -e $smoke_test_folders | uniq | grep "\S" | paste -s -d, -) + + echo "These are the Java folders where we found changes for this PR : $changed_java_folders" >> $GITHUB_STEP_SUMMARY + echo "These are the Java folders where we found changes AND the presence of smoke tests for this PR : $smoke_test_folders" >> $GITHUB_STEP_SUMMARY + echo "matrix={\"java_sample_folder\":[$smoke_test_folders]}" >> $GITHUB_OUTPUT + echo "This is how the matrix will look like: $(cat $GITHUB_OUTPUT)" + smoke: + needs: prepare name: Smoke Tests runs-on: ubuntu-latest + strategy: + matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} + 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 Samples - run: | - ./scripts/smoke.sh --suite java \ - --builder paketobuildpacks/builder-jammy-full:latest \ - --builder paketobuildpacks/builder-jammy-base:latest \ - --builder paketobuildpacks/builder-jammy-tiny:latest + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: 1.20.x + + - name: Checkout + uses: actions/checkout@v4 + + - name: Smoke Test Java samples + run: | + echo "About to run the smoke test script against this suite folder: ${{ matrix.java_sample_folder }}/smoke_test" + ./scripts/smoke.sh --suite ${{ matrix.java_sample_folder }} \ + --builder paketobuildpacks/builder-jammy-base:latest \ + --builder paketobuildpacks/builder-jammy-tiny:latest diff --git a/java/akka/smoke_test/akka_test.go b/java/akka/smoke_test/akka_test.go new file mode 100644 index 00000000..27b4d21d --- /dev/null +++ b/java/akka/smoke_test/akka_test.go @@ -0,0 +1,124 @@ +package akka_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "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 + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - Akka", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Akka with %s builder", builder), testAkkaWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testAkkaWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses akka", func() { + it("builds successfully", func() { + if strings.Contains(builder, "tiny") { + return // this sample requires bash, does not run on tiny + } + + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for SBT"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for DistZip"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(BeAvailable()) + }) + }) + }) + } +} diff --git a/java/application-insights/pom.xml b/java/application-insights/pom.xml index 47f600b0..aee5668e 100644 --- a/java/application-insights/pom.xml +++ b/java/application-insights/pom.xml @@ -4,7 +4,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.14 + 2.7.15 io.paketo diff --git a/java/application-insights/smoke_test/application_insights_test.go b/java/application-insights/smoke_test/application_insights_test.go new file mode 100644 index 00000000..0b99de3f --- /dev/null +++ b/java/application-insights/smoke_test/application_insights_test.go @@ -0,0 +1,120 @@ +package application_insights_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} + +func TestApplicationInsights(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - Application Insights", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Application Insights with %s builder", builder), testApplicationInsightsWithBuilders(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testApplicationInsightsWithBuilders(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses application insights", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + }) + }) + }) + } +} diff --git a/java/aspectj/pom.xml b/java/aspectj/pom.xml index 51a7808c..8c16392d 100644 --- a/java/aspectj/pom.xml +++ b/java/aspectj/pom.xml @@ -4,7 +4,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.14 + 2.7.15 io.paketo diff --git a/java/aspectj/smoke_test/aspectj_test.go b/java/aspectj/smoke_test/aspectj_test.go new file mode 100644 index 00000000..5f5a8813 --- /dev/null +++ b/java/aspectj/smoke_test/aspectj_test.go @@ -0,0 +1,119 @@ +package aspectj_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestAspectJ(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - AspectJ", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("AspectJ with %s builder", builder), testAspectJWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testAspectJWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses aspectj", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + }) + }) + }) + } +} diff --git a/java/deps/smoke_test/deps_test.go b/java/deps/smoke_test/deps_test.go new file mode 100644 index 00000000..46748d1b --- /dev/null +++ b/java/deps/smoke_test/deps_test.go @@ -0,0 +1,125 @@ +package deps_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestDeps(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - Deps", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Deps with %s builder", builder), testDepsWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testDepsWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses clojure tools with deps", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithEnv(map[string]string{ + "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M", + }). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Clojure Tools"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + WithPublishAll(). + WithTTY(). + WithEnv(map[string]string{ + "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M"}). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("Hello World!")).OnPort(8080)) + }) + }) + }) + } +} diff --git a/java/dist-zip/build.gradle b/java/dist-zip/build.gradle index 22abc8db..e25e160f 100644 --- a/java/dist-zip/build.gradle +++ b/java/dist-zip/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' - id 'org.springframework.boot' version '3.1.1' - id 'io.spring.dependency-management' version '1.1.2' + id 'org.springframework.boot' version '3.1.3' + id 'io.spring.dependency-management' version '1.1.3' id 'application' } diff --git a/java/dist-zip/gradle/wrapper/gradle-wrapper.properties b/java/dist-zip/gradle/wrapper/gradle-wrapper.properties index f398c33c..4e86b927 100644 --- a/java/dist-zip/gradle/wrapper/gradle-wrapper.properties +++ b/java/dist-zip/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java/dist-zip/smoke_test/dist_zip_test.go b/java/dist-zip/smoke_test/dist_zip_test.go new file mode 100644 index 00000000..8c1a46c3 --- /dev/null +++ b/java/dist-zip/smoke_test/dist_zip_test.go @@ -0,0 +1,127 @@ +package dist_zip_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestDistZip(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - Dist Zip", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Dist Zip with %s builder", builder), testDistZipWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testDistZipWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses dist zip", func() { + it("builds successfully", func() { + if strings.Contains(builder, "tiny") { + return // this sample requires bash, does not run on tiny + } + + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithEnv(map[string]string{ + "BP_JVM_VERSION": "17", + "BP_GRADLE_BUILD_ARGUMENTS": "--no-daemon -x test bootDistZip", + "BP_GRADLE_BUILT_ARTIFACT": "build/distributions/*.zip"}). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for DistZip"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + }) + }) + }) + } +} diff --git a/java/gradle/build.gradle b/java/gradle/build.gradle index 299fadc7..88413502 100644 --- a/java/gradle/build.gradle +++ b/java/gradle/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' - id 'org.springframework.boot' version '3.1.2' - id 'io.spring.dependency-management' version '1.1.2' + id 'org.springframework.boot' version '3.1.3' + id 'io.spring.dependency-management' version '1.1.3' } group = 'io.paketo' diff --git a/java/gradle/gradle/wrapper/gradle-wrapper.properties b/java/gradle/gradle/wrapper/gradle-wrapper.properties index f398c33c..4e86b927 100644 --- a/java/gradle/gradle/wrapper/gradle-wrapper.properties +++ b/java/gradle/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java/gradle/smoke_test/gradle_test.go b/java/gradle/smoke_test/gradle_test.go new file mode 100644 index 00000000..34e21f3a --- /dev/null +++ b/java/gradle/smoke_test/gradle_test.go @@ -0,0 +1,122 @@ +package gradle_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestGradle(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - Gradle", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Gradle with %s builder", builder), testGradleWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testGradleWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses gradle", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithEnv(map[string]string{ + "BP_JVM_VERSION": "17", + "BP_GRADLE_BUILT_ARTIFACT": "build/libs/*-SNAPSHOT.jar", + }). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + }) + }) + }) + } +} diff --git a/java/jar/smoke_test/jar_test.go b/java/jar/smoke_test/jar_test.go new file mode 100644 index 00000000..3a53ba89 --- /dev/null +++ b/java/jar/smoke_test/jar_test.go @@ -0,0 +1,118 @@ +package jar_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestJar(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - JAR", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("JAR with %s builder", builder), testJarWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testJarWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses jar", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithBuilder(builder). + WithEnv(map[string]string{"BP_JVM_VERSION": "17"}). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + }) + }) + }) + } +} diff --git a/java/java-node/gradle-node/build.gradle b/java/java-node/gradle-node/build.gradle index 65471dfd..3e772179 100644 --- a/java/java-node/gradle-node/build.gradle +++ b/java/java-node/gradle-node/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' - id 'org.springframework.boot' version '3.0.5' - id 'io.spring.dependency-management' version '1.1.0' + id 'org.springframework.boot' version '3.0.10' + id 'io.spring.dependency-management' version '1.1.3' } group = 'io.paketo' diff --git a/java/java-node/gradle-node/gradle/wrapper/gradle-wrapper.properties b/java/java-node/gradle-node/gradle/wrapper/gradle-wrapper.properties index f398c33c..4e86b927 100644 --- a/java/java-node/gradle-node/gradle/wrapper/gradle-wrapper.properties +++ b/java/java-node/gradle-node/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java/java-node/gradle-node/smoke_test/gradle_node_test.go b/java/java-node/gradle-node/smoke_test/gradle_node_test.go new file mode 100644 index 00000000..b5822ccc --- /dev/null +++ b/java/java-node/gradle-node/smoke_test/gradle_node_test.go @@ -0,0 +1,136 @@ +package java_node_test + +import ( + "flag" + "fmt" + "os" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/paketo-buildpacks/samples/tests" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} + +func TestGradleNode(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - Gradle & Node", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Gradle Node with %s builder", builder), testGradleNodeWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testGradleNodeWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses gradle and node", func() { + it("builds successfully", func() { + if strings.Contains(builder, "tiny") { + return // this sample requires bash, does not run on tiny + } + + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithBuilder(builder). + WithGID("123"). + WithEnv(map[string]string{ + "BP_JVM_VERSION": "17", + "BP_JAVA_INSTALL_NODE": "true", + "BP_NODE_PROJECT_PATH": "frontend"}). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Node Engine"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + Eventually(container). + Should( + Serve(MatchRegexp("")). + OnPort(8080). + WithEndpoint("/")) + + }) + }) + }) + } +} diff --git a/java/java-node/maven-yarn/pom.xml b/java/java-node/maven-yarn/pom.xml index bf59b3ef..9b5fde02 100644 --- a/java/java-node/maven-yarn/pom.xml +++ b/java/java-node/maven-yarn/pom.xml @@ -4,7 +4,7 @@ org.springframework.boot spring-boot-starter-parent - 3.0.5 + 3.0.10 io.paketo diff --git a/java/java-node/java_node_test.go b/java/java-node/maven-yarn/smoke_test/maven_node_test.go similarity index 59% rename from java/java-node/java_node_test.go rename to java/java-node/maven-yarn/smoke_test/maven_node_test.go index 72721413..b5bd78bd 100644 --- a/java/java-node/java_node_test.go +++ b/java/java-node/maven-yarn/smoke_test/maven_node_test.go @@ -1,15 +1,16 @@ -package java_test +package java_node_test import ( "flag" "fmt" + "github.com/paketo-buildpacks/samples/tests" "os" "path/filepath" + "strings" "testing" "time" "github.com/paketo-buildpacks/occam" - "github.com/paketo-buildpacks/samples/tests" "github.com/sclevine/spec" "github.com/sclevine/spec/report" @@ -22,22 +23,21 @@ var builders tests.BuilderFlags func init() { flag.Var(&builders, "name", "the name a builder to test with") } - -func TestJava(t *testing.T) { +func TestMavenNode(t *testing.T) { Expect := NewWithT(t).Expect Expect(len(builders)).NotTo(Equal(0)) SetDefaultEventuallyTimeout(60 * time.Second) - suite := spec.New("Java", spec.Parallel(), spec.Report(report.Terminal{})) + suite := spec.New("Java - Maven & Node", spec.Parallel(), spec.Report(report.Terminal{})) for _, builder := range builders { - suite(fmt.Sprintf("Java with %s builder", builder), testJavaWithBuilder(builder), spec.Sequential()) + suite(fmt.Sprintf("Maven Node with %s builder", builder), testMavenNodeWithBuilder(builder), spec.Sequential()) } suite.Run(t) } -func testJavaWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { +func testMavenNodeWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { return func(t *testing.T, context spec.G, it spec.S) { var ( Expect = NewWithT(t).Expect @@ -45,7 +45,6 @@ func testJavaWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { pack occam.Pack docker occam.Docker - home string = os.Getenv("HOME") ) it.Before(func() { @@ -80,7 +79,7 @@ func testJavaWithBuilder(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()) } @@ -90,15 +89,18 @@ func testJavaWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { context("app uses maven and yarn", func() { it("builds successfully", func() { + if strings.Contains(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 image, logs, err = pack.Build. WithPullPolicy("never"). WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). WithGID("123"). WithEnv(map[string]string{ "BP_JVM_VERSION": "17", @@ -129,47 +131,6 @@ func testJavaWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { }) }) - - context("app uses gradle and node", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join(".", "gradle-node")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.gradle:/home/cnb/.gradle:rw", home)). - WithGID("123"). - WithEnv(map[string]string{ - "BP_JVM_VERSION": "17", - "BP_JAVA_INSTALL_NODE": "true", - "BP_NODE_PROJECT_PATH": "frontend"}). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Node Engine"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - Eventually(container). - Should( - Serve(MatchRegexp("")). - OnPort(8080). - WithEndpoint("/")) - - }) - }) }) } } diff --git a/java/java_test.go b/java/java_test.go deleted file mode 100644 index b89a467e..00000000 --- a/java/java_test.go +++ /dev/null @@ -1,524 +0,0 @@ -package java_test - -import ( - "flag" - "fmt" - "os" - "path/filepath" - "strings" - "testing" - "time" - - "github.com/paketo-buildpacks/occam" - "github.com/paketo-buildpacks/samples/tests" - "github.com/sclevine/spec" - "github.com/sclevine/spec/report" - - . "github.com/onsi/gomega" - . "github.com/paketo-buildpacks/occam/matchers" -) - -var builders tests.BuilderFlags - -func init() { - flag.Var(&builders, "name", "the name a builder to test with") -} - -func TestJava(t *testing.T) { - Expect := NewWithT(t).Expect - - Expect(len(builders)).NotTo(Equal(0)) - - SetDefaultEventuallyTimeout(60 * time.Second) - - suite := spec.New("Java", spec.Parallel(), spec.Report(report.Terminal{})) - for _, builder := range builders { - suite(fmt.Sprintf("Java with %s builder", builder), testJavaWithBuilder(builder), spec.Sequential()) - } - suite.Run(t) -} - -func testJavaWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { - return func(t *testing.T, context spec.G, it spec.S) { - var ( - Expect = NewWithT(t).Expect - Eventually = NewWithT(t).Eventually - - pack occam.Pack - docker occam.Docker - home string = os.Getenv("HOME") - ) - - it.Before(func() { - pack = occam.NewPack().WithVerbose().WithNoColor() - docker = occam.NewDocker() - }) - - context("detects a Java app", func() { - var ( - image occam.Image - container occam.Container - - name string - source string - ) - - it.Before(func() { - var err error - name, err = occam.RandomName() - Expect(err).NotTo(HaveOccurred()) - }) - - it.After(func() { - err := docker.Container.Remove.Execute(container.ID) - if err != nil { - Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) - } else { - Expect(err).ToNot(HaveOccurred()) - } - - Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) - - 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:")) - } else { - Expect(err).ToNot(HaveOccurred()) - } - - Expect(os.RemoveAll(source)).To(Succeed()) - }) - - context("app uses akka", 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("../java", "akka")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for SBT"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for DistZip"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(BeAvailable()) - }) - }) - - context("app uses application insights", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join("../java", "application-insights")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - }) - }) - - context("app uses aspectj", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join("../java", "aspectj")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - }) - }) - - context("app uses dist zip", 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("../java", "dist-zip")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithEnv(map[string]string{ - "BP_JVM_VERSION": "17", - "BP_GRADLE_BUILD_ARGUMENTS": "--no-daemon -x test bootDistZip", - "BP_GRADLE_BUILT_ARTIFACT": "build/distributions/*.zip"}). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.gradle:/home/cnb/.gradle:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for DistZip"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - }) - }) - - context("app uses gradle", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join("../java", "gradle")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithEnv(map[string]string{ - "BP_JVM_VERSION": "17", - "BP_GRADLE_BUILT_ARTIFACT": "build/libs/*-SNAPSHOT.jar", - }). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.gradle:/home/cnb/.gradle:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - }) - }) - - context("app uses jar", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join("../java", "jar")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithBuilder(builder). - WithEnv(map[string]string{"BP_JVM_VERSION": "17"}). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - }) - }) - - context("app uses kotlin", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join("../java", "kotlin")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithEnv(map[string]string{ - "BP_GRADLE_BUILT_ARTIFACT": "build/libs/*-SNAPSHOT.jar", - }). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.gradle:/home/cnb/.gradle:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - }) - }) - - context("app uses leiningen", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join("../java", "leiningen")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithEnv(map[string]string{ - "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M", - }). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Leiningen"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - WithPublishAll(). - WithTTY(). - WithEnv(map[string]string{ - "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M"}). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("Hello World!")).OnPort(8080)) - }) - }) - - context("app uses maven", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join("../java", "maven")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). - WithGID("123"). - WithEnv(map[string]string{"BP_JVM_VERSION": "17"}). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - }) - }) - - context("app uses opentelemetry", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join("../java", "opentelemetry")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("if-not-present"). - WithEnv(map[string]string{ - "BP_OPENTELEMETRY_ENABLED": "true", - }). - WithBuilder(builder). - WithBuildpacks( - "paketo-buildpacks/java", - "gcr.io/paketo-buildpacks/opentelemetry", - ). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for OpenTelemetry"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - }) - }) - - context("app uses war", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join("../java", "war")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Apache Tomcat"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - }) - }) - - context("app uses clojure tools with deps", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join("../java", "deps")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithEnv(map[string]string{ - "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M", - }). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Clojure Tools"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - WithPublishAll(). - WithTTY(). - WithEnv(map[string]string{ - "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M"}). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("Hello World!")).OnPort(8080)) - }) - }) - - context("app uses clojure tools with tools build", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join("../java", "tools-build")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithEnv(map[string]string{ - "BP_CLJ_TOOLS_BUILD_ENABLED": "true", - "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M", - }). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Clojure Tools"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - - container, err = docker.Container.Run. - WithPublish("8080"). - WithPublishAll(). - WithTTY(). - WithEnv(map[string]string{ - "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M", - }). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(Serve(ContainSubstring("Hello World!")).OnPort(8080)) - }) - }) - }) - } -} diff --git a/java/kotlin/build.gradle.kts b/java/kotlin/build.gradle.kts index 765784f7..7608d244 100644 --- a/java/kotlin/build.gradle.kts +++ b/java/kotlin/build.gradle.kts @@ -1,8 +1,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - id("org.springframework.boot") version "2.7.7" - id("io.spring.dependency-management") version "1.1.0" + id("org.springframework.boot") version "2.7.15" + id("io.spring.dependency-management") version "1.1.3" kotlin("jvm") version "1.6.21" kotlin("plugin.spring") version "1.6.21" } diff --git a/java/kotlin/gradle/wrapper/gradle-wrapper.jar b/java/kotlin/gradle/wrapper/gradle-wrapper.jar index 62d4c053550b91381bbd28b1afc82d634bf73a8a..7454180f2ae8848c63b8b4dea2cb829da983f2fa 100644 GIT binary patch delta 18328 zcmY(KV|Snp(4;dlC$??dwr$%s?%1|%+Y{TEB$J74XJYKL?}t6_{)RqPefp~E{28#s zMX<&I7zFQD-2pam5RgAmARxjiNx~Q@eb6u|)i9L6jw-G?+Lr@IPMA5WiWC)^j?e}U zD7iWE@!V0LVEYpjM=!-_G-j1dk20uwjkq>!`+4(Xkt6o-|jrlKp7EEb=pWN^Cb%UFSjMVtrh&&jh&(3&&Vz zcKd9bC@*3rdk-IDdhKyay<~pt5W2vLi+beI>IM*s9tUt*Tie5L!O&Oa+YxxyZ>XQ3 z*!CqyZc&Lp<-7_Dq9qyQYk&)mBB!iu=|iO1D$Wb90#Xq}qtc4I>k6*aFOO`|o{~CB&AzSl{m8ypK)KV5tzuj)?Yxgxq@0 zVju*z4j_?AVwN166T>$_hihYLmz(Bd%S>UDV3OWrqg0d1-n1=yX`@qg&@)zuF|(%> zvyoT-_`5(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set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/java/kotlin/smoke_test/kotlin_test.go b/java/kotlin/smoke_test/kotlin_test.go new file mode 100644 index 00000000..3167cfc8 --- /dev/null +++ b/java/kotlin/smoke_test/kotlin_test.go @@ -0,0 +1,122 @@ +package kotlin_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestKotlin(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - Kotlin", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Kotlin with %s builder", builder), testKotlinWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testKotlinWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses kotlin", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithEnv(map[string]string{ + "BP_GRADLE_BUILT_ARTIFACT": "build/libs/*-SNAPSHOT.jar", + }). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + }) + }) + }) + } +} diff --git a/java/leiningen/smoke_test/leiningen_test.go b/java/leiningen/smoke_test/leiningen_test.go new file mode 100644 index 00000000..1481e846 --- /dev/null +++ b/java/leiningen/smoke_test/leiningen_test.go @@ -0,0 +1,125 @@ +package leiningen_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestLeiningen(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - Leiningen", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Leiningen with %s builder", builder), testLeiningenWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testLeiningenWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses leiningen", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithEnv(map[string]string{ + "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M", + }). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Leiningen"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + WithPublishAll(). + WithTTY(). + WithEnv(map[string]string{ + "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M"}). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("Hello World!")).OnPort(8080)) + }) + }) + }) + } +} diff --git a/java/maven/pom.xml b/java/maven/pom.xml index 3d1d617e..05ace2ad 100644 --- a/java/maven/pom.xml +++ b/java/maven/pom.xml @@ -4,7 +4,7 @@ org.springframework.boot spring-boot-starter-parent - 3.1.2 + 3.1.3 io.paketo diff --git a/java/maven/smoke_test/maven_test.go b/java/maven/smoke_test/maven_test.go new file mode 100644 index 00000000..fc9e236c --- /dev/null +++ b/java/maven/smoke_test/maven_test.go @@ -0,0 +1,120 @@ +package maven_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestMaven(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - Maven", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Maven with %s builder", builder), testMavenWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testMavenWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses maven", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithBuilder(builder). + WithGID("123"). + WithEnv(map[string]string{"BP_JVM_VERSION": "17"}). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + }) + }) + }) + } +} diff --git a/java/native-image/java_native_image_test.go b/java/native-image/java_native_image_test.go deleted file mode 100644 index 708e5c5c..00000000 --- a/java/native-image/java_native_image_test.go +++ /dev/null @@ -1,220 +0,0 @@ -package java_test - -import ( - "flag" - "fmt" - "os" - "path/filepath" - "testing" - "time" - - "github.com/paketo-buildpacks/occam" - "github.com/paketo-buildpacks/samples/tests" - "github.com/sclevine/spec" - "github.com/sclevine/spec/report" - - . "github.com/onsi/gomega" - . "github.com/paketo-buildpacks/occam/matchers" -) - -var builders tests.BuilderFlags - -func init() { - flag.Var(&builders, "name", "the name a builder to test with") -} - -func TestJNI(t *testing.T) { - Expect := NewWithT(t).Expect - - Expect(len(builders)).NotTo(Equal(0)) - - SetDefaultEventuallyTimeout(60 * time.Second) - - suite := spec.New("JavaNativeImage", spec.Parallel(), spec.Report(report.Terminal{})) - for _, builder := range builders { - suite(fmt.Sprintf("Java Native Image with %s builder", builder), testJNIWithBuilder(builder), spec.Sequential()) - } - suite.Run(t) -} - -func testJNIWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { - return func(t *testing.T, context spec.G, it spec.S) { - var ( - Expect = NewWithT(t).Expect - Eventually = NewWithT(t).Eventually - - pack occam.Pack - docker occam.Docker - home string = os.Getenv("HOME") - ) - - it.Before(func() { - pack = occam.NewPack().WithVerbose().WithNoColor() - docker = occam.NewDocker() - }) - - context("detects a Java Native Image app", func() { - var ( - image occam.Image - container occam.Container - - name string - source string - ) - - it.Before(func() { - var err error - name, err = occam.RandomName() - Expect(err).NotTo(HaveOccurred()) - }) - - it.After(func() { - Expect(docker.Container.Remove.Execute(container.ID)).To(Succeed()) - Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) - Expect(docker.Image.Remove.Execute(image.ID)).To(Succeed()) - Expect(os.RemoveAll(source)).To(Succeed()) - }) - - context("uses Spring Boot app", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join(".", "java-native-image-sample")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithEnv(map[string]string{ - "BP_NATIVE_IMAGE": "true", - "BP_MAVEN_BUILD_ARGUMENTS": "-Dmaven.test.skip=true --no-transfer-progress -Pnative package", - "BP_JVM_VERSION": "17"}). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - container, err = docker.Container.Run. - WithEnv(map[string]string{"PORT": "8080"}). - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(BeAvailable()) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Native Image"))) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - }) - }) - - context("uses Gradle based Spring Boot app", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join(".", "java-native-image-sample-gradle")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithEnv(map[string]string{ - "BP_NATIVE_IMAGE": "true"}). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.gradle:/home/cnb/.gradle:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - container, err = docker.Container.Run. - WithEnv(map[string]string{"PORT": "8080"}). - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(BeAvailable()) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Native Image"))) - - Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) - }) - }) - - context("app uses simple JAR", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join(".", "public-static-main")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithEnv(map[string]string{"BP_NATIVE_IMAGE": "true"}). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Native Image"))) - - container, err = docker.Container.Run.Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(func() (fmt.Stringer, error) { - return docker.Container.Logs.Execute(container.ID) - }).Should(ContainLines(ContainSubstring("Hello World!"))) - }) - }) - - context("uses simple Quarkus app", func() { - it("builds successfully", func() { - var err error - source, err = occam.Source(filepath.Join(".", "quarkus-native")) - Expect(err).NotTo(HaveOccurred()) - - var logs fmt.Stringer - image, logs, err = pack.Build. - WithPullPolicy("never"). - WithEnv(map[string]string{ - "BP_NATIVE_IMAGE": "true", - "BP_MAVEN_BUILD_ARGUMENTS": "-Dquarkus.package.type=native-sources -Dmaven.test.skip=true package", - "BP_MAVEN_BUILT_ARTIFACT": "target/native-sources", - "BP_NATIVE_IMAGE_BUILD_ARGUMENTS_FILE": "native-sources/native-image.args", - "BP_NATIVE_IMAGE_BUILT_ARTIFACT": "native-sources/getting-started-*-runner.jar", - }). - WithBuilder(builder). - WithVolumes(fmt.Sprintf("%s/.m2:/home/cnb/.m2:rw", home)). - WithGID("123"). - Execute(name, source) - Expect(err).ToNot(HaveOccurred(), logs.String) - - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) - Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Native Image"))) - - container, err = docker.Container.Run. - WithEnv(map[string]string{"PORT": "8080"}). - WithPublish("8080"). - Execute(image.ID) - Expect(err).NotTo(HaveOccurred()) - - Eventually(container).Should(BeAvailable()) - - Eventually(container).Should(Serve(ContainSubstring("hello")).OnPort(8080).WithEndpoint("/hello")) - }) - }) - }) - } -} diff --git a/java/native-image/public-static-main/.gitignore b/java/native-image/public-static-main-native-image-maven/.gitignore similarity index 100% rename from java/native-image/public-static-main/.gitignore rename to java/native-image/public-static-main-native-image-maven/.gitignore diff --git a/java/native-image/public-static-main/.mvn/wrapper/MavenWrapperDownloader.java b/java/native-image/public-static-main-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from java/native-image/public-static-main/.mvn/wrapper/MavenWrapperDownloader.java rename to java/native-image/public-static-main-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/java/native-image/java-native-image-sample/.mvn/wrapper/maven-wrapper.jar b/java/native-image/public-static-main-native-image-maven/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from java/native-image/java-native-image-sample/.mvn/wrapper/maven-wrapper.jar rename to java/native-image/public-static-main-native-image-maven/.mvn/wrapper/maven-wrapper.jar diff --git a/java/native-image/java-native-image-sample/.mvn/wrapper/maven-wrapper.properties b/java/native-image/public-static-main-native-image-maven/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from java/native-image/java-native-image-sample/.mvn/wrapper/maven-wrapper.properties rename to java/native-image/public-static-main-native-image-maven/.mvn/wrapper/maven-wrapper.properties diff --git a/java/native-image/public-static-main/mvnw b/java/native-image/public-static-main-native-image-maven/mvnw similarity index 100% rename from java/native-image/public-static-main/mvnw rename to java/native-image/public-static-main-native-image-maven/mvnw diff --git a/java/native-image/public-static-main/pom.xml b/java/native-image/public-static-main-native-image-maven/pom.xml similarity index 100% rename from java/native-image/public-static-main/pom.xml rename to java/native-image/public-static-main-native-image-maven/pom.xml diff --git a/java/native-image/public-static-main-native-image-maven/smoke_test/java_native_image_public_static_main_test.go b/java/native-image/public-static-main-native-image-maven/smoke_test/java_native_image_public_static_main_test.go new file mode 100644 index 00000000..95af6633 --- /dev/null +++ b/java/native-image/public-static-main-native-image-maven/smoke_test/java_native_image_public_static_main_test.go @@ -0,0 +1,106 @@ +package native_image_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestJNIPublicStaticMain(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("JavaNativeImage - Public Static Main", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Public Static Main with %s builder", builder), testPublicStaticMainWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testPublicStaticMainWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java Native Image app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + Expect(docker.Container.Remove.Execute(container.ID)).To(Succeed()) + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + Expect(docker.Image.Remove.Execute(image.ID)).To(Succeed()) + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses simple JAR", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithEnv(map[string]string{"BP_NATIVE_IMAGE": "true"}). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Native Image"))) + + container, err = docker.Container.Run.Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(func() (fmt.Stringer, error) { + return docker.Container.Logs.Execute(container.ID) + }).Should(ContainLines(ContainSubstring("Hello World!"))) + }) + }) + }) + } +} diff --git a/java/native-image/public-static-main/src/main/java/io/paketo/App.java b/java/native-image/public-static-main-native-image-maven/src/main/java/io/paketo/App.java similarity index 100% rename from java/native-image/public-static-main/src/main/java/io/paketo/App.java rename to java/native-image/public-static-main-native-image-maven/src/main/java/io/paketo/App.java diff --git a/java/native-image/quarkus-native/.gitignore b/java/native-image/quarkus-native-image-maven/.gitignore similarity index 100% rename from java/native-image/quarkus-native/.gitignore rename to java/native-image/quarkus-native-image-maven/.gitignore diff --git a/java/native-image/quarkus-native/.mvn/wrapper/MavenWrapperDownloader.java b/java/native-image/quarkus-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from java/native-image/quarkus-native/.mvn/wrapper/MavenWrapperDownloader.java rename to java/native-image/quarkus-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/java/native-image/quarkus-native/.mvn/wrapper/maven-wrapper.jar b/java/native-image/quarkus-native-image-maven/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from java/native-image/quarkus-native/.mvn/wrapper/maven-wrapper.jar rename to java/native-image/quarkus-native-image-maven/.mvn/wrapper/maven-wrapper.jar diff --git a/java/native-image/quarkus-native/.mvn/wrapper/maven-wrapper.properties b/java/native-image/quarkus-native-image-maven/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from java/native-image/quarkus-native/.mvn/wrapper/maven-wrapper.properties rename to java/native-image/quarkus-native-image-maven/.mvn/wrapper/maven-wrapper.properties diff --git a/java/native-image/quarkus-native/.s2i/environment b/java/native-image/quarkus-native-image-maven/.s2i/environment similarity index 100% rename from java/native-image/quarkus-native/.s2i/environment rename to java/native-image/quarkus-native-image-maven/.s2i/environment diff --git a/java/native-image/quarkus-native/README.md b/java/native-image/quarkus-native-image-maven/README.md similarity index 100% rename from java/native-image/quarkus-native/README.md rename to java/native-image/quarkus-native-image-maven/README.md diff --git a/java/native-image/quarkus-native/mvnw b/java/native-image/quarkus-native-image-maven/mvnw similarity index 100% rename from java/native-image/quarkus-native/mvnw rename to java/native-image/quarkus-native-image-maven/mvnw diff --git a/java/native-image/quarkus-native/mvnw.cmd b/java/native-image/quarkus-native-image-maven/mvnw.cmd similarity index 100% rename from java/native-image/quarkus-native/mvnw.cmd rename to java/native-image/quarkus-native-image-maven/mvnw.cmd diff --git a/java/native-image/quarkus-native/pom.xml b/java/native-image/quarkus-native-image-maven/pom.xml similarity index 100% rename from java/native-image/quarkus-native/pom.xml rename to java/native-image/quarkus-native-image-maven/pom.xml diff --git a/java/native-image/quarkus-native-image-maven/smoke_test/java_native_image_quarkus_native_test.go b/java/native-image/quarkus-native-image-maven/smoke_test/java_native_image_quarkus_native_test.go new file mode 100644 index 00000000..0e39c893 --- /dev/null +++ b/java/native-image/quarkus-native-image-maven/smoke_test/java_native_image_quarkus_native_test.go @@ -0,0 +1,115 @@ +package native_image_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestJNIQuarkus(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("JavaNativeImage - Quarkus", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Quarkus with %s builder", builder), testQuarkusWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testQuarkusWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java Native Image app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + Expect(docker.Container.Remove.Execute(container.ID)).To(Succeed()) + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + Expect(docker.Image.Remove.Execute(image.ID)).To(Succeed()) + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("uses simple Quarkus app", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithEnv(map[string]string{ + "BP_NATIVE_IMAGE": "true", + "BP_MAVEN_BUILD_ARGUMENTS": "-Dquarkus.package.type=native-sources -Dmaven.test.skip=true package", + "BP_MAVEN_BUILT_ARTIFACT": "target/native-sources", + "BP_NATIVE_IMAGE_BUILD_ARGUMENTS_FILE": "native-sources/native-image.args", + "BP_NATIVE_IMAGE_BUILT_ARTIFACT": "native-sources/getting-started-*-runner.jar", + }). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Native Image"))) + + container, err = docker.Container.Run. + WithEnv(map[string]string{"PORT": "8080"}). + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(BeAvailable()) + + Eventually(container).Should(Serve(ContainSubstring("hello")).OnPort(8080).WithEndpoint("/hello")) + }) + }) + }) + } +} diff --git a/java/native-image/quarkus-native/src/main/java/org/acme/getting/started/GreetingResource.java b/java/native-image/quarkus-native-image-maven/src/main/java/org/acme/getting/started/GreetingResource.java similarity index 100% rename from java/native-image/quarkus-native/src/main/java/org/acme/getting/started/GreetingResource.java rename to java/native-image/quarkus-native-image-maven/src/main/java/org/acme/getting/started/GreetingResource.java diff --git a/java/native-image/quarkus-native/src/main/java/org/acme/getting/started/GreetingService.java b/java/native-image/quarkus-native-image-maven/src/main/java/org/acme/getting/started/GreetingService.java similarity index 100% rename from java/native-image/quarkus-native/src/main/java/org/acme/getting/started/GreetingService.java rename to java/native-image/quarkus-native-image-maven/src/main/java/org/acme/getting/started/GreetingService.java diff --git a/java/native-image/quarkus-native/src/main/resources/META-INF/resources/index.html b/java/native-image/quarkus-native-image-maven/src/main/resources/META-INF/resources/index.html similarity index 100% rename from java/native-image/quarkus-native/src/main/resources/META-INF/resources/index.html rename to java/native-image/quarkus-native-image-maven/src/main/resources/META-INF/resources/index.html diff --git a/java/native-image/quarkus-native/src/main/resources/application.properties b/java/native-image/quarkus-native-image-maven/src/main/resources/application.properties similarity index 100% rename from java/native-image/quarkus-native/src/main/resources/application.properties rename to java/native-image/quarkus-native-image-maven/src/main/resources/application.properties diff --git a/java/native-image/quarkus-native/src/test/java/org/acme/getting/started/GreetingResourceTest.java b/java/native-image/quarkus-native-image-maven/src/test/java/org/acme/getting/started/GreetingResourceTest.java similarity index 100% rename from java/native-image/quarkus-native/src/test/java/org/acme/getting/started/GreetingResourceTest.java rename to java/native-image/quarkus-native-image-maven/src/test/java/org/acme/getting/started/GreetingResourceTest.java diff --git a/java/native-image/quarkus-native/src/test/java/org/acme/getting/started/NativeGreetingResourceIT.java b/java/native-image/quarkus-native-image-maven/src/test/java/org/acme/getting/started/NativeGreetingResourceIT.java similarity index 100% rename from java/native-image/quarkus-native/src/test/java/org/acme/getting/started/NativeGreetingResourceIT.java rename to java/native-image/quarkus-native-image-maven/src/test/java/org/acme/getting/started/NativeGreetingResourceIT.java diff --git a/java/native-image/java-native-image-sample-gradle/.gitignore b/java/native-image/spring-boot-native-image-gradle/.gitignore similarity index 100% rename from java/native-image/java-native-image-sample-gradle/.gitignore rename to java/native-image/spring-boot-native-image-gradle/.gitignore diff --git a/java/native-image/java-native-image-sample-gradle/README.md b/java/native-image/spring-boot-native-image-gradle/README.md similarity index 100% rename from java/native-image/java-native-image-sample-gradle/README.md rename to java/native-image/spring-boot-native-image-gradle/README.md diff --git a/java/native-image/java-native-image-sample-gradle/build.gradle b/java/native-image/spring-boot-native-image-gradle/build.gradle similarity index 87% rename from java/native-image/java-native-image-sample-gradle/build.gradle rename to java/native-image/spring-boot-native-image-gradle/build.gradle index 2de2ff9b..87c257e1 100644 --- a/java/native-image/java-native-image-sample-gradle/build.gradle +++ b/java/native-image/spring-boot-native-image-gradle/build.gradle @@ -1,8 +1,8 @@ plugins { id 'java' - id 'org.springframework.boot' version '3.0.6' + id 'org.springframework.boot' version '3.0.10' id 'org.graalvm.buildtools.native' version '0.9.21' - id 'io.spring.dependency-management' version '1.1.0' + id 'io.spring.dependency-management' version '1.1.3' } group = 'io.paketo' diff --git a/java/native-image/java-native-image-sample-gradle/gradle/wrapper/gradle-wrapper.jar b/java/native-image/spring-boot-native-image-gradle/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from java/native-image/java-native-image-sample-gradle/gradle/wrapper/gradle-wrapper.jar rename to java/native-image/spring-boot-native-image-gradle/gradle/wrapper/gradle-wrapper.jar diff --git a/java/native-image/java-native-image-sample-gradle/gradle/wrapper/gradle-wrapper.properties b/java/native-image/spring-boot-native-image-gradle/gradle/wrapper/gradle-wrapper.properties similarity index 92% rename from java/native-image/java-native-image-sample-gradle/gradle/wrapper/gradle-wrapper.properties rename to java/native-image/spring-boot-native-image-gradle/gradle/wrapper/gradle-wrapper.properties index f398c33c..4e86b927 100644 --- a/java/native-image/java-native-image-sample-gradle/gradle/wrapper/gradle-wrapper.properties +++ b/java/native-image/spring-boot-native-image-gradle/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java/native-image/java-native-image-sample-gradle/gradlew b/java/native-image/spring-boot-native-image-gradle/gradlew similarity index 100% rename from java/native-image/java-native-image-sample-gradle/gradlew rename to java/native-image/spring-boot-native-image-gradle/gradlew diff --git a/java/native-image/java-native-image-sample-gradle/gradlew.bat b/java/native-image/spring-boot-native-image-gradle/gradlew.bat similarity index 100% rename from java/native-image/java-native-image-sample-gradle/gradlew.bat rename to java/native-image/spring-boot-native-image-gradle/gradlew.bat diff --git a/java/native-image/java-native-image-sample-gradle/settings.gradle b/java/native-image/spring-boot-native-image-gradle/settings.gradle similarity index 100% rename from java/native-image/java-native-image-sample-gradle/settings.gradle rename to java/native-image/spring-boot-native-image-gradle/settings.gradle diff --git a/java/native-image/spring-boot-native-image-gradle/smoke_test/java_native_image_gradle_test.go b/java/native-image/spring-boot-native-image-gradle/smoke_test/java_native_image_gradle_test.go new file mode 100644 index 00000000..a8989abc --- /dev/null +++ b/java/native-image/spring-boot-native-image-gradle/smoke_test/java_native_image_gradle_test.go @@ -0,0 +1,112 @@ +package native_image_test + +import ( + "flag" + "fmt" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/paketo-buildpacks/samples/tests" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} + +func TestJNIGradle(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("JavaNativeImage - Gradle", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Gradle with %s builder", builder), testGradleWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testGradleWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java Native Image app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + Expect(docker.Container.Remove.Execute(container.ID)).To(Succeed()) + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + Expect(docker.Image.Remove.Execute(image.ID)).To(Succeed()) + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("uses Gradle based Spring Boot app", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithEnv(map[string]string{ + "BP_NATIVE_IMAGE": "true"}). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + container, err = docker.Container.Run. + WithEnv(map[string]string{"PORT": "8080"}). + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(BeAvailable()) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Native Image"))) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + }) + }) + }) + } +} diff --git a/java/native-image/java-native-image-sample-gradle/src/main/java/io/paketo/demo/DemoApplication.java b/java/native-image/spring-boot-native-image-gradle/src/main/java/io/paketo/demo/DemoApplication.java similarity index 100% rename from java/native-image/java-native-image-sample-gradle/src/main/java/io/paketo/demo/DemoApplication.java rename to java/native-image/spring-boot-native-image-gradle/src/main/java/io/paketo/demo/DemoApplication.java diff --git a/java/native-image/java-native-image-sample-gradle/src/main/resources/application.properties b/java/native-image/spring-boot-native-image-gradle/src/main/resources/application.properties similarity index 100% rename from java/native-image/java-native-image-sample-gradle/src/main/resources/application.properties rename to java/native-image/spring-boot-native-image-gradle/src/main/resources/application.properties diff --git a/java/native-image/java-native-image-sample-gradle/src/test/java/io/paketo/demo/DemoApplicationTests.java b/java/native-image/spring-boot-native-image-gradle/src/test/java/io/paketo/demo/DemoApplicationTests.java similarity index 100% rename from java/native-image/java-native-image-sample-gradle/src/test/java/io/paketo/demo/DemoApplicationTests.java rename to java/native-image/spring-boot-native-image-gradle/src/test/java/io/paketo/demo/DemoApplicationTests.java diff --git a/java/native-image/java-native-image-sample/.gitignore b/java/native-image/spring-boot-native-image-maven/.gitignore similarity index 100% rename from java/native-image/java-native-image-sample/.gitignore rename to java/native-image/spring-boot-native-image-maven/.gitignore diff --git a/java/native-image/java-native-image-sample/.mvn/wrapper/MavenWrapperDownloader.java b/java/native-image/spring-boot-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from java/native-image/java-native-image-sample/.mvn/wrapper/MavenWrapperDownloader.java rename to java/native-image/spring-boot-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/java/native-image/public-static-main/.mvn/wrapper/maven-wrapper.jar b/java/native-image/spring-boot-native-image-maven/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from java/native-image/public-static-main/.mvn/wrapper/maven-wrapper.jar rename to java/native-image/spring-boot-native-image-maven/.mvn/wrapper/maven-wrapper.jar diff --git a/java/native-image/public-static-main/.mvn/wrapper/maven-wrapper.properties b/java/native-image/spring-boot-native-image-maven/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from java/native-image/public-static-main/.mvn/wrapper/maven-wrapper.properties rename to java/native-image/spring-boot-native-image-maven/.mvn/wrapper/maven-wrapper.properties diff --git a/java/native-image/java-native-image-sample/README.md b/java/native-image/spring-boot-native-image-maven/README.md similarity index 100% rename from java/native-image/java-native-image-sample/README.md rename to java/native-image/spring-boot-native-image-maven/README.md diff --git a/java/native-image/java-native-image-sample/mvnw b/java/native-image/spring-boot-native-image-maven/mvnw similarity index 100% rename from java/native-image/java-native-image-sample/mvnw rename to java/native-image/spring-boot-native-image-maven/mvnw diff --git a/java/native-image/java-native-image-sample/mvnw.cmd b/java/native-image/spring-boot-native-image-maven/mvnw.cmd similarity index 100% rename from java/native-image/java-native-image-sample/mvnw.cmd rename to java/native-image/spring-boot-native-image-maven/mvnw.cmd diff --git a/java/native-image/java-native-image-sample/pom.xml b/java/native-image/spring-boot-native-image-maven/pom.xml similarity index 100% rename from java/native-image/java-native-image-sample/pom.xml rename to java/native-image/spring-boot-native-image-maven/pom.xml diff --git a/java/native-image/spring-boot-native-image-maven/smoke_test/java_native_image_maven_test.go b/java/native-image/spring-boot-native-image-maven/smoke_test/java_native_image_maven_test.go new file mode 100644 index 00000000..0a8dc732 --- /dev/null +++ b/java/native-image/spring-boot-native-image-maven/smoke_test/java_native_image_maven_test.go @@ -0,0 +1,113 @@ +package native_image_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestJNIMaven(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("JavaNativeImage - Maven", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Maven with %s builder", builder), testMavenWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testMavenWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java Native Image app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + Expect(docker.Container.Remove.Execute(container.ID)).To(Succeed()) + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + Expect(docker.Image.Remove.Execute(image.ID)).To(Succeed()) + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("uses Spring Boot app Maven", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithEnv(map[string]string{ + "BP_NATIVE_IMAGE": "true", + "BP_MAVEN_BUILD_ARGUMENTS": "-Dmaven.test.skip=true --no-transfer-progress -Pnative package", + "BP_JVM_VERSION": "17"}). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + container, err = docker.Container.Run. + WithEnv(map[string]string{"PORT": "8080"}). + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(BeAvailable()) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Native Image"))) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + }) + }) + }) + } +} diff --git a/java/native-image/java-native-image-sample/src/main/java/io/paketo/demo/DemoApplication.java b/java/native-image/spring-boot-native-image-maven/src/main/java/io/paketo/demo/DemoApplication.java similarity index 100% rename from java/native-image/java-native-image-sample/src/main/java/io/paketo/demo/DemoApplication.java rename to java/native-image/spring-boot-native-image-maven/src/main/java/io/paketo/demo/DemoApplication.java diff --git a/java/native-image/java-native-image-sample/src/main/resources/application.properties b/java/native-image/spring-boot-native-image-maven/src/main/resources/application.properties similarity index 100% rename from java/native-image/java-native-image-sample/src/main/resources/application.properties rename to java/native-image/spring-boot-native-image-maven/src/main/resources/application.properties diff --git a/java/native-image/java-native-image-sample/src/test/java/io/paketo/demo/DemoApplicationTests.java b/java/native-image/spring-boot-native-image-maven/src/test/java/io/paketo/demo/DemoApplicationTests.java similarity index 100% rename from java/native-image/java-native-image-sample/src/test/java/io/paketo/demo/DemoApplicationTests.java rename to java/native-image/spring-boot-native-image-maven/src/test/java/io/paketo/demo/DemoApplicationTests.java diff --git a/java/opentelemetry/build.gradle b/java/opentelemetry/build.gradle index 7fe91914..fea42233 100644 --- a/java/opentelemetry/build.gradle +++ b/java/opentelemetry/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'org.springframework.boot' version '2.7.7' + id 'org.springframework.boot' version '2.7.15' id 'io.spring.dependency-management' version '1.0.15.RELEASE' id 'java' } diff --git a/java/opentelemetry/gradle/wrapper/gradle-wrapper.properties b/java/opentelemetry/gradle/wrapper/gradle-wrapper.properties index f398c33c..4e86b927 100644 --- a/java/opentelemetry/gradle/wrapper/gradle-wrapper.properties +++ b/java/opentelemetry/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java/opentelemetry/smoke_test/opentelemetry_test.go b/java/opentelemetry/smoke_test/opentelemetry_test.go new file mode 100644 index 00000000..fd01be68 --- /dev/null +++ b/java/opentelemetry/smoke_test/opentelemetry_test.go @@ -0,0 +1,127 @@ +package opentelemetry_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestOpentelemetry(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - Opentelemetry", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("Opentelemetry with %s builder", builder), testOpentelemetryWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testOpentelemetryWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses opentelemetry", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("if-not-present"). + WithEnv(map[string]string{ + "BP_OPENTELEMETRY_ENABLED": "true", + }). + WithBuilder(builder). + WithBuildpacks( + "paketo-buildpacks/java", + "gcr.io/paketo-buildpacks/opentelemetry", + ). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Gradle"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Spring Boot"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for OpenTelemetry"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + }) + }) + }) + } +} diff --git a/java/tools-build/smoke_test/tools_build_test.go b/java/tools-build/smoke_test/tools_build_test.go new file mode 100644 index 00000000..e79f8086 --- /dev/null +++ b/java/tools-build/smoke_test/tools_build_test.go @@ -0,0 +1,127 @@ +package tools_build_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestToolsBuild(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - ToolsBuild", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("ToolsBuild with %s builder", builder), testToolsBuildWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testToolsBuildWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses clojure tools with tools build", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithEnv(map[string]string{ + "BP_CLJ_TOOLS_BUILD_ENABLED": "true", + "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M", + }). + WithBuilder(builder). + WithGID("123"). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Clojure Tools"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Executable JAR"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + WithPublishAll(). + WithTTY(). + WithEnv(map[string]string{ + "JAVA_TOOL_OPTIONS": "-XX:MaxMetaspaceSize=100M", + }). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("Hello World!")).OnPort(8080)) + }) + }) + }) + } +} diff --git a/java/war/pom.xml b/java/war/pom.xml index 165ac4c2..3022f1b4 100644 --- a/java/war/pom.xml +++ b/java/war/pom.xml @@ -4,7 +4,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.14 + 2.7.15 io.paketo diff --git a/java/war/smoke_test/war_test.go b/java/war/smoke_test/war_test.go new file mode 100644 index 00000000..509c75e4 --- /dev/null +++ b/java/war/smoke_test/war_test.go @@ -0,0 +1,117 @@ +package war_test + +import ( + "flag" + "fmt" + "github.com/paketo-buildpacks/samples/tests" + "os" + "path/filepath" + "testing" + "time" + + "github.com/paketo-buildpacks/occam" + "github.com/sclevine/spec" + "github.com/sclevine/spec/report" + + . "github.com/onsi/gomega" + . "github.com/paketo-buildpacks/occam/matchers" +) + +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} +func TestWAR(t *testing.T) { + Expect := NewWithT(t).Expect + + Expect(len(builders)).NotTo(Equal(0)) + + SetDefaultEventuallyTimeout(60 * time.Second) + + suite := spec.New("Java - WAR", spec.Parallel(), spec.Report(report.Terminal{})) + for _, builder := range builders { + suite(fmt.Sprintf("WAR with %s builder", builder), testWARWithBuilder(builder), spec.Sequential()) + } + suite.Run(t) +} + +func testWARWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { + return func(t *testing.T, context spec.G, it spec.S) { + var ( + Expect = NewWithT(t).Expect + Eventually = NewWithT(t).Eventually + + pack occam.Pack + docker occam.Docker + ) + + it.Before(func() { + pack = occam.NewPack().WithVerbose().WithNoColor() + docker = occam.NewDocker() + }) + + context("detects a Java app", func() { + var ( + image occam.Image + container occam.Container + + name string + source string + ) + + it.Before(func() { + var err error + name, err = occam.RandomName() + Expect(err).NotTo(HaveOccurred()) + }) + + it.After(func() { + err := docker.Container.Remove.Execute(container.ID) + if err != nil { + Expect(err).To(MatchError("failed to remove docker container: exit status 1: Container name cannot be empty")) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed()) + + err = docker.Image.Remove.Execute(image.ID) + if err != nil { + Expect(err).To(MatchError(ContainSubstring("failed to remove docker image: exit status 1: Error"))) + } else { + Expect(err).ToNot(HaveOccurred()) + } + + Expect(os.RemoveAll(source)).To(Succeed()) + }) + + context("app uses war", func() { + it("builds successfully", func() { + var err error + source, err = occam.Source(filepath.Join("../")) + Expect(err).NotTo(HaveOccurred()) + + var logs fmt.Stringer + image, logs, err = pack.Build. + WithPullPolicy("never"). + WithBuilder(builder). + Execute(name, source) + Expect(err).ToNot(HaveOccurred(), logs.String) + + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for BellSoft Liberica"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Maven"))) + Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Apache Tomcat"))) + + container, err = docker.Container.Run. + WithPublish("8080"). + Execute(image.ID) + Expect(err).NotTo(HaveOccurred()) + + Eventually(container).Should(Serve(ContainSubstring("UP")).OnPort(8080).WithEndpoint("/actuator/health")) + }) + }) + }) + } +}