[Rt-commit] rt branch 5.0/test-apache-proxy-fcgi created. rt-5.0.4-22-g906007d0c4

BPS Git Server git at git.bestpractical.com
Thu Jun 8 20:17:03 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/test-apache-proxy-fcgi has been created
        at  906007d0c45206348681a6624f3ee6bcfe30cccf (commit)

- Log -----------------------------------------------------------------
commit 906007d0c45206348681a6624f3ee6bcfe30cccf
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jun 9 03:51:55 2023 +0800

    Test RT with apache+proxy_fcgi and mariadb

diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml
index e7bfbad9f8..f02e48357a 100644
--- a/.github/workflows/github-action.yml
+++ b/.github/workflows/github-action.yml
@@ -57,7 +57,7 @@ jobs:
           fields: |
             [{ "title": "Configuration", "value": "RT Server, SQLite", "short": true },
             { "title": "URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}?check_suite_focus=true", "short": true }]
-  rt_test_mariadb:
+  rt_test_mariadb_apache_proxy_fcgi:
     runs-on: ubuntu-latest
     steps:
       - name: Set up for tests
@@ -80,10 +80,11 @@ jobs:
           docker run --network rt --name mariadb -e MYSQL_ROOT_PASSWORD=password -d mariadb:10.6
           docker build --network rt -t rt-base .
           docker run -d -v $GITHUB_WORKSPACE:/rt --env RT_TEST_DB_HOST=mariadb --env RT_TEST_RT_HOST=172.16.0.0/255.240.0.0 --network rt --name rt rt-base
-          docker exec rt bash -c "cd /rt && ./configure.ac --with-db-type=mysql --with-my-user-group --enable-layout=inplace --enable-developer --enable-externalauth --enable-gpg --enable-smime && mkdir -p /rt/var && make testdeps"
+          docker exec rt bash -c "chown -R rt-user /rt; touch /etc/apache2/mime.types"
+          docker exec -e USER=rt-user -u rt-user rt bash -c "cd /rt && ./configure.ac --with-db-type=mysql --with-my-user-group --enable-layout=inplace --enable-developer --enable-externalauth --enable-gpg --enable-smime && mkdir -p /rt/var && make testdeps && chmod a+rX /rt/sbin/*"
       - name: Run RT tests
         shell: bash
-        run: docker exec rt bash -c "cd /rt && RT_TEST_PARALLEL_NUM=5 make test-parallel"
+        run: docker exec -e RT_TEST_WEB_HANDLER=apache+proxy_fcgi -e HTTPD_ROOT=/etc/apache2 -e RT_TEST_APACHE=/usr/sbin/apache2 -e RT_TEST_APACHE_MODULES=/usr/lib/apache2/modules -u rt-user rt bash -c "cd /rt && RT_TEST_PARALLEL_NUM=5 make test-parallel"
       - name: Get run time
         if: always()
         shell: bash
@@ -108,7 +109,7 @@ jobs:
           failure_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests failed in ${env.RT_GA_TEST_TIME}'
           cancelled_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests cancelled in ${env.RT_GA_TEST_TIME}'
           fields: |
-            [{ "title": "Configuration", "value": "RT Server, MariaDB 10.6", "short": true },
+            [{ "title": "Configuration", "value": "Apache mod_proxy_fcgi, MariaDB 10.6", "short": true },
             { "title": "URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}?check_suite_focus=true", "short": true }]
   rt_test_mysql8:
     runs-on: ubuntu-latest

commit 50a03cabd388a251f65af541c401a7e34e568a95
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jun 7 19:35:07 2023 +0800

    Support to run tests with apache+proxy_fcgi

diff --git a/configure.ac b/configure.ac
index 95fbdf4dfc..53e5cfada4 100755
--- a/configure.ac
+++ b/configure.ac
@@ -503,6 +503,7 @@ AC_CONFIG_FILES([
                  etc/RT_Config.pm
                  lib/RT/Generated.pm
                  t/data/configs/apache2.4+mod_perl.conf
+                 t/data/configs/apache2.4+proxy_fcgi.conf
                  t/data/configs/apache2.4+fcgid.conf],
                )
 AC_OUTPUT
diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index 78ea4aff37..003f3bc675 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -108,7 +108,7 @@ problem in Perl that hides the top-level optree from L<Devel::Cover>.
 =cut
 
 our $port;
-our @SERVERS;
+our (@SERVERS, @FCGI_SERVERS);
 my @ports; # keep track of all the random ports we used
 
 BEGIN {
@@ -1720,6 +1720,26 @@ sub start_apache_server {
     );
     push @SERVERS, $pid;
 
+    if ( $server_opt{variant} eq 'proxy_fcgi' ) {
+        local $ENV{RT_TESTING} = 1;
+        my $sock = "t/tmp/$port.sock";
+        my $fcgi_pid = RT::Test::Apache->fork_exec('sbin/rt-server.fcgi', '--listen', $sock, '--manager', '' );
+        push @FCGI_SERVERS, $fcgi_pid;
+        require IO::Socket::UNIX;
+        my $count = 0;
+        while ( $count++ < 100 ) {
+            my $client = IO::Socket::UNIX->new(
+                Type => SOCK_STREAM(),
+                Peer => $sock,
+            );
+            if ( $client && $client->connected ) {
+                $client->close;
+                last;
+            }
+            sleep 1;
+        }
+    }
+
     my $url = RT->Config->Get('WebURL');
     $url =~ s!/$!!;
     return ($url, RT::Test::Web->new);
@@ -1728,9 +1748,9 @@ sub start_apache_server {
 sub stop_server {
     my $self = shift;
     my $in_end = shift;
-    return unless @SERVERS;
+    return unless @SERVERS || @FCGI_SERVERS;
 
-    kill 'TERM', @SERVERS;
+    kill 'TERM', @SERVERS, @FCGI_SERVERS;
     foreach my $pid (@SERVERS) {
         if ($ENV{RT_TEST_WEB_HANDLER} =~ /^apache/) {
             my $count = 0;
@@ -1747,7 +1767,11 @@ sub stop_server {
         }
     }
 
-    @SERVERS = ();
+    foreach my $pid (@FCGI_SERVERS) {
+        waitpid $pid, 0;
+    }
+
+    @SERVERS = @FCGI_SERVERS = ();
 }
 
 sub temp_directory {
diff --git a/lib/RT/Test/Apache.pm b/lib/RT/Test/Apache.pm
index 2df1f7057d..c9b0306eaf 100644
--- a/lib/RT/Test/Apache.pm
+++ b/lib/RT/Test/Apache.pm
@@ -54,6 +54,7 @@ my %MODULES = (
     '2.4' => {
         "mod_perl" => [qw(mpm_worker authz_core authn_core authz_host env alias perl)],
         "fcgid"  => [qw(mpm_prefork authz_core authn_core authz_host env alias mime fcgid)],
+        "proxy_fcgi"  => [qw(mpm_event authz_core authn_core authz_host env alias mime proxy proxy_fcgi)],
     },
 );
 
@@ -121,6 +122,7 @@ sub start_server {
             || Test::More::BAIL_OUT("Couldn't figure out server root"),
         document_root  => $RT::MasonComponentRoot,
         tmp_dir        => "$tmp{'directory'}",
+        rt_base_path   => $RT::BasePath,
         rt_bin_path    => $RT::BinPath,
         rt_sbin_path   => $RT::SbinPath,
         rt_site_config => $ENV{'RT_SITE_CONFIG'},
diff --git a/t/data/configs/apache2.4+proxy_fcgi.conf.in b/t/data/configs/apache2.4+proxy_fcgi.conf.in
new file mode 100644
index 0000000000..3227143f47
--- /dev/null
+++ b/t/data/configs/apache2.4+proxy_fcgi.conf.in
@@ -0,0 +1,33 @@
+ServerRoot %%SERVER_ROOT%%
+PidFile %%PID_FILE%%
+ServerAdmin root at localhost
+
+%%LOAD_MODULES%%
+
+<IfModule !mpm_netware_module>
+<IfModule !mpm_winnt_module>
+User @WEB_USER@
+Group @WEB_GROUP@
+</IfModule>
+</IfModule>
+
+ServerName localhost
+Listen %%LISTEN%%
+
+ErrorLog "%%LOG_FILE%%"
+LogLevel debug
+
+AddDefaultCharset UTF-8
+
+ProxyPass / unix:%%RT_BASE_PATH%%/t/tmp/%%LISTEN%%.sock|fcgi://localhost/
+ProxyFCGIBackendType GENERIC
+ProxyFCGISetEnvIf "true" SCRIPT_NAME ""
+
+DocumentRoot "%%DOCUMENT_ROOT%%"
+<Location />
+
+    <RequireAll>
+        Require all granted
+%%BASIC_AUTH%%
+    </RequireAll>
+</Location>

commit de7f2ff04be30725db3ea1d07d8acaed6fb44f3d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jun 7 19:08:54 2023 +0800

    Drop obsolete apache and fastcgi test configs

diff --git a/configure.ac b/configure.ac
index acae97c8b1..95fbdf4dfc 100755
--- a/configure.ac
+++ b/configure.ac
@@ -502,10 +502,7 @@ AC_CONFIG_FILES([
                  Makefile
                  etc/RT_Config.pm
                  lib/RT/Generated.pm
-                 t/data/configs/apache2.2+mod_perl.conf
-                 t/data/configs/apache2.2+fastcgi.conf
                  t/data/configs/apache2.4+mod_perl.conf
-                 t/data/configs/apache2.4+fastcgi.conf
                  t/data/configs/apache2.4+fcgid.conf],
                )
 AC_OUTPUT
diff --git a/lib/RT/Test/Apache.pm b/lib/RT/Test/Apache.pm
index 8b75aaf71d..2df1f7057d 100644
--- a/lib/RT/Test/Apache.pm
+++ b/lib/RT/Test/Apache.pm
@@ -51,13 +51,8 @@ use strict;
 use warnings;
 
 my %MODULES = (
-    '2.2' => {
-        "mod_perl" => [qw(authz_host env alias perl)],
-        "fastcgi"  => [qw(authz_host env alias mime fastcgi)],
-    },
     '2.4' => {
         "mod_perl" => [qw(mpm_worker authz_core authn_core authz_host env alias perl)],
-        "fastcgi"  => [qw(mpm_worker authz_core authn_core authz_host env alias mime fastcgi)],
         "fcgid"  => [qw(mpm_prefork authz_core authn_core authz_host env alias mime fcgid)],
     },
 );
diff --git a/t/data/configs/apache2.2+fastcgi.conf.in b/t/data/configs/apache2.2+fastcgi.conf.in
deleted file mode 100644
index 329b0561eb..0000000000
--- a/t/data/configs/apache2.2+fastcgi.conf.in
+++ /dev/null
@@ -1,49 +0,0 @@
-ServerRoot %%SERVER_ROOT%%
-PidFile %%PID_FILE%%
-LockFile %%LOCK_FILE%%
-ServerAdmin root at localhost
-
-%%LOAD_MODULES%%
-
-<IfModule !mpm_netware_module>
-<IfModule !mpm_winnt_module>
-User @WEB_USER@
-Group @WEB_GROUP@
-</IfModule>
-</IfModule>
-
-ServerName localhost
-Listen %%LISTEN%%
-
-ErrorLog "%%LOG_FILE%%"
-LogLevel debug
-
-<Directory />
-    Options FollowSymLinks
-    AllowOverride None
-    Order deny,allow
-    Deny from all
-</Directory>
-
-AddDefaultCharset UTF-8
-
-FastCgiServer %%RT_SBIN_PATH%%/rt-server.fcgi \
-    -socket %%TMP_DIR%%/socket \
-    -processes 1 \
-    -idle-timeout 180 \
-    -initial-env RT_SITE_CONFIG=%%RT_SITE_CONFIG%% \
-    -initial-env RT_TESTING=1
-
-ScriptAlias / %%RT_SBIN_PATH%%/rt-server.fcgi/
-
-DocumentRoot "%%DOCUMENT_ROOT%%"
-<Location />
-    Order allow,deny
-    Allow from all
-
-%%BASIC_AUTH%%
-
-    Options +ExecCGI
-    AddHandler fastcgi-script fcgi
-</Location>
-
diff --git a/t/data/configs/apache2.2+mod_perl.conf.in b/t/data/configs/apache2.2+mod_perl.conf.in
deleted file mode 100644
index 20d2f44e52..0000000000
--- a/t/data/configs/apache2.2+mod_perl.conf.in
+++ /dev/null
@@ -1,67 +0,0 @@
-<IfModule mpm_prefork_module>
-    StartServers          1
-    MinSpareServers       1
-    MaxSpareServers       1
-    MaxClients            1
-    MaxRequestsPerChild   0
-</IfModule>
-
-<IfModule mpm_worker_module>
-    StartServers          1
-    MinSpareThreads       1
-    MaxSpareThreads       1
-    ThreadLimit           1
-    ThreadsPerChild       1
-    MaxClients            1
-    MaxRequestsPerChild   0
-</IfModule>
-
-ServerRoot %%SERVER_ROOT%%
-PidFile %%PID_FILE%%
-LockFile %%LOCK_FILE%%
-ServerAdmin root at localhost
-
-%%LOAD_MODULES%%
-
-<IfModule !mpm_netware_module>
-<IfModule !mpm_winnt_module>
-User @WEB_USER@
-Group @WEB_GROUP@
-</IfModule>
-</IfModule>
-
-ServerName localhost
-Listen %%LISTEN%%
-
-ErrorLog "%%LOG_FILE%%"
-LogLevel debug
-
-<Directory />
-    Options FollowSymLinks
-    AllowOverride None
-    Order deny,allow
-    Deny from all
-</Directory>
-
-AddDefaultCharset UTF-8
-PerlSetEnv RT_SITE_CONFIG %%RT_SITE_CONFIG%%
-
-DocumentRoot "%%DOCUMENT_ROOT%%"
-<Location />
-    Order allow,deny
-    Allow from all
-
-%%BASIC_AUTH%%
-
-    SetHandler modperl
-
-    PerlResponseHandler Plack::Handler::Apache2
-    PerlSetVar psgi_app %%RT_SBIN_PATH%%/rt-server
-</Location>
-
-<Perl>
-    $ENV{RT_TESTING}=1;
-    use Plack::Handler::Apache2;
-    Plack::Handler::Apache2->preload("%%RT_SBIN_PATH%%/rt-server");
-</Perl>
-
diff --git a/t/data/configs/apache2.4+fastcgi.conf.in b/t/data/configs/apache2.4+fastcgi.conf.in
deleted file mode 100644
index 665ddc4796..0000000000
--- a/t/data/configs/apache2.4+fastcgi.conf.in
+++ /dev/null
@@ -1,48 +0,0 @@
-ServerRoot %%SERVER_ROOT%%
-PidFile %%PID_FILE%%
-ServerAdmin root at localhost
-
-%%LOAD_MODULES%%
-
-<IfModule !mpm_netware_module>
-<IfModule !mpm_winnt_module>
-User @WEB_USER@
-Group @WEB_GROUP@
-</IfModule>
-</IfModule>
-
-ServerName localhost
-Listen %%LISTEN%%
-
-ErrorLog "%%LOG_FILE%%"
-LogLevel debug
-
-<Directory />
-    Options FollowSymLinks
-    AllowOverride None
-    Require all denied
-</Directory>
-
-AddDefaultCharset UTF-8
-
-FastCgiServer %%RT_SBIN_PATH%%/rt-server.fcgi \
-    -socket %%TMP_DIR%%/socket \
-    -processes 1 \
-    -idle-timeout 180 \
-    -initial-env RT_SITE_CONFIG=%%RT_SITE_CONFIG%% \
-    -initial-env RT_TESTING=1
-
-ScriptAlias / %%RT_SBIN_PATH%%/rt-server.fcgi/
-
-DocumentRoot "%%DOCUMENT_ROOT%%"
-<Location />
-
-    <RequireAll>
-        Require all granted
-%%BASIC_AUTH%%
-    </RequireAll>
-
-    Options +ExecCGI
-    AddHandler fastcgi-script fcgi
-</Location>
-

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list