From 0da3922b3f491932c9632a5136eacff72bcc48a5 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Fri, 24 Feb 2023 16:04:10 -0800 Subject: [PATCH] chore: add structure_test for custom registry example (#78) --- e2e/custom_registry/WORKSPACE | 2 ++ e2e/custom_registry/app/BUILD.bazel | 8 +++++++- e2e/custom_registry/app/test.yaml | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 e2e/custom_registry/app/test.yaml diff --git a/e2e/custom_registry/WORKSPACE b/e2e/custom_registry/WORKSPACE index fc120176..8c17f916 100644 --- a/e2e/custom_registry/WORKSPACE +++ b/e2e/custom_registry/WORKSPACE @@ -1,3 +1,5 @@ +workspace(name = "custom_registry_example") + load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") local_repository( diff --git a/e2e/custom_registry/app/BUILD.bazel b/e2e/custom_registry/app/BUILD.bazel index 17605bff..672f76a1 100644 --- a/e2e/custom_registry/app/BUILD.bazel +++ b/e2e/custom_registry/app/BUILD.bazel @@ -1,6 +1,6 @@ load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup") load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") -load("@contrib_rules_oci//oci:defs.bzl", "oci_image", "oci_tarball") +load("@contrib_rules_oci//oci:defs.bzl", "oci_image", "oci_tarball", "structure_test") load("@rules_pkg//:pkg.bzl", "pkg_tar") go_library( @@ -55,3 +55,9 @@ oci_tarball( image = ":image", repotags = ["gcr.io/example:latest"], ) + +structure_test( + name = "test", + config = ["test.yaml"], + image = ":image", +) diff --git a/e2e/custom_registry/app/test.yaml b/e2e/custom_registry/app/test.yaml new file mode 100644 index 00000000..3a777a23 --- /dev/null +++ b/e2e/custom_registry/app/test.yaml @@ -0,0 +1,5 @@ +schemaVersion: 2.0.0 +commandTests: + - name: "test" + command: "/app" + expectedOutput: ['"Hello World"']