157 lines
3.4 KiB
Python
157 lines
3.4 KiB
Python
load("//databuild:rules.bzl", "databuild_graph", "databuild_job")
|
|
|
|
py_library(
|
|
name = "job_src",
|
|
srcs = glob(["**/*.py"]),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//databuild:py_proto",
|
|
"//databuild/dsl/python:dsl",
|
|
],
|
|
)
|
|
|
|
# Tests
|
|
py_test(
|
|
name = "test_trailing_color_votes",
|
|
srcs = ["jobs/trailing_color_votes/test.py"],
|
|
main = "jobs/trailing_color_votes/test.py",
|
|
deps = [
|
|
":job_src",
|
|
"//databuild/test/app:job_src",
|
|
],
|
|
)
|
|
|
|
py_test(
|
|
name = "test_ingest_color_votes",
|
|
srcs = ["jobs/ingest_color_votes/test.py"],
|
|
main = "jobs/ingest_color_votes/test.py",
|
|
deps = [
|
|
":job_src",
|
|
"//databuild/test/app:job_src",
|
|
],
|
|
)
|
|
|
|
py_test(
|
|
name = "test_aggregate_color_votes",
|
|
srcs = ["jobs/aggregate_color_votes/test.py"],
|
|
main = "jobs/aggregate_color_votes/test.py",
|
|
deps = [
|
|
":job_src",
|
|
"//databuild/test/app:job_src",
|
|
],
|
|
)
|
|
|
|
py_test(
|
|
name = "test_color_vote_report_calc",
|
|
srcs = ["jobs/color_vote_report_calc/test.py"],
|
|
main = "jobs/color_vote_report_calc/test.py",
|
|
deps = [
|
|
":job_src",
|
|
"//databuild/test/app:job_src",
|
|
],
|
|
)
|
|
|
|
py_test(
|
|
name = "test_graph_analysis",
|
|
srcs = ["graph/graph_test.py"],
|
|
data = [
|
|
":bazel_graph.analyze",
|
|
":bazel_graph_lookup",
|
|
],
|
|
main = "graph/graph_test.py",
|
|
deps = [
|
|
":job_src",
|
|
"//databuild/test/app:job_src",
|
|
],
|
|
)
|
|
|
|
py_test(
|
|
name = "test_e2e",
|
|
srcs = ["test_e2e.py"],
|
|
data = [":bazel_graph.build"],
|
|
main = "test_e2e.py",
|
|
deps = ["//databuild/test/app:e2e_test_common"],
|
|
)
|
|
|
|
# Bazel-defined
|
|
## Graph
|
|
databuild_graph(
|
|
name = "bazel_graph",
|
|
jobs = [
|
|
":ingest_color_votes",
|
|
":trailing_color_votes",
|
|
":aggregate_color_votes",
|
|
":color_vote_report_calc",
|
|
],
|
|
lookup = ":bazel_graph_lookup",
|
|
)
|
|
|
|
py_binary(
|
|
name = "bazel_graph_lookup",
|
|
srcs = ["graph/lookup.py"],
|
|
main = "graph/lookup.py",
|
|
)
|
|
|
|
## Ingest Color Votes
|
|
databuild_job(
|
|
name = "ingest_color_votes",
|
|
binary = ":ingest_color_votes_binary",
|
|
)
|
|
|
|
py_binary(
|
|
name = "ingest_color_votes_binary",
|
|
srcs = ["jobs/ingest_color_votes/main.py"],
|
|
main = "jobs/ingest_color_votes/main.py",
|
|
deps = [
|
|
":job_src",
|
|
"//databuild/test/app:job_src",
|
|
],
|
|
)
|
|
|
|
## Trailing Color Votes
|
|
databuild_job(
|
|
name = "trailing_color_votes",
|
|
binary = ":trailing_color_votes_binary",
|
|
)
|
|
|
|
py_binary(
|
|
name = "trailing_color_votes_binary",
|
|
srcs = ["jobs/trailing_color_votes/main.py"],
|
|
main = "jobs/trailing_color_votes/main.py",
|
|
deps = [
|
|
":job_src",
|
|
"//databuild/test/app:job_src",
|
|
],
|
|
)
|
|
|
|
## Aggregate Color Votes
|
|
databuild_job(
|
|
name = "aggregate_color_votes",
|
|
binary = ":aggregate_color_votes_binary",
|
|
)
|
|
|
|
py_binary(
|
|
name = "aggregate_color_votes_binary",
|
|
srcs = ["jobs/aggregate_color_votes/main.py"],
|
|
main = "jobs/aggregate_color_votes/main.py",
|
|
deps = [
|
|
":job_src",
|
|
"//databuild/test/app:job_src",
|
|
],
|
|
)
|
|
|
|
## Color Vote Report Calc
|
|
databuild_job(
|
|
name = "color_vote_report_calc",
|
|
binary = ":color_vote_report_calc_binary",
|
|
)
|
|
|
|
py_binary(
|
|
name = "color_vote_report_calc_binary",
|
|
srcs = ["jobs/color_vote_report_calc/main.py"],
|
|
main = "jobs/color_vote_report_calc/main.py",
|
|
deps = [
|
|
":job_src",
|
|
"//databuild/test/app:job_src",
|
|
],
|
|
)
|