Skip to content

Commit ff79edf

Browse files
Add test to check that playlist file is not empty (#1)
1 parent e9acded commit ff79edf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ jobs:
112112
echo "✅ Playlist file created successfully"
113113
echo "Content:"
114114
cat "./TestResults/sample.playlist"
115+
# Ensure playlist is not empty
116+
if [ ! -s "./TestResults/sample.playlist" ]; then
117+
echo "❌ Playlist file is empty"
118+
exit 1
119+
fi
120+
# Ensure playlist contains at least one test name (e.g., TestMethod1 or TestMethod2)
121+
if grep -q "TestMethod" "./TestResults/sample.playlist"; then
122+
echo "✅ Playlist contains test names"
123+
else
124+
echo "❌ Playlist does not contain any test names"
125+
exit 1
126+
fi
115127
else
116128
echo "❌ Playlist file not found"
117129
exit 1
@@ -131,6 +143,18 @@ jobs:
131143
echo "✅ Custom playlist file created successfully"
132144
echo "Content:"
133145
cat "./custom-playlist.playlist"
146+
# Ensure playlist is not empty
147+
if [ ! -s "./custom-playlist.playlist" ]; then
148+
echo "❌ Custom playlist file is empty"
149+
exit 1
150+
fi
151+
# Ensure playlist contains at least one test name (e.g., TestMethod1 or TestMethod2)
152+
if grep -q "TestMethod" "./custom-playlist.playlist"; then
153+
echo "✅ Custom playlist contains test names"
154+
else
155+
echo "❌ Custom playlist does not contain any test names"
156+
exit 1
157+
fi
134158
else
135159
echo "❌ Custom playlist file not found"
136160
exit 1

0 commit comments

Comments
 (0)