@@ -155,88 +155,11 @@ jobs:
155155 echo "Current directory contents:"
156156 ls -la
157157
158- - name : Start Valkey servers
159- working-directory : tests
160- run : |
161- set -e # Exit on any error
162-
163- # Ensure /usr/local/bin is in PATH (where valkey-server is installed)
164- export PATH="/usr/local/bin:$PATH"
165-
166- echo "=== DEBUG: Current directory and files ==="
167- pwd
168- ls -la
169-
170- echo "=== DEBUG: Current PATH ==="
171- echo "PATH=$PATH"
172-
173- echo "=== DEBUG: Checking for installed binaries in /usr/local/bin ==="
174- ls -la /usr/local/bin/ | grep -E "(valkey|redis)" || echo "No valkey/redis binaries in /usr/local/bin"
175-
176- echo "=== DEBUG: Checking script permissions ==="
177- ls -la start_valkey_with_replicas.sh create-valkey-cluster.sh
178-
179- # Make scripts executable
180- chmod +x start_valkey_with_replicas.sh create-valkey-cluster.sh
181-
182- echo "=== DEBUG: After chmod ==="
183- ls -la start_valkey_with_replicas.sh create-valkey-cluster.sh
184-
185- # Check if valkey-server is available
186- echo "=== DEBUG: Checking for valkey-server ==="
187- which valkey-server || echo "valkey-server not found in PATH"
188-
189- # Check alternative locations and names
190- echo "=== DEBUG: Checking alternative binary names ==="
191- which redis-server || echo "redis-server not found in PATH"
192- which valkey-cli || echo "valkey-cli not found in PATH"
193- which redis-cli || echo "redis-cli not found in PATH"
194-
195- # Start standalone servers (6379, 6380, 6381)
196- echo "=== Starting standalone Valkey servers ==="
197- ./start_valkey_with_replicas.sh
198-
199- # Wait a moment for servers to start
200- echo "=== Waiting for standalone servers to start ==="
201- sleep 3
202-
203- # Check if servers are running
204- echo "=== Checking standalone server status ==="
205- ps aux | grep -E "(valkey|redis)-server" | grep -v grep || echo "No valkey/redis-server processes found"
206-
207- # Start cluster servers (7001-7006)
208- echo "=== Starting Valkey cluster ==="
209- ./create-valkey-cluster.sh
210-
211- # Final server status check
212- echo "=== Final server status check ==="
213- ps aux | grep -E "(valkey|redis)-server" | grep -v grep || echo "No valkey/redis-server processes found"
214- echo "=== Valkey servers startup completed ==="
215-
216- - name : Run PHP extension tests
217- run : |
218- # Run tests using direct extension loading with absolute path
219- php -n -d extension=$(pwd)/modules/valkey_glide.so tests/TestValkeyGlide.php
220-
221- - name : Run integration tests
222- run : |
223- # All tests are now run through the main TestValkeyGlide.php runner
224- echo "All 4 test classes are already included in the main test runner"
225- echo "TestValkeyGlide.php now runs all classes by default:"
226- echo "- ValkeyGlide_Test (standalone)"
227- echo "- ValkeyGlide_Cluster_Test (cluster)"
228- echo "- ValkeyGlide_Features_Test (standalone features)"
229- echo "- ValkeyGlide_Cluster_Features_Test (cluster features)"
230-
231- - name : Stop Valkey servers
232- if : always()
233- run : |
234- # Stop all Valkey server processes
235- echo "Stopping Valkey servers..."
236- pkill valkey-server || true
237- # Clean up data directories
238- rm -rf $HOME/valkey-cluster || true
239- rm -rf tests/valkey_data || true
158+ - name : Run PHP Extension Tests
159+ uses : ./.github/workflows/run-php-tests
160+ with :
161+ extension-path : ${{ github.workspace }}/modules/valkey_glide.so
162+ php-version : ${{ matrix.php }}
240163
241164 - uses : ./.github/workflows/test-benchmark
242165 if : ${{ matrix.engine.version == '8.0' && matrix.host.OS == 'ubuntu' && matrix.host.RUNNER == 'ubuntu-latest' && matrix.php == env.BASE_PHP_VERSION }}
@@ -588,7 +511,7 @@ jobs:
588511 echo "Test file exists: $(ls -la tests/TestValkeyGlide.php 2>/dev/null || echo 'NOT FOUND')"
589512 echo "Suppressions file exists: $(ls -la valgrind.supp 2>/dev/null || echo 'NOT FOUND')"
590513 echo "Valgrind version: $(valgrind --version)"
591-
514+
592515 # Step 7: Run Valgrind tests
593516 echo ""
594517 echo "=== Step 7: Running Valgrind memory analysis ==="
@@ -619,51 +542,51 @@ jobs:
619542 if [ -f "./valgrind_logs/valgrind_output.log" ]; then
620543 LOG_SIZE=$(wc -c < ./valgrind_logs/valgrind_output.log)
621544 echo "=== Valgrind log file found (${LOG_SIZE} bytes) ==="
622-
545+
623546 # Since we used tee, the output should already be visible above
624547 # But let's extract key information for summary
625548 echo ""
626549 echo "=== Extracting Key Results ==="
627-
550+
628551 # Show test completion status
629552 if grep -q "All tests passed" ./valgrind_logs/valgrind_output.log; then
630553 echo "✅ All tests passed"
631554 elif grep -q "FAILED" ./valgrind_logs/valgrind_output.log; then
632555 echo "❌ Some tests failed"
633556 fi
634-
557+
635558 # Check for memory leaks
636559 if grep -q "definitely lost:" ./valgrind_logs/valgrind_output.log; then
637560 echo "⚠️ CRITICAL: Definite memory leaks detected"
638561 grep -A 3 -B 1 "definitely lost:" ./valgrind_logs/valgrind_output.log || true
639562 else
640563 echo "✅ No definite memory leaks detected"
641564 fi
642-
565+
643566 # Check for possible leaks
644567 if grep -q "possibly lost:" ./valgrind_logs/valgrind_output.log; then
645568 POSSIBLY_LOST=$(grep "possibly lost:" ./valgrind_logs/valgrind_output.log | head -1)
646569 echo "⚠️ Possible leaks: $POSSIBLY_LOST"
647570 fi
648-
571+
649572 # Show leak summary if present
650573 if grep -q "LEAK SUMMARY:" ./valgrind_logs/valgrind_output.log; then
651574 echo ""
652575 echo "=== Memory Leak Summary ==="
653576 grep -A 6 "LEAK SUMMARY:" ./valgrind_logs/valgrind_output.log | head -7 || true
654577 fi
655-
578+
656579 # Show error summary
657580 if grep -q "ERROR SUMMARY:" ./valgrind_logs/valgrind_output.log; then
658581 echo ""
659582 echo "=== Error Summary ==="
660583 grep "ERROR SUMMARY:" ./valgrind_logs/valgrind_output.log || true
661584 fi
662-
585+
663586 echo ""
664587 echo "📝 Full Valgrind output was displayed above during test execution"
665588 echo "📎 Complete log is also saved as artifact for detailed analysis"
666-
589+
667590 else
668591 echo "❌ No Valgrind output file found"
669592 echo "This indicates the Valgrind command may have failed to execute properly"
0 commit comments