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.
This commit is contained in:
parent
0f904d792b
commit
0395db30f0
3 changed files with 26 additions and 6 deletions
|
|
@ -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',
|
||||
],
|
||||
[
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 () {
|
||||
|
|
|
|||
Loading…
Reference in a new issue