Skip to content

Commit 5abc22d

Browse files
committed
Merge branch 'add_presets_to_Sdk' of github.com:hasty/connectedhomeip into add_presets_to_Sdk
2 parents b4f50f6 + 51d8aaa commit 5abc22d

File tree

2 files changed

+45
-9
lines changed

2 files changed

+45
-9
lines changed

scripts/helpers/restyle-diff.sh

+44-8
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
# you've written is kosher to CI
2222
#
2323
# Usage:
24-
# restyle-diff.sh [ref]
24+
# restyle-diff.sh [-d] [ref]
2525
#
2626
# if unspecified, ref defaults to upstream/master (or master)
27+
# -d sets container's log level to DEBUG, if unspecified the default log level will remain (info level)
2728
#
2829

2930
here=${0%/*}
@@ -33,20 +34,55 @@ set -e
3334
CHIP_ROOT=$(cd "$here/../.." && pwd)
3435
cd "$CHIP_ROOT"
3536

36-
restyle-paths() {
37-
if hash restyle-path 2>/dev/null; then
38-
echo "$@" | xargs restyle-path
37+
docker_run() {
38+
if [ -t 0 ]; then
39+
exec docker run --tty "$@"
40+
3941
else
40-
url=https://github.com/restyled-io/restyler/raw/main/bin/restyle-path
41-
echo "$@" | xargs sh <(curl --location --proto "=https" --tlsv1.2 "$url" -sSf)
42+
exec docker run "$@"
43+
4244
fi
4345
}
4446

45-
ref="$1"
47+
restyle-paths() {
48+
49+
image=restyled/restyler:edge
50+
51+
for path in "$@"; do
52+
(
53+
docker_run --tty --interactive --rm \
54+
--env LOG_LEVEL \
55+
--env LOG_DESTINATION \
56+
--env LOG_FORMAT \
57+
--env LOG_COLOR \
58+
--env HOST_DIRECTORY="$PWD" \
59+
--env UNRESTRICTED=1 \
60+
--volume "$PWD":/code \
61+
--volume /tmp:/tmp \
62+
--volume /var/run/docker.sock:/var/run/docker.sock \
63+
--entrypoint restyle-path \
64+
"$image" "$path"
65+
)
66+
done
67+
}
68+
69+
while [[ $# -gt 0 ]]; do
70+
case "$1" in
71+
-d)
72+
export LOG_LEVEL="DEBUG"
73+
shift
74+
;;
75+
*)
76+
ref="$1"
77+
shift
78+
;;
79+
esac
80+
done
81+
4682
if [[ -z "$ref" ]]; then
4783
ref="master"
4884
git remote | grep -qxF upstream && ref="upstream/master"
4985
fi
5086

51-
declare -a paths=("$(git diff --ignore-submodules --name-only --merge-base "$ref")")
87+
mapfile -t paths < <(git diff --ignore-submodules --name-only --merge-base "$ref")
5288
restyle-paths "${paths[@]}"

src/python_testing/matter_testing_support.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,7 @@ def per_endpoint_test(accept_function: EndpointCheckFunction):
18151815
def per_endpoint_test_internal(body):
18161816
def per_endpoint_runner(self: MatterBaseTest, *args, **kwargs):
18171817
asserts.assert_false(self.get_test_pics(self.current_test_info.name), "pics_ method supplied for per_endpoint_test.")
1818-
runner_with_timeout = asyncio.wait_for(get_accepted_endpoints_for_test(self, accept_function), timeout=5)
1818+
runner_with_timeout = asyncio.wait_for(get_accepted_endpoints_for_test(self, accept_function), timeout=30)
18191819
endpoints = asyncio.run(runner_with_timeout)
18201820
if not endpoints:
18211821
logging.info("No matching endpoints found - skipping test")

0 commit comments

Comments
 (0)