1load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
2
3genrule(
4 name = "generate",
5 srcs = [
6 "//config/pallets/edge/auth-proxy/test",
7 "//config/pallets/sds/emergencyaccess/authservice/base",
8 "//config/pallets/sds/emergencyaccess/eagateway/base",
9 "//config/pallets/sds/emergencyaccess/rulesengine/base",
10 "//config/pallets/sds/emergencyaccess/userservice/base:userservice",
11 "//pkg/sds/emergencyaccess/ea_integration/v2/mockbffserver:bff",
12 "//pkg/sds/emergencyaccess/ea_integration/v2/pubsub",
13 ],
14 outs = [
15 "testdata/auth_proxy_manifests.yaml",
16 "testdata/authservice_manifests.yaml",
17 "testdata/eagateway_manifests.yaml",
18 "testdata/rulesengine_manifests.yaml",
19 "testdata/userservice_manifests.yaml",
20 "testdata/mockbffserver_manifests.yaml",
21 "testdata/pubsub_manifests.yaml",
22 ],
23 # cmd runs a shell command to concatenate the contents of the srcs files into the outs files for each config
24 cmd = """
25 mkdir -p $(RULEDIR)/testdata/ && \
26 idx=0 && \
27 for src in $(SRCS); do \
28 out=$$(echo $(OUTS) | cut -d' ' -f$$((idx + 1))) && \
29 idx=$$((idx + 1)) && \
30 cat $$src >> $$out; \
31 done
32 """,
33)
34
35go_test(
36 name = "ea_integration_test",
37 srcs = ["ea_v2_integration_test.go"],
38 data = [
39 "//hack/tools:etcd",
40 "//hack/tools:kube-apiserver",
41 "//hack/tools:kubectl",
42 ],
43 embed = [":ea_integration"],
44 embedsrcs = [
45 "testdata/README.md",
46 "testdata/auth_proxy_manifests.yaml",
47 "testdata/authservice_manifests.yaml",
48 "testdata/eagateway_manifests.yaml",
49 "testdata/rulesengine_manifests.yaml",
50 "testdata/userservice_manifests.yaml",
51 "testdata/mockbffserver_manifests.yaml",
52 "testdata/pubsub_manifests.yaml",
53 ],
54 tags = [
55 "integration",
56 "needs-f2-refactor",
57 "requires-network",
58 ],
59 visibility = ["//visibility:public"],
60 deps = [
61 "//pkg/sds/emergencyaccess/emulatorsvc",
62 "//test/f2",
63 "//test/f2/fctx",
64 "//test/f2/integration",
65 "//test/f2/x/ktest",
66 "//test/f2/x/ktest/envtest",
67 "//test/f2/x/postgres",
68 "@com_github_stretchr_testify//assert",
69 "@com_github_stretchr_testify//require",
70 "@com_google_cloud_go_pubsub//:pubsub",
71 "@org_golang_google_api//option",
72 "@org_golang_google_api//option/internaloption",
73 "@org_golang_google_grpc//:grpc",
74 "@org_golang_google_grpc//credentials/insecure",
75 ],
76)
77
78go_library(
79 name = "ea_integration",
80 srcs = [
81 "helpers.go",
82 "manifests.go",
83 "seed.go",
84 ],
85 importpath = "edge-infra.dev/pkg/sds/emergencyaccess/ea_integration/v2",
86 visibility = ["//visibility:private"],
87 deps = [
88 "//pkg/edge/api/sql/plugin",
89 "//pkg/edge/api/sql/utils",
90 "//pkg/k8s/decoder",
91 "//pkg/k8s/testing/kmp",
92 "//pkg/k8s/unstructured",
93 "//test/f2",
94 "//test/f2/x/ktest",
95 "//test/f2/x/postgres",
96 "@com_github_google_uuid//:uuid",
97 "@com_github_stretchr_testify//assert",
98 "@com_github_stretchr_testify//require",
99 "@com_google_cloud_go_pubsub//:pubsub",
100 "@io_k8s_sigs_kustomize_api//filters/namespace",
101 "@io_k8s_sigs_kustomize_api//types",
102 "@io_k8s_sigs_kustomize_kyaml//kio",
103 "@io_k8s_sigs_kustomize_kyaml//yaml",
104 ],
105)
View as plain text