Skip to content

Commit 17a6f82

Browse files
authored
Update test-tensorflow-switching.yml
1 parent 0190b74 commit 17a6f82

1 file changed

Lines changed: 16 additions & 29 deletions

File tree

.github/workflows/test-tensorflow-switching.yml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: TensorFlow Complex Dependency Switching
1+
name: TensorFlow Complex Dependency Test
22

33
on:
44
push:
@@ -87,44 +87,31 @@ jobs:
8787
- name: Run the Demo - TensorFlow
8888
id: run_demo
8989
run: |
90-
echo "--- Running Omnipkg Demo for TensorFlow (Complex Dependencies) ---"
90+
echo "--- Running Omnipkg Demo for TensorFlow (Complex Dependency Testing) ---"
9191
mkdir -p /tmp/omnipkg-artifacts
9292
93-
# Clear output file and track run count
94-
rm -f /tmp/omnipkg-artifacts/tensorflow_demo_output.txt
95-
echo "Starting demo run" > /tmp/omnipkg-artifacts/run_count.txt
96-
97-
# Run demo once
98-
timeout 900 bash -c 'echo "4" | omnipkg demo 2>&1 | tee /tmp/omnipkg-artifacts/tensorflow_demo_output.txt'
93+
timeout 1200 bash -c 'echo "3" | omnipkg demo 2>&1 | tee /tmp/omnipkg-artifacts/tensorflow_demo_output.txt'
9994
DEMO_EXIT_CODE=$?
10095
101-
# Check run count
102-
RUN_COUNT=$(grep -c "Starting demo run" /tmp/omnipkg-artifacts/run_count.txt)
103-
echo "DEBUG: Demo run count: $RUN_COUNT"
104-
if [ "$RUN_COUNT" -ne 1 ]; then
105-
echo "Error: Demo ran $RUN_COUNT times instead of once."
106-
cat /tmp/omnipkg-artifacts/tensorflow_demo_output.txt
107-
exit 1
108-
fi
109-
11096
echo "## TensorFlow Demo Output" >> $GITHUB_STEP_SUMMARY
11197
echo '```' >> $GITHUB_STEP_SUMMARY
11298
cat /tmp/omnipkg-artifacts/tensorflow_demo_output.txt >> $GITHUB_STEP_SUMMARY
11399
echo '```' >> $GITHUB_STEP_SUMMARY
114100
115101
if [ $DEMO_EXIT_CODE -eq 0 ] || \
116-
(grep -q "ALL TENSORFLOW TESTS PASSED" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt && \
117-
grep -q "Demo completed successfully" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt); then
118-
echo "Demo completed successfully (exit code $DEMO_EXIT_CODE, logs verified)."
119-
echo "demo_outcome=success" >> $GITHUB_OUTPUT
120-
PASSED_COUNT=$(grep -c "PASSED" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt || echo "0")
121-
if [ "$PASSED_COUNT" -ge 4 ] && grep -q "tensorflow==2.13.0" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt; then
122-
echo "TensorFlow demo verified: Found $PASSED_COUNT PASSED results (expected at least 4) and tensorflow==2.13.0!"
123-
else
124-
echo "Error: Expected at least 4 PASSED results and tensorflow==2.13.0, but found only $PASSED_COUNT or missing tensorflow version."
125-
cat /tmp/omnipkg-artifacts/tensorflow_demo_output.txt
126-
exit 1
127-
fi
102+
(grep -q "ALL TESTS PASSED!" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt && \
103+
grep -q "Demo completed successfully" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt); then
104+
echo "Demo completed successfully (exit code $DEMO_EXIT_CODE, logs verified)."
105+
echo "demo_outcome=success" >> $GITHUB_OUTPUT
106+
if grep -q "tensorflow==" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt && \
107+
grep -q "ALL TESTS PASSED!" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt; then
108+
echo "TensorFlow demo verified: TensorFlow versions switched successfully, all tests passed!"
109+
else
110+
echo "Error: Expected TensorFlow demo output not found."
111+
echo "Missing one of: 'tensorflow==', or 'ALL TESTS PASSED!'"
112+
cat /tmp/omnipkg-artifacts/tensorflow_demo_output.txt
113+
exit 1
114+
fi
128115
else
129116
echo "Demo failed with exit code $DEMO_EXIT_CODE."
130117
echo "demo_outcome=failure" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)