Skip to content

Commit 5373a51

Browse files
committed
[Test] Native multi-arch ClusterBuildStrategy
1 parent dc96c0f commit 5373a51

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

test/data/v1beta1/build_multiarch_native_buildah_cr.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
2-
apiVersion: shipwright.io/v1alpha1
2+
apiVersion: shipwright.io/v1beta1
33
kind: Build
44
metadata:
55
name: multiarch-native-buildah-ex
66
spec:
77
source:
8-
url: https://github.com/shipwright-io/sample-go
8+
type: Git
9+
git:
10+
url: https://github.com/shipwright-io/sample-go
911
contextDir: docker-build
1012
strategy:
1113
name: multiarch-native-buildah
@@ -24,6 +26,7 @@ spec:
2426
# The runtime-stage-from implements the logic to replace the last stage FROM image of a Dockerfile
2527
- name: runtime-stage-from
2628
value: docker://gcr.io/distroless/static:nonroot
27-
dockerfile: Dockerfile
29+
- name: dockerfile
30+
value: Dockerfile
2831
output:
2932
image: image-registry.openshift-image-registry.svc:5000/build-examples/taxi-app
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: shipwright.io/v1beta1
3+
kind: BuildRun
4+
metadata:
5+
name: multiarch-native-buildah-ex
6+
spec:
7+
build:
8+
name: multiarch-native-buildah-ex

test/e2e/v1beta1/e2e_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,25 @@ var _ = Describe("For a Kubernetes cluster with Tekton and build installed", fun
475475
})
476476
})
477477

478+
Context("when a Multiarch Native Buildah build is defined", func() {
479+
480+
BeforeEach(func() {
481+
testID = generateTestID("buildah-multi-arch-native")
482+
483+
// create the build definition
484+
build = createBuild(
485+
testBuild,
486+
testID,
487+
"test/data/v1beta1/build_multiarch_native_buildah_cr.yaml",
488+
)
489+
})
490+
491+
It("successfully runs a build", func() {
492+
buildRun, err = buildRunTestData(testBuild.Namespace, testID, "test/data/v1beta1/buildrun_multiarch_native_buildah_cr.yaml")
493+
Expect(err).ToNot(HaveOccurred())
494+
buildRun = validateBuildRunToSucceed(testBuild, buildRun)
495+
})
496+
})
478497
Context("when a s2i build is defined", func() {
479498

480499
BeforeEach(func() {

0 commit comments

Comments
 (0)