Skip to content

Commit 79f6cd7

Browse files
author
Matt Mackay
authored
chore: add smoke test to e2e/use_release (#370)
1 parent ba7fcf9 commit 79f6cd7

File tree

7 files changed

+48
-13
lines changed

7 files changed

+48
-13
lines changed

.bcr/presubmit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ bcr_test_module:
99
name: "Run test module"
1010
bazel: ${{ bazel }}
1111
platform: ${{ platform }}
12+
test_flags:
13+
# Bazel 6.x requires this flag set.
14+
- --@aspect_rules_py//py:interpreter_version=3.8.12
1215
test_targets:
1316
- "//..."

e2e/use_release/BUILD.bazel

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
load("@aspect_rules_py//py:defs.bzl", "py_binary")
1+
load("@aspect_rules_py//py:defs.bzl", "py_binary", "py_test")
22

33
py_binary(
44
name = "main",
5-
srcs = ["__main__.py"],
5+
srcs = [
6+
"__init__.py",
7+
"__main__.py",
8+
],
9+
main = "__main__.py",
10+
)
11+
12+
py_test(
13+
name = "test",
14+
srcs = ["test.py"],
15+
deps = [
16+
":main",
17+
],
618
)

e2e/use_release/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def welcome(name):
2+
return "hello %s" % name

e2e/use_release/__main__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
print("hello world")
1+
from __init__ import welcome
2+
3+
if __name__ == "__main__":
4+
print(welcome("world"))

e2e/use_release/minimal_download_test.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fi
1111

1212
# This test references pre-built artifacts from a prior release.
1313
# Will need to bump this version in the future when there are breaking changes.
14-
export RULES_PY_RELEASE_VERSION=0.7.3
14+
export RULES_PY_RELEASE_VERSION=0.7.4
1515

1616
#############
1717
# Test bzlmod
@@ -59,3 +59,13 @@ then
5959
>&2 echo "ERROR: we fetched a rust repository"
6060
exit 1
6161
fi
62+
63+
#############
64+
# Smoke test
65+
bazel test --test_output=streamed //...
66+
67+
(
68+
cd ../..
69+
rm MODULE.bazel
70+
mv MODULE.bazel.orig MODULE.bazel
71+
)

e2e/use_release/test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from __init__ import welcome
2+
3+
def test_welcome():
4+
greeting = welcome("world")
5+
assert greeting == "Hello world"

tools/integrity.bzl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ This file contents are entirely replaced during release publishing.
44
The checked in content is only here to allow load() statements in the sources to resolve.
55
"""
66

7-
# TEST DATA extracted from tools/integrity.bzl file within https://github.com/aspect-build/rules_py/releases/download/v0.7.3/rules_py-v0.7.3.tar.gz
7+
# TEST DATA extracted from tools/integrity.bzl file within https://github.com/aspect-build/rules_py/releases/download/v0.7.4/rules_py-v0.7.4.tar.gz
88
RELEASED_BINARY_INTEGRITY = {
9-
"unpack-aarch64-apple-darwin": "7b707566f3d47faae3f27715fb1ae1689d3d1003c21b60d344c644fdee54aef9",
10-
"unpack-x86_64-apple-darwin": "6e10eb9c8a336adf2c091fd0de73a0e6a2e9ff104829a2516f1283b1429deaea",
11-
"venv-aarch64-apple-darwin": "cda216aed9cb6c6a9d9d5627f5d109139536d94e206e5248b1027bd0fbc42342",
12-
"venv-x86_64-apple-darwin": "12ea7c3e0a660322059610aac6ce05c93667a17cfa3f3585d442e9e4815edef0",
13-
"unpack-aarch64-unknown-linux-gnu": "e6da0ffc82b462ec14e6e660c396bc9530d7f1588729e3dd6500508c661e1819",
14-
"unpack-x86_64-unknown-linux-gnu": "35fc4335877a852a6fa1bd3ac2f99d756376ef8540d1bfa36ac7abf9c4fcc8f8",
15-
"venv-aarch64-unknown-linux-gnu": "b51756d0d66a0defcc176c2363f649a698e235f56f6d6cbc3bc2142fb99b0240",
16-
"venv-x86_64-unknown-linux-gnu": "79e753c51d51c37d77151e2c36df52d5f0eb9b301e6001274a92ce9d0cdf67cd",
9+
"unpack-aarch64-apple-darwin": "791c711bba95829118920553489537d156c320163876f2435e017c07bfcbd30a",
10+
"unpack-x86_64-apple-darwin": "2a060c679e376e951877c4179824fa3bb8edd8674b7ec430585a4f83650ad910",
11+
"venv-aarch64-apple-darwin": "a355e4338e7c2312d8366386ad981ed6864a65214d38ed6bd756ba19b532aa05",
12+
"venv-x86_64-apple-darwin": "af56a742e79d64a30bae422c46a9d6c7edc77df107a8bb96f826967059eff96b",
13+
"unpack-aarch64-unknown-linux-gnu": "84a2603b5c521346c22431f73af54c54ebed50ddcb19740fa958c8ad870723dc",
14+
"unpack-x86_64-unknown-linux-gnu": "4e21607baa25108b7ca322b57dcf5fd94545e0960e8d7f2b449e84c5e68ec9cc",
15+
"venv-aarch64-unknown-linux-gnu": "56be3172bbb95007120a2183dff0dcb204b7e0464bd0197397bb86198bb5d7ba",
16+
"venv-x86_64-unknown-linux-gnu": "c09b7f8d0af9cde213f658e9b43444709f687e4d7e1d67941c661525432092a4",
1717
}

0 commit comments

Comments
 (0)