From 78ce3fb658df34fd00310bef713056eadba21c89 Mon Sep 17 00:00:00 2001 From: Charles Guo Date: Tue, 23 Jul 2024 00:44:09 -0400 Subject: [PATCH] Fix worker tests in mc_manager --- mc_manager/worker/BUILD.bazel | 14 ++++++++------ mc_manager/worker/tests/BUILD.bazel | 18 +++++------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/mc_manager/worker/BUILD.bazel b/mc_manager/worker/BUILD.bazel index c770180e..bfe10018 100644 --- a/mc_manager/worker/BUILD.bazel +++ b/mc_manager/worker/BUILD.bazel @@ -1,5 +1,5 @@ load("@py_deps//:requirements.bzl", "requirement") -load("@rules_python//python:defs.bzl", "py_binary") +load("@rules_python//python:defs.bzl", "py_binary", "py_library") load("//tools/build_rules:cross_platform_image.bzl", "cross_platform_image") load("//tools/build_rules:py_layer.bzl", "py_oci_image") @@ -19,13 +19,15 @@ py_library( py_binary( name = "binary", - srcs = [ - "__init__.py", - "worker.py", - ], + srcs = ["worker.py"], imports = [".."], main = "worker.py", - deps = DEPS, + visibility = ["//:__subpackages__"], + deps = [ + "@py_deps//boto3", + "@py_deps//docker", + "@py_deps//requests", + ], ) py_oci_image( diff --git a/mc_manager/worker/tests/BUILD.bazel b/mc_manager/worker/tests/BUILD.bazel index 6a27b338..ef17f59e 100644 --- a/mc_manager/worker/tests/BUILD.bazel +++ b/mc_manager/worker/tests/BUILD.bazel @@ -1,19 +1,11 @@ -load("@py_deps//:requirements.bzl", "requirement") load("@rules_python//python:defs.bzl", "py_test") -_RUNTIME_DEPS = [ - requirement("boto3"), - requirement("docker"), - requirement("requests"), -] - py_test( - name = "default_tests", + name = "worker_test", srcs = ["worker_test.py"], - main = "worker_test.py", deps = [ - requirement("pytest"), - requirement("pysocks"), - "//mc_manager/worker:library", - ] + _RUNTIME_DEPS, + "//mc_manager/worker:binary", + "@py_deps//pytest", + "@py_deps//requests", + ], )