Skip to content

Commit da05c32

Browse files
authored
Update test-tensorflow-switching.yml
1 parent 4746290 commit da05c32

1 file changed

Lines changed: 22 additions & 12 deletions

File tree

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

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
python -m pip install --upgrade pip
3636
pip install -e . redis tensorflow==2.13.0
3737
38-
- name: ⚙️ Configure omnipkg for non-interactive use
38+
- name: ⚙️ Configure omnipkg
3939
run: |
4040
python - << 'EOF'
4141
import sys
@@ -45,16 +45,12 @@ jobs:
4545
import os
4646
import sysconfig
4747
48-
# Get site-packages path safely
4948
try:
5049
site_packages_path = site.getsitepackages()[0]
5150
except (IndexError, AttributeError):
5251
site_packages_path = sysconfig.get_paths()['purelib']
5352
54-
# Determine project root (where pyproject.toml is)
5553
project_root = Path(os.environ['GITHUB_WORKSPACE'])
56-
57-
# Verify builder script exists
5854
builder_script = project_root / 'omnipkg' / 'package_meta_builder.py'
5955
if not builder_script.exists():
6056
print(f"Error: {builder_script} does not exist")
@@ -87,30 +83,44 @@ jobs:
8783
sys.exit(1)
8884
EOF
8985
90-
- name: 🧪 Run the Demo - TensorFlow Test (Complex Dependencies)
86+
- name: 🧪 Debug Environment
87+
run: |
88+
echo "--- Debugging Environment ---"
89+
python --version
90+
pip show omnipkg redis tensorflow
91+
redis-cli -h localhost -p 6379 ping
92+
93+
- name: 🧪 Run the Demo - TensorFlow Test
9194
id: run_demo
9295
run: |
9396
echo "--- Running Omnipkg Demo for TensorFlow Test (Complex Dependencies) ---"
9497
mkdir -p /tmp/omnipkg-artifacts
9598
96-
timeout 600 bash -c 'echo "4" | omnipkg demo 2>&1 | tee /tmp/omnipkg-artifacts/tensorflow_demo_output.txt'
99+
set -o pipefail
100+
timeout 600 bash -c 'echo "4" | omnipkg demo 2>&1 | tee /tmp/omnipkg-artifacts/tensorflow_demo_output.txt; exit ${PIPESTATUS[0]}'
97101
DEMO_EXIT_CODE=$?
98102
103+
echo "DEBUG: omnipkg demo exit code: $DEMO_EXIT_CODE"
99104
echo "## TensorFlow Demo Output" >> $GITHUB_STEP_SUMMARY
100105
echo '```' >> $GITHUB_STEP_SUMMARY
101106
cat /tmp/omnipkg-artifacts/tensorflow_demo_output.txt >> $GITHUB_STEP_SUMMARY
102107
echo '```' >> $GITHUB_STEP_SUMMARY
103108
104-
if [ $DEMO_EXIT_CODE -eq 0 ]; then
105-
echo "Demo completed successfully."
109+
if [ $DEMO_EXIT_CODE -eq 0 ] || \
110+
(grep -q "ALL TENSORFLOW TESTS PASSED" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt && \
111+
grep -q "Demo completed successfully" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt); then
112+
echo "Demo completed successfully (exit code $DEMO_EXIT_CODE, logs verified)."
106113
echo "demo_outcome=success" >> $GITHUB_OUTPUT
107114
if grep -q "tensorflow==2.13.0" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt && \
108115
grep -q "typing_extensions==4.5.0" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt && \
109-
grep -q "ALL TENSORFLOW TESTS PASSED" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt; then
110-
echo "TensorFlow demo verified: tensorflow==2.13.0, typing_extensions==4.5.0, and all tests passed!"
116+
grep -q "tensorflow-estimator==2.13.0" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt && \
117+
grep -q "keras==2.13.1" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt && \
118+
grep -q "ALL TENSORFLOW TESTS PASSED" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt && \
119+
grep -q "Cleanup complete - reset to single version" /tmp/omnipkg-artifacts/tensorflow_demo_output.txt; then
120+
echo "TensorFlow demo verified: tensorflow==2.13.0, typing_extensions==4.5.0, tensorflow-estimator==2.13.0, keras==2.13.1, all tests passed, cleanup complete!"
111121
else
112122
echo "Error: Expected TensorFlow demo output not found."
113-
echo "Missing one of: 'tensorflow==2.13.0', 'typing_extensions==4.5.0', or 'ALL TENSORFLOW TESTS PASSED'"
123+
echo "Missing one of: 'tensorflow==2.13.0', 'typing_extensions==4.5.0', 'tensorflow-estimator==2.13.0', 'keras==2.13.1', 'ALL TENSORFLOW TESTS PASSED', or 'Cleanup complete'"
114124
cat /tmp/omnipkg-artifacts/tensorflow_demo_output.txt
115125
exit 1
116126
fi

0 commit comments

Comments
 (0)