Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .env

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Create Tag
run: |
git config user.name "github-actions[bot]"
git config user.name "github-actions[bot]@users.noreply.github.com"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a ${{ github.event.inputs.version }} -m "Release ${{ github.event.inputs.version }}"
git push origin ${{ github.event.inputs.version }}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"diff/diff": "~3.0"
},
"require-dev": {
"ext-PDO": "*",
"ext-pdo": "*",
"phpunit/phpunit": "^9.4.3|^10.0|^11.0"
},
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ services:
depends_on:
db-mysql80:
condition: service_healthy
image: phpmyadmin/phpmyadmin:latest
image: phpmyadmin/phpmyadmin:5.2
restart: always
ports:
- ${PHPMYADMIN_PORT_MYSQL80}:80
Expand All @@ -216,7 +216,7 @@ services:
depends_on:
db-mysql84:
condition: service_healthy
image: phpmyadmin/phpmyadmin:latest
image: phpmyadmin/phpmyadmin:5.2
restart: always
ports:
- ${PHPMYADMIN_PORT_MYSQL84}:80
Expand All @@ -228,7 +228,7 @@ services:
depends_on:
db-mysql93:
condition: service_healthy
image: phpmyadmin/phpmyadmin:latest
image: phpmyadmin/phpmyadmin:5.2
restart: always
ports:
- ${PHPMYADMIN_PORT_MYSQL93}:80
Expand Down
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ if [ ${#args[@]} -eq 0 ]; then
done

echo "Select MySQL version:"
local mysql_display=($(get_mysql_version_display))
mysql_display=($(get_mysql_version_display))
select mysql_choice in "${mysql_display[@]}" "all"; do
if [ -n "$mysql_choice" ]; then
break
Expand Down
2 changes: 1 addition & 1 deletion stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Stop script for DBDiff Docker containers and services
# This provides the same teardown functionality as start.sh --no-teardown cleanup

echo " DBDiff Stop Script"
echo "🛑 DBDiff Stop Script"
echo "This will stop and clean up all DBDiff Docker containers, images, volumes, and networks"
echo ""

Expand Down
11 changes: 7 additions & 4 deletions tests/DBDiffComprehensiveTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

require 'vendor/autoload.php';

use PHPUnit\Framework\TestCase;

class DBDiffComprehensiveTest extends TestCase
Expand All @@ -20,8 +18,13 @@ class DBDiffComprehensiveTest extends TestCase
protected function setUp(): void
{
$this->host = getenv('DB_HOST') ?: ($_ENV['DB_HOST'] ?? ($_SERVER['DB_HOST'] ?? 'db'));
echo "\nDEBUG [Comprehensive]: DB_HOST environment variable: " . (getenv('DB_HOST') ?: 'NOT_SET');
echo "\nDEBUG [Comprehensive]: Using database host: " . $this->host . "\n";

$debug = getenv('DBDIFF_DEBUG') === 'true';

if ($debug) {
echo "\nDEBUG [Comprehensive]: DB_HOST environment variable: " . (getenv('DB_HOST') ?: 'NOT_SET');
echo "\nDEBUG [Comprehensive]: Using database host: " . $this->host . "\n";
}

// Check if we're in record mode (via environment variable)
$this->recordMode = ($_ENV['DBDIFF_RECORD_MODE'] ?? 'false') === 'true';
Expand Down
36 changes: 25 additions & 11 deletions tests/End2EndTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

require 'vendor/autoload.php';

use Illuminate\Database\Capsule\Manager as Capsule;

/**
Expand Down Expand Up @@ -37,9 +35,14 @@ protected function setUp(): void
// 1. Identify Database Host
// We use DB_HOST environment variable (provided by Docker) or fallback to 'db'
$this->host = getenv('DB_HOST') ?: ($_ENV['DB_HOST'] ?? ($_SERVER['DB_HOST'] ?? 'db'));
echo "\nDEBUG: DB_HOST environment variable: " . (getenv('DB_HOST') ?: 'NOT_SET');
echo "\nDEBUG: Using database host: " . $this->host;
echo "\nDEBUG: Full connection string will be: mysql:host=" . $this->host . ";port=" . $this->port . "\n";

$debug = getenv('DBDIFF_DEBUG') === 'true';

if ($debug) {
echo "\nDEBUG: DB_HOST environment variable: " . (getenv('DB_HOST') ?: 'NOT_SET');
echo "\nDEBUG: Using database host: " . $this->host;
echo "\nDEBUG: Full connection string will be: mysql:host=" . $this->host . ";port=" . $this->port . "\n";
}

// 2. Establish Database Connection with Retry Logic
// This ensures tests don't fail if the MySQL container is still warming up
Expand All @@ -49,15 +52,23 @@ protected function setUp(): void
for ($attempt = 1; $attempt <= $maxRetries; $attempt++) {
try {
$this->db = new PDO("mysql:host=$this->host;port=$this->port", $this->user, $this->pass);
echo "\nSuccessfully connected to database on attempt $attempt\n";
if ($debug) {
echo "\nSuccessfully connected to database on attempt $attempt\n";
}
break;
} catch (PDOException $e) {
echo "\nConnection attempt $attempt failed: " . $e->getMessage();
if ($debug) {
echo "\nConnection attempt $attempt failed: " . $e->getMessage();
}
if ($attempt === $maxRetries) {
echo "\nFailed to connect after $maxRetries attempts. Please check if MySQL is running.\n";
exit(1);
if ($debug) {
echo "\nFailed to connect after $maxRetries attempts. Please check if MySQL is running.\n";
}
$this->fail("Failed to connect to database after $maxRetries attempts: " . $e->getMessage());
}
if ($debug) {
echo "\nRetrying in $retryDelay seconds...\n";
}
echo "\nRetrying in $retryDelay seconds...\n";
sleep($retryDelay);
}
}
Expand All @@ -69,7 +80,10 @@ protected function setUp(): void
$this->databaseMajor = $databaseVersion[0];
$this->migration_expected = $this->migration_expected . "_" . $this->databaseMajor;
$this->migration_actual = $this->migration_actual . "_" . $this->databaseMajor;
echo "\nDatabase server major version is: " . $this->databaseMajor . "\n";

if ($debug) {
echo "\nDatabase server major version is: " . $this->databaseMajor . "\n";
}

// 4. Reset Test Databases
// Ensure we start with a clean slate for every test execution
Expand Down