PAGI-Server

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    compile time. The test use'd Future::IO unconditionally while Future::IO
    is only a `recommends`, so 0.002000 failed to install on a clean smoker
    without it. Now guarded the same way as t/05-sse.t.

0.002000 - 2026-06-26

  Distribution
  - PAGI::Server and bin/pagi-server split out of the PAGI distribution
    into their own distribution. Git history preserved from the original
    repository (https://github.com/jjn1056/pagi).
  - The application runner now ships here as PAGI::Server::Runner (relocated
    from PAGI-Tools). pagi-server stays server-agnostic and threads its
    PAGI::Server-specific options through to the configured server class.

  PAGI 0.3 spec conformance
  - feat: declare PAGI 0.3 conformance — scopes emit version and
    spec_version 0.3.
  - feat(ws/h2): WebSocket Denial Response — an application may send an HTTP
    response instead of accepting the handshake, over both HTTP/1.1 and HTTP/2.
  - feat(h2): HTTP/2 responses now carry a server-supplied Date header.
  - fix(server): populate the WebSocket disconnect reason/code on the

t/25-runner-production.t  view on Meta::CPAN

        is($written_pid, $pid, 'PID matches child process');
    }

    # Test cleanup
    my $runner = PAGI::Server::Runner->new(port => 0, quiet => 1);
    $runner->{_pid_file_path} = $pid_file;
    $runner->_remove_pid_file;
    ok(!-f $pid_file, 'PID file removed by cleanup');
};

# 'PID file with actual server process' has been relocated to the
# PAGI-Server distribution: it forks a real PAGI::Server event loop,
# making it a server integration test rather than a Runner unit test.
# Saved verbatim to /tmp/pagi-moved-subtests.pl for that relocation task.

subtest 'User/group validation' => sub {
    my $runner = PAGI::Server::Runner->new(
        user => 'nonexistent_user_12345',
        port => 0,
        quiet => 1,
    );

    # Should fail for non-root trying to use --user
    eval { $runner->_drop_privileges };

t/integration/runner-server.t  view on Meta::CPAN

#!/usr/bin/env perl

# =============================================================================
# Runner/Server integration tests
#
# PROVENANCE: These subtests were relocated from PAGI-Tools to PAGI-Server
# because they exercise a real PAGI::Server (real sockets, real event loop,
# SSL-cert rejection, PID-file lifecycle with a forked server process).
#
# Original sources:
#   - Subtests 1-6: PAGI-Tools t/runner.t
#   - Subtest 7:    PAGI-Tools t/25-runner-production.t
#
# PAGI::Server::Runner ships in this distribution. The integration tests
# exercise toolkit modules (PAGI::App::*, PAGI::Test::Client) that live in
# PAGI-Tools. Run with PAGI-Tools lib bridged for those modules:

t/runner.t  view on Meta::CPAN

        server_options => { ssl => { cert_file => 'c', key_file => 'k' } },
    );
    $ssl_runner->{app} = sub { };
    my $ssl_fake = $ssl_runner->load_server;
    is($ssl_fake->{options}{ssl}, { cert_file => 'c', key_file => 'k' },
        'ssl config passed through unchanged');
};

# Tests 16-19 (load_server dies without app, integration: server responds to
# requests, integration: module-based app serves files, SSL options validation)
# have been relocated to the PAGI-Server distribution because they exercise
# PAGI::Server internals or require a real socket.  Saved verbatim to
# /tmp/pagi-moved-subtests.pl for that relocation task.

# Test 20: help flag
subtest 'help flag sets show_help' => sub {
    my $runner = PAGI::Server::Runner->new;
    $runner->parse_options('--help');

    ok($runner->{show_help}, 'show_help is set');
};

# Test 21: production CLI options parsing



( run in 1.271 second using v1.01-cache-2.11-cpan-84de2e75c66 )