-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow some common rule args in verify_archive_test (#917)
* Forward kwargs from verify_archive_test to py_test * Add verify_archive test suite * use visibility:private * use allowlist for common attrs * reorder tests to retrigger flaky CI * Add a link to all supported kwargs
- Loading branch information
Showing
2 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Copyright 2025 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# -*- coding: utf-8 -*- | ||
"""Tests for verify_archive.""" | ||
|
||
load("//pkg:tar.bzl", "pkg_tar") | ||
load("//pkg:verify_archive.bzl", "verify_archive_test") | ||
|
||
# Test data | ||
|
||
pkg_tar( | ||
name = "loremipsum_tar", | ||
srcs = [ | ||
"//tests:loremipsum_txt", | ||
], | ||
) | ||
|
||
pkg_tar( | ||
name = "loremipsum_tar_test_only", | ||
testonly = True, | ||
srcs = [ | ||
"//tests:loremipsum_txt", | ||
], | ||
) | ||
|
||
# Test cases | ||
|
||
verify_archive_test( | ||
name = "test_py_test_attrs_is_allowed", | ||
size = "small", | ||
timeout = "moderate", | ||
flaky = True, | ||
target = ":loremipsum_tar", | ||
) | ||
|
||
verify_archive_test( | ||
name = "test_testonly_is_allowed", | ||
testonly = True, | ||
target = ":loremipsum_tar_test_only", | ||
) | ||
|
||
verify_archive_test( | ||
name = "test_visibility_is_allowed", | ||
target = ":loremipsum_tar", | ||
visibility = ["//visibility:private"], | ||
) | ||
|
||
verify_archive_test( | ||
name = "test_target_compatible_with_is_allowed", | ||
target = ":loremipsum_tar", | ||
target_compatible_with = ["@platforms//cpu:x86_64"], | ||
) | ||
|
||
verify_archive_test( | ||
name = "test_tags_are_allowed", | ||
tags = ["test_tag"], | ||
target = ":loremipsum_tar", | ||
) |