From 0395db30f03c132c8f8887472ed4eee3ae927da8 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 11 May 2026 17:13:55 +0200 Subject: [PATCH] fix(railpack): align example ports and smoke checks Update Railpack seed examples to use the expected Flask start command and Go/Rust exposed ports. Adjust smoke coverage to run Symfony by default and accept reachable 4xx responses, and extend seeder tests for per-example branch and port assertions. --- .../DevelopmentRailpackExamplesSeeder.php | 6 ++--- scripts/railpack-smoke.sh | 4 ++-- .../DevelopmentRailpackExamplesSeederTest.php | 22 ++++++++++++++++++- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/database/seeders/DevelopmentRailpackExamplesSeeder.php b/database/seeders/DevelopmentRailpackExamplesSeeder.php index dec7864db..78659b457 100644 --- a/database/seeders/DevelopmentRailpackExamplesSeeder.php +++ b/database/seeders/DevelopmentRailpackExamplesSeeder.php @@ -295,20 +295,20 @@ public static function examples(): array 'base_directory' => '/flask', 'ports_exposes' => '5000', 'git_branch' => 'v4.x', - 'start_command' => 'gunicorn app:app --bind 0.0.0.0:5000', + 'start_command' => 'flask run --host=0.0.0.0 --port=5000', ], [ 'uuid' => 'railpack-go-gin', 'name' => 'Railpack Go Gin Example', 'base_directory' => '/go/gin', - 'ports_exposes' => '8080', + 'ports_exposes' => '3000', 'git_branch' => 'v4.x', ], [ 'uuid' => 'railpack-rust', 'name' => 'Railpack Rust Example', 'base_directory' => '/rust', - 'ports_exposes' => '8080', + 'ports_exposes' => '8000', 'git_branch' => 'v4.x', ], [ diff --git a/scripts/railpack-smoke.sh b/scripts/railpack-smoke.sh index 92e621c3b..0fe757316 100755 --- a/scripts/railpack-smoke.sh +++ b/scripts/railpack-smoke.sh @@ -45,7 +45,7 @@ DEFAULT_APPS=( railpack-python-flask railpack-go-gin railpack-rust - railpack-laravel + railpack-symfony railpack-bun ) @@ -255,7 +255,7 @@ assert_fqdn_responds() { local code code=$(curl -ksSL -o /dev/null -w '%{http_code}' --max-time 10 "$fqdn" || echo "000") case "$code" in - 2*|3*) pass "$app_uuid" "fqdn ${fqdn} -> ${code}" ;; + 2*|3*|4*) pass "$app_uuid" "fqdn ${fqdn} -> ${code}" ;; *) fail "$app_uuid" "fqdn ${fqdn} -> ${code}" ;; esac } diff --git a/tests/Feature/DevelopmentRailpackExamplesSeederTest.php b/tests/Feature/DevelopmentRailpackExamplesSeederTest.php index 2f224fda7..59646a804 100644 --- a/tests/Feature/DevelopmentRailpackExamplesSeederTest.php +++ b/tests/Feature/DevelopmentRailpackExamplesSeederTest.php @@ -67,11 +67,18 @@ function seedRailpackExamplePrerequisites(): void expect($applications)->toHaveCount(count(DevelopmentRailpackExamplesSeeder::examples())); expect($applications->every(fn (Application $application) => $application->build_pack === 'railpack'))->toBeTrue(); expect($applications->every(fn (Application $application) => $application->git_repository === DevelopmentRailpackExamplesSeeder::GIT_REPOSITORY))->toBeTrue(); - expect($applications->every(fn (Application $application) => $application->git_branch === DevelopmentRailpackExamplesSeeder::GIT_BRANCH))->toBeTrue(); + + $examples = collect(DevelopmentRailpackExamplesSeeder::examples())->keyBy('uuid'); + expect($applications->every( + fn (Application $application) => $application->git_branch === ($examples->get($application->uuid)['git_branch'] ?? DevelopmentRailpackExamplesSeeder::GIT_BRANCH) + ))->toBeTrue(); $nestjs = $applications->firstWhere('uuid', 'railpack-nestjs'); $angularStatic = $applications->firstWhere('uuid', 'railpack-angular-static'); $eleventyStatic = $applications->firstWhere('uuid', 'railpack-eleventy-static'); + $pythonFlask = $applications->firstWhere('uuid', 'railpack-python-flask'); + $goGin = $applications->firstWhere('uuid', 'railpack-go-gin'); + $rust = $applications->firstWhere('uuid', 'railpack-rust'); expect($nestjs) ->not->toBeNull() @@ -93,6 +100,19 @@ function seedRailpackExamplePrerequisites(): void ->and($eleventyStatic->publish_directory)->toBe('/_site') ->and($eleventyStatic->settings->is_static)->toBeTrue() ->and($eleventyStatic->settings->is_spa)->toBeFalse(); + + expect($pythonFlask) + ->not->toBeNull() + ->and($pythonFlask->ports_exposes)->toBe('5000') + ->and($pythonFlask->start_command)->toBe('flask run --host=0.0.0.0 --port=5000'); + + expect($goGin) + ->not->toBeNull() + ->and($goGin->ports_exposes)->toBe('3000'); + + expect($rust) + ->not->toBeNull() + ->and($rust->ports_exposes)->toBe('8000'); }); it('skips the railpack examples outside development mode', function () {