Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion docs/DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ java-buildpack/
│ ├── unit.sh # Run unit tests
│ ├── integration.sh # Run integration tests
│ └── package.sh # Package buildpack for deployment
├── vendor/ # Vendored Go dependencies
├── vendor/ # Vendored Go dependencies of the buildpack (not of src/integration)
├── ARCHITECTURE.md # Detailed architecture guide
├── RUBY_VS_GO_BUILDPACK_COMPARISON.md # Ruby vs Go buildpack implementations comparison info
├── CONTRIBUTING.md # Contribution guide
Expand Down
37 changes: 4 additions & 33 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,33 @@ go 1.25.4
require (
github.com/Dynatrace/libbuildpack-dynatrace v1.9.0
github.com/cloudfoundry/libbuildpack v0.0.0-20261012122722-6cd465089938
github.com/cloudfoundry/switchblade v0.10.0
github.com/golang/mock v1.6.0
github.com/onsi/ginkgo/v2 v2.29.0
github.com/onsi/gomega v1.42.0
github.com/sclevine/spec v1.4.0
go.yaml.in/yaml/v3 v3.0.4
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v28.5.2+incompatible // indirect
github.com/docker/go-connections v0.8.2 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/term v0.5.2 // indirect
github.com/morikuni/aec v1.1.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/paketo-buildpacks/packit/v2 v2.25.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569 // indirect
github.com/ulikunitz/xz v0.5.15 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
go.opentelemetry.io/otel v1.41.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v0.0.0-00010101000000-000000000000 // indirect
go.opentelemetry.io/otel/metric v1.41.0 // indirect
go.opentelemetry.io/otel/trace v1.41.0 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/stretchr/testify v1.11.1 // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/text v0.37.0 // indirect
golang.org/x/tools v0.44.0 // indirect
gotest.tools/v3 v3.5.2 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)

// Replace directives to fix OpenTelemetry dependency conflicts from docker/docker test dependencies
// The docker client's test code (which we don't run) pulls in old OTEL versions with reorganized internals
replace (
go.opentelemetry.io/otel/exporters/otlp/otlptrace => go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp => go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0
)
95 changes: 3 additions & 92 deletions go.sum

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions scripts/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,19 @@ function specs::run() {
fi

cd "${ROOTDIR}"
go mod download

local buildpack_file
buildpack_file="$(buildpack::package "1.2.3" "${cached}" "${stack}")"

# src/integration is its own Go module, so run from there.
cd "${ROOTDIR}/src/integration"
go mod download

local log
log="$(mktemp)"

local -a go_test_args
go_test_args=(
"${ROOTDIR}/src/integration"
.
${cached_flag}
${platform_flag}
${token_flag}
Expand All @@ -183,7 +185,7 @@ function specs::run() {
fi

local status=0
if go test -count=1 -timeout=0 -mod vendor -v "${go_test_args[@]}" 2>&1 | tee "${log}"; then
if go test -count=1 -timeout=0 -v "${go_test_args[@]}" 2>&1 | tee "${log}"; then
rm -f "${log}"
return 0
fi
Expand Down Expand Up @@ -236,7 +238,7 @@ function specs::retry_failed() {
echo "--- Retry ${attempt}/${retries} in $((delay * attempt))s: ${test}"
sleep "$((delay * attempt))"
# A pattern that matches nothing also exits 0, so require the test to be reported as passed.
if go test -count=1 -timeout=0 -mod vendor -v -run "$(specs::run_pattern "${test}")" "$@" 2>&1 | tee "${retry_log}" &&
if go test -count=1 -timeout=0 -v -run "$(specs::run_pattern "${test}")" "$@" 2>&1 | tee "${retry_log}" &&
grep -qF -- "--- PASS: ${test} " "${retry_log}"; then
passed="true"
break
Expand Down
8 changes: 4 additions & 4 deletions src/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ On the docker platform, `scripts/integration.sh` runs tests in parallel (3 nodes

### Run Tests Directly with Go

You can also run the tests directly using Go:
You can also run the tests directly using Go. `src/integration` is its own Go module (own `go.mod`, no `vendor/`), so run `go test` from that directory. Its dependencies (switchblade, the Docker client, OpenTelemetry) are downloaded, not vendored, and they do not change the Go version or the `vendor/` directory of the buildpack itself.

```bash
cd src/integration

# Run all tests
BUILDPACK_FILE=/path/to/buildpack.zip go test -mod vendor -v -timeout 30m ./
BUILDPACK_FILE=/path/to/buildpack.zip go test -v -timeout 30m ./

# Run on Docker (requires GitHub token)
BUILDPACK_FILE=/path/to/buildpack.zip go test -mod vendor -v -timeout 30m ./ \
BUILDPACK_FILE=/path/to/buildpack.zip go test -v -timeout 30m ./ \
-platform=docker -github-token=<token>

# Run offline tests
BUILDPACK_FILE=/path/to/buildpack.zip go test -mod vendor -v -timeout 30m ./ -cached
BUILDPACK_FILE=/path/to/buildpack.zip go test -v -timeout 30m ./ -cached
```

### Running a Subset of Tests
Expand Down
50 changes: 50 additions & 0 deletions src/integration/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
module github.com/cloudfoundry/java-buildpack/src/integration

go 1.25.4

require (
github.com/cloudfoundry/switchblade v0.10.0
github.com/onsi/gomega v1.42.0
github.com/sclevine/spec v1.4.0
)

require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v28.5.2+incompatible // indirect
github.com/docker/go-connections v0.8.2 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/term v0.5.2 // indirect
github.com/morikuni/aec v1.1.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/paketo-buildpacks/packit/v2 v2.25.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569 // indirect
github.com/ulikunitz/xz v0.5.15 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
go.opentelemetry.io/otel v1.41.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v0.0.0-00010101000000-000000000000 // indirect
go.opentelemetry.io/otel/metric v1.41.0 // indirect
go.opentelemetry.io/otel/trace v1.41.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/text v0.37.0 // indirect
gotest.tools/v3 v3.5.2 // indirect
)

replace (
go.opentelemetry.io/otel/exporters/otlp/otlptrace => go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp => go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0
)
Loading