Skip to content

Commit b886744

Browse files
UebelAndregravypod
authored andcommitted
Removed python test dependencies from public API
1 parent cd06d6d commit b886744

File tree

6 files changed

+98
-95
lines changed

6 files changed

+98
-95
lines changed

.bazelci/presubmit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ tasks:
109109
- -//tests/docker/util:test_extracted_file
110110
- -//tests/docker/util:test_extracted_file_impl
111111
# Tests included on macos
112-
- //container:image_test
113112
- //container/go/pkg/compat:go_default_test
114113
- //container/go/pkg/oci:go_default_test
115114
- //docker/util:config_stripper_test
@@ -125,6 +124,7 @@ tasks:
125124
- //tests/container:distroless_fixed_id_digest_test_impl
126125
- //tests/container:distroless_fixed_id_image_digest_test
127126
- //tests/container:distroless_fixed_id_image_digest_test_impl
127+
- //tests/container:image_test
128128
- //tests/container:k8s_pause_arm64_digest_test
129129
- //tests/container:k8s_pause_arm64_digest_test_impl
130130
- //tests/container:pause_tar_test_0_tar_gz

WORKSPACE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ container_deps()
3939

4040
load("//repositories:images.bzl", test_images = "images")
4141

42+
# py_deps are test dependencies only
43+
load("//repositories:py_repositories.bzl", "py_deps")
44+
45+
py_deps()
46+
4247
test_images()
4348

4449
load(

container/BUILD

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -50,97 +50,6 @@ py_library(
5050
visibility = ["//visibility:public"],
5151
)
5252

53-
TEST_TARGETS = [
54-
":base_with_entrypoint",
55-
":base_with_volume",
56-
":derivative_with_cmd",
57-
":derivative_with_shadowed_cmd",
58-
":derivative_with_volume",
59-
":directory_with_tar_base",
60-
":files_base",
61-
":files_with_files_base",
62-
":files_in_layer_with_files_base",
63-
":files_with_tar_base",
64-
":tar_base",
65-
":tar_with_mtimes_preserved",
66-
":tar_with_files_base",
67-
":tar_with_tar_base",
68-
":tars_in_layer_with_tar_base",
69-
":docker_tarball_base",
70-
":layers_with_docker_tarball_base",
71-
# TODO(mattmoor): Re-enable once archive is visible
72-
# "generated_tarball",
73-
":with_unix_epoch_creation_time",
74-
":with_millisecond_unix_epoch_creation_time",
75-
":with_rfc_3339_creation_time",
76-
":with_stamped_creation_time",
77-
":with_default_stamped_creation_time",
78-
":with_base_stamped_image",
79-
":with_env",
80-
":layers_with_env",
81-
":with_double_env",
82-
":with_label",
83-
":with_double_label",
84-
":with_stamp_label",
85-
":with_user",
86-
":workdir_with_tar_base",
87-
":link_with_files_base",
88-
":build_with_tag",
89-
":with_passwd",
90-
":with_passwd_tar",
91-
":with_group",
92-
":with_empty_files",
93-
":with_empty_dirs",
94-
":gen_image",
95-
":data_path_image",
96-
":no_data_path_image",
97-
":absolute_data_path_image",
98-
":root_data_path_image",
99-
":dummy_repository",
100-
# TODO(mattmoor): Re-enable once archive is visible
101-
# "extras_with_deb",
102-
":bundle_test",
103-
":stamped_bundle_test",
104-
":pause_based",
105-
":dashdash_entrypoint",
106-
":base_based_warning",
107-
":cc_based_warning",
108-
"/pause_piecemeal:image",
109-
"/pause_piecemeal_gz:image",
110-
# Re-enable once https://github.com/bazelbuild/rules_d/issues/14 is fixed.
111-
# "d_image",
112-
":java_image",
113-
":py_image",
114-
":py_image_with_symlinks_in_data",
115-
":py_image_complex",
116-
":war_image",
117-
":flat",
118-
":flatten_with_tarball_base",
119-
":nodejs_image",
120-
":compressed_experiment",
121-
]
122-
123-
TEST_DATA = [
124-
"//testdata%s.tar" % t
125-
for t in TEST_TARGETS
126-
] + [
127-
"//testdata:push_compression_gzip_fast",
128-
"//testdata:push_compression_gzip_normal",
129-
"//testdata:stamped_bundle_test",
130-
"//testdata:stamp_info_file.txt",
131-
"//tests/container:basic_windows_image.tar",
132-
]
133-
134-
py_test(
135-
name = "image_test",
136-
size = "medium",
137-
srcs = ["image_test.py"],
138-
data = TEST_DATA,
139-
python_version = "PY3",
140-
srcs_version = "PY3",
141-
deps = ["@containerregistry"],
142-
)
143-
14453
bzl_library(
14554
name = "bundle",
14655
srcs = ["bundle.bzl"],

repositories/deps.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ repository.
2020
"""
2121

2222
load(":go_repositories.bzl", "go_deps")
23-
load(":py_repositories.bzl", "py_deps")
2423

2524
def deps():
2625
"""Pull in external dependencies needed by rules in this repo.
@@ -31,4 +30,3 @@ def deps():
3130
already.
3231
"""
3332
go_deps()
34-
py_deps()

tests/container/BUILD

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,3 +878,94 @@ bzl_library(
878878
srcs = ["pull_info_validation_test.bzl"],
879879
visibility = ["//visibility:private"],
880880
)
881+
882+
TEST_TARGETS = [
883+
":base_with_entrypoint",
884+
":base_with_volume",
885+
":derivative_with_cmd",
886+
":derivative_with_shadowed_cmd",
887+
":derivative_with_volume",
888+
":directory_with_tar_base",
889+
":files_base",
890+
":files_with_files_base",
891+
":files_in_layer_with_files_base",
892+
":files_with_tar_base",
893+
":tar_base",
894+
":tar_with_mtimes_preserved",
895+
":tar_with_files_base",
896+
":tar_with_tar_base",
897+
":tars_in_layer_with_tar_base",
898+
":docker_tarball_base",
899+
":layers_with_docker_tarball_base",
900+
# TODO(mattmoor): Re-enable once archive is visible
901+
# "generated_tarball",
902+
":with_unix_epoch_creation_time",
903+
":with_millisecond_unix_epoch_creation_time",
904+
":with_rfc_3339_creation_time",
905+
":with_stamped_creation_time",
906+
":with_default_stamped_creation_time",
907+
":with_base_stamped_image",
908+
":with_env",
909+
":layers_with_env",
910+
":with_double_env",
911+
":with_label",
912+
":with_double_label",
913+
":with_stamp_label",
914+
":with_user",
915+
":workdir_with_tar_base",
916+
":link_with_files_base",
917+
":build_with_tag",
918+
":with_passwd",
919+
":with_passwd_tar",
920+
":with_group",
921+
":with_empty_files",
922+
":with_empty_dirs",
923+
":gen_image",
924+
":data_path_image",
925+
":no_data_path_image",
926+
":absolute_data_path_image",
927+
":root_data_path_image",
928+
":dummy_repository",
929+
# TODO(mattmoor): Re-enable once archive is visible
930+
# "extras_with_deb",
931+
":bundle_test",
932+
":stamped_bundle_test",
933+
":pause_based",
934+
":dashdash_entrypoint",
935+
":base_based_warning",
936+
":cc_based_warning",
937+
"/pause_piecemeal:image",
938+
"/pause_piecemeal_gz:image",
939+
# Re-enable once https://github.com/bazelbuild/rules_d/issues/14 is fixed.
940+
# "d_image",
941+
":java_image",
942+
":py_image",
943+
":py_image_with_symlinks_in_data",
944+
":py_image_complex",
945+
":war_image",
946+
":flat",
947+
":flatten_with_tarball_base",
948+
":nodejs_image",
949+
":compressed_experiment",
950+
]
951+
952+
TEST_DATA = [
953+
"//testdata%s.tar" % t
954+
for t in TEST_TARGETS
955+
] + [
956+
"//testdata:push_compression_gzip_fast",
957+
"//testdata:push_compression_gzip_normal",
958+
"//testdata:stamped_bundle_test",
959+
"//testdata:stamp_info_file.txt",
960+
"//tests/container:basic_windows_image.tar",
961+
]
962+
963+
py_test(
964+
name = "image_test",
965+
size = "medium",
966+
srcs = ["image_test.py"],
967+
data = TEST_DATA,
968+
python_version = "PY3",
969+
srcs_version = "PY3",
970+
deps = ["@containerregistry"],
971+
)

container/image_test.py renamed to tests/container/image_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def test_with_default_stamped_creation_time(self):
300300
# https://bazel-review.googlesource.com/c/bazel/+/48211
301301
# Assume that any value for 'created' within a reasonable bound is fine.
302302
self.assertLessEqual(now - created, datetime.timedelta(minutes=15))
303-
303+
304304
def test_with_base_stamped_image(self):
305305
# {BUILD_TIMESTAMP} should be the default when `stamp = True` is configured
306306
# in the base image and `creation_time` isn't explicitly defined.

0 commit comments

Comments
 (0)