Skip to content

Commit

Permalink
Fix bin/console commands in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pablothedude committed Dec 10, 2024
1 parent 776b0cc commit 0f29273
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions stepup/tests/behat/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ public static function execCommand(string $command): void

if($result === false) {
echo "Failed executing command\n";
die();
exit(1);
}

foreach ($output as $line) {
echo $line."\n";
}

if ($returnCode !== 0) {
die();
exit($returnCode);
}
}

Expand All @@ -76,20 +76,20 @@ public static function setupDatabase(BeforeSuiteScope $scope)

// Generate test databases
echo "Preparing test schemas for Middleware\n";
self::execCommand('docker exec -t stepup-middleware-1 bin/console doctrine:schema:drop --em=middleware --env=smoketest --force');
self::execCommand('docker exec -t stepup-middleware-1 bin/console doctrine:schema:create --em=middleware --env=smoketest');
self::execCommand('docker exec -t stepup-middleware-1 php bin/console doctrine:schema:drop --em=middleware --env=smoketest --force');
self::execCommand('docker exec -t stepup-middleware-1 php bin/console doctrine:schema:create --em=middleware --env=smoketest');

echo "Preparing test schemas for Gateway\n";
self::execCommand('docker exec -t stepup-middleware-1 bin/console doctrine:schema:drop --em=gateway --env=smoketest --force');
self::execCommand('docker exec -t stepup-middleware-1 bin/console doctrine:schema:create --em=gateway --env=smoketest');
self::execCommand('docker exec -t stepup-middleware-1 php bin/console doctrine:schema:drop --em=gateway --env=smoketest --force');
self::execCommand('docker exec -t stepup-middleware-1 php bin/console doctrine:schema:create --em=gateway --env=smoketest');

// Import the events.sql into middleware
echo "Add events to test database\n";
self::execCommand("mysql -uroot -psecret middleware_test -h mariadb < ./fixtures/events.sql");

// Perform an event replay
echo "Replaying event stream\n";
self::execCommand("docker exec -t stepup-middleware-1 bin/console middleware:event:replay --env=smoketest_event_replay --no-interaction -vvv");
self::execCommand("docker exec -t stepup-middleware-1 php bin/console middleware:event:replay --env=smoketest_event_replay --no-interaction -vvv");

// Push config
echo "Push Middleware config\n";
Expand Down

0 comments on commit 0f29273

Please sign in to comment.