load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") genrule( name = "generate", srcs = [ "//config/pallets/edge/auth-proxy/test", "//config/pallets/sds/emergencyaccess/authservice/base", "//config/pallets/sds/emergencyaccess/eagateway/base", "//config/pallets/sds/emergencyaccess/rulesengine/base", "//config/pallets/sds/emergencyaccess/userservice/base:userservice", "//pkg/sds/emergencyaccess/ea_integration/v2/mockbffserver:bff", "//pkg/sds/emergencyaccess/ea_integration/v2/pubsub", ], outs = [ "testdata/auth_proxy_manifests.yaml", "testdata/authservice_manifests.yaml", "testdata/eagateway_manifests.yaml", "testdata/rulesengine_manifests.yaml", "testdata/userservice_manifests.yaml", "testdata/mockbffserver_manifests.yaml", "testdata/pubsub_manifests.yaml", ], # cmd runs a shell command to concatenate the contents of the srcs files into the outs files for each config cmd = """ mkdir -p $(RULEDIR)/testdata/ && \ idx=0 && \ for src in $(SRCS); do \ out=$$(echo $(OUTS) | cut -d' ' -f$$((idx + 1))) && \ idx=$$((idx + 1)) && \ cat $$src >> $$out; \ done """, ) go_test( name = "ea_integration_test", srcs = ["ea_v2_integration_test.go"], data = [ "//hack/tools:etcd", "//hack/tools:kube-apiserver", "//hack/tools:kubectl", ], embed = [":ea_integration"], embedsrcs = [ "testdata/README.md", "testdata/auth_proxy_manifests.yaml", "testdata/authservice_manifests.yaml", "testdata/eagateway_manifests.yaml", "testdata/rulesengine_manifests.yaml", "testdata/userservice_manifests.yaml", "testdata/mockbffserver_manifests.yaml", "testdata/pubsub_manifests.yaml", ], tags = [ "integration", "needs-f2-refactor", "requires-network", ], visibility = ["//visibility:public"], deps = [ "//pkg/sds/emergencyaccess/emulatorsvc", "//test/f2", "//test/f2/fctx", "//test/f2/integration", "//test/f2/x/ktest", "//test/f2/x/ktest/envtest", "//test/f2/x/postgres", "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", "@com_google_cloud_go_pubsub//:pubsub", "@org_golang_google_api//option", "@org_golang_google_api//option/internaloption", "@org_golang_google_grpc//:grpc", "@org_golang_google_grpc//credentials/insecure", ], ) go_library( name = "ea_integration", srcs = [ "helpers.go", "manifests.go", "seed.go", ], importpath = "edge-infra.dev/pkg/sds/emergencyaccess/ea_integration/v2", visibility = ["//visibility:private"], deps = [ "//pkg/edge/api/sql/plugin", "//pkg/edge/api/sql/utils", "//pkg/k8s/decoder", "//pkg/k8s/testing/kmp", "//pkg/k8s/unstructured", "//test/f2", "//test/f2/x/ktest", "//test/f2/x/postgres", "@com_github_google_uuid//:uuid", "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", "@com_google_cloud_go_pubsub//:pubsub", "@io_k8s_sigs_kustomize_api//filters/namespace", "@io_k8s_sigs_kustomize_api//types", "@io_k8s_sigs_kustomize_kyaml//kio", "@io_k8s_sigs_kustomize_kyaml//yaml", ], )