Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 429c016

Browse files
committedApr 9, 2024·
Move the log removal logic to the script instead of the workflow yaml file.
1 parent 7e2759b commit 429c016

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed
 

‎.github/workflows/examples-linux-tv-casting-app.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ jobs:
6666
./scripts/run_in_build_env.sh \
6767
"python3 ./scripts/tests/run_tv_casting_test.py test-discovery"
6868
69-
- name: Remove Linux tv-casting-app and Linux tv-app log files
70-
run: |
71-
"rm ./scripts/tests/Linux-tv-casting-app-logs.txt \
72-
rm ./scripts/tests/Linux-tv-app-logs.txt"
73-
7469
- name: Uploading Size Reports
7570
uses: ./.github/actions/upload-size-reports
7671
if: ${{ !env.ACT }}

‎scripts/tests/run_tv_casting_test.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
import sys
2121
import time
2222

23+
def remove_log_file(log_file):
24+
if os.path.exists(log_file):
25+
os.remove(log_file)
26+
else:
27+
print("The file does not exist.")
28+
2329
def read_logs(log_file):
2430

2531
with open(log_file, 'r') as file:
@@ -41,6 +47,11 @@ def read_logs(log_file):
4147
if "cast request 0" in line:
4248
print(line)
4349
found_cast_request_0 = True
50+
51+
remove_log_file('./scripts/tests/Linux-tv-casting-app-logs.txt')
52+
remove_log_file('./scripts/tests/Linux-tv-app-logs.txt')
53+
54+
break
4455

4556
if "No commissioner discovered" in line:
4657
print(line)
@@ -100,7 +111,7 @@ def read_logs(log_file):
100111
sys.exit(1)
101112

102113
# Print the list of discovered commissioners
103-
print("Discovered Commissioners:")
114+
print("Discovered Commissioner(s):")
104115
for discovered_commissioner in discovered_commissioners:
105116
print(discovered_commissioner)
106117

0 commit comments

Comments
 (0)
Please sign in to comment.