Skip to content

Commit

Permalink
Merge branch 'PR/426'
Browse files Browse the repository at this point in the history
  • Loading branch information
andk committed Apr 25, 2024
2 parents 8bb024d + bd5ea54 commit e7ea0b8
Show file tree
Hide file tree
Showing 8 changed files with 196 additions and 134 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/perl-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "perl test suite"
on: [ push, pull_request ]

jobs:
the-tests:
runs-on: ubuntu-latest
container:
image: perldocker/perl-tester:5.16
strategy:
fail-fast: false
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Makefile.PL
run: |
perl Makefile.PL && make
- name: Install prereqs (apt)
# If we install "default-mysql-server", the web tests will run, which
# is good, but they will run forever when we get to
# t/pause_2017/action/change_passwd.t not responding to SIGTERM or
# SIGKILL. I seem to recall something about signals being weird on
# Actions, but not how... -- rjbs, 2023-05-05
run: |
apt update
apt install -y rsync
- name: Install prereqs (cpanm, pinned versions)
# PAUSE is run (for now?) on v5.16, and the latest versions from the
# CPAN don't install on v5.16, so we install these version that do.
# -- rjbs, 2023-05-05
run: |
cpanm Log::[email protected]
cpanm [email protected]
- name: Install prereqs (cpan)
# This could probably be made more efficient by looking at what it's
# installing via cpanm that could, instead, be installed from apt. I
# may do that later, but for now, it's fine! -- rjbs, 2023-01-07
run: cpanm --notest --installdeps .
- name: Install yath and JUnit renderer
run: cpanm --notest Test2::Harness Test2::Harness::Renderer::JUnit
- name: Run the tests
# We disable Test::Perl::Critic because of a bug in
# Test2::Harness::Renderer::JUnit. See:
# https://github.com/cpanel/Test2-Harness-Renderer-JUnit/issues/16
# -- rjbs, 2023-05-05
run: |
NO_PERL_CRITIC=1 JUNIT_TEST_FILE="/tmp/test-output.xml" ALLOW_PASSING_TODOS=1 yath test --renderer=Formatter --renderer=JUnit -D
- name: Publish test report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
check_name: JUnit Report
report_paths: /tmp/test-output.xml

216 changes: 109 additions & 107 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -3,113 +3,115 @@
use strict;
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'PAUSE',
VERSION_FROM => 'lib/PAUSE.pm',
ABSTRACT_FROM => 'lib/PAUSE.pod',
AUTHOR => 'Andreas Koenig <[email protected]>',
LICENSE => 'perl',
PREREQ_PM => { map +($_ => 0), qw(
Apache::Session::Counted
BSD::Resource
Capture::Tiny
CPAN::Checksums
CPAN::DistnameInfo
CPAN::Indexer::Mirror
Class::MOP::Class
Class::Singleton
Compress::Zlib
Crypt::Eksblowfish::Bcrypt
Cwd
DB_File
DBD::mysql
DBD::SQLite
DBI
DBIx::RunSQL
Devel::Peek
Dumpvalue
Email::Address
Email::MIME
Email::Sender::Simple
EV
File::Copy::Recursive
File::pushd
File::Rsync::Mirror::Recentfile
File::Temp
File::Which
Git::Wrapper
HTML::Entities
HTTP::Date
HTTP::Request::Common
HTTP::Tiny
IO::Socket::SSL
IPC::Cmd
IPC::Run3
JSON::XS
Log::Dispatch
Log::Dispatch::Config
Log::Dispatchouli
Log::Dispatchouli::Global
LWP::UserAgent
LWP::Protocol::https
Digest::SHA
Mail::Mailer
Module::Faker::Dist
Module::Signature
Moo
Mojolicious
Mojolicious::Plugin::WithCSRFProtection
MojoX::Log::Dispatch::Simple
MooseX::StrictConstructor
Net::FTP
Net::SSLeay
Parse::CPAN::Packages
Parse::CPAN::Perms
Path::Class
Path::Tiny
Plack
Plack::App::Directory::Apaxy
Plack::Middleware::Auth::Basic
Plack::Middleware::ReverseProxy
Plack::Middleware::ServerStatus::Tiny
Process::Status
Set::Crontab
SQL::Maker
String::Random
Test::Class
Test::Deep
Test::FITesque::Fixture
Test::MockObject
Test::mysqld
Test::Requires
Test::WWW::Mechanize::PSGI
Text::Format
Text::Markdown::Hoedown
Text::Metaphone
Text::Soundex
Text::Unidecode
Time::Duration
Time::HiRes
URI::Escape
URI::URL
Unicode::Collate
Unicode::String
WWW::Mechanize::Boilerplate
XML::LibXML
XML::Parser
XML::SAX::Base
XML::SAX::Writer
YAML::XS
)},
SIGN => 1,
test => { RECURSIVE_TEST_FILES => 1 },
($ExtUtils::MakeMaker::VERSION >= 6.4502 ?
(META_ADD => {
resources => {
repository => "git://github.com/andk/pause.git",
},
keywords => ['CPAN','perl','perl authors upload server'],
}) : ()),
);
NAME => 'PAUSE',
VERSION_FROM => 'lib/PAUSE.pm',
ABSTRACT_FROM => 'lib/PAUSE.pod',
AUTHOR => 'Andreas Koenig <[email protected]>',
LICENSE => 'perl',
PREREQ_PM => { map +($_ => 0), qw(
Apache::Session::Counted
BSD::Resource
Capture::Tiny
CPAN::Checksums
CPAN::DistnameInfo
CPAN::Indexer::Mirror
Class::MOP::Class
Class::Singleton
Compress::Zlib
Crypt::Eksblowfish::Bcrypt
Cwd
DB_File
DBD::mysql
DBD::SQLite
DBI
DBIx::RunSQL
Devel::Peek
Dumpvalue
Email::Address
Email::MIME
Email::Sender::Simple
EV
File::Copy::Recursive
File::pushd
File::Rsync::Mirror::Recentfile
File::Temp
File::Which
Git::Wrapper
HTML::Entities
HTTP::Date
HTTP::Request::Common
HTTP::Tiny
IO::Socket::SSL
IPC::Cmd
IPC::Run3
JSON::XS
Log::Dispatch
Log::Dispatch::Config
Log::Dispatchouli
Log::Dispatchouli::Global
LWP::UserAgent
LWP::Protocol::https
Digest::SHA
Mail::Mailer
Module::Faker::Dist
Module::Signature
Moo
Mojolicious
Mojolicious::Plugin::WithCSRFProtection
MojoX::Log::Dispatch::Simple
MooseX::StrictConstructor
Net::FTP
Net::SSLeay
Parse::CPAN::Packages
Parse::CPAN::Perms
Path::Class
Path::Tiny
Plack
Plack::App::Directory::Apaxy
Plack::Middleware::Auth::Basic
Plack::Middleware::ReverseProxy
Plack::Middleware::ServerStatus::Tiny
Process::Status
Set::Crontab
SQL::Maker
String::Random
Test::Class
Test::Deep
Test::FITesque::Fixture
Test::MockObject
Test::mysqld
Test::Requires
Test::WWW::Mechanize::PSGI
Text::Format
Text::Markdown::Hoedown
Text::Metaphone
Text::Soundex
Text::Unidecode
Time::Duration
Time::HiRes
URI::Escape
URI::URL
Unicode::Collate
Unicode::String
WWW::Mechanize::Boilerplate
XML::LibXML
XML::Parser
XML::SAX::Base
XML::SAX::Writer
YAML::XS
)},
SIGN => 1,

test => { RECURSIVE_TEST_FILES => 1 },
($ExtUtils::MakeMaker::VERSION >= 6.4502
? (META_ADD => {
resources => {
repository => "git://github.com/andk/pause.git",
},
keywords => ['CPAN','perl','perl authors upload server'],
})
: ()),
);

sub MY::postamble {
<<EOF;
Expand Down
24 changes: 0 additions & 24 deletions t/0-signature.t

This file was deleted.

6 changes: 4 additions & 2 deletions t/70_critic.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ use warnings;
use File::Spec;
use Test::More;

if ($ENV{NO_PERL_CRITIC}) {
plan( skip_all => '$NO_PERL_CRITIC set, skipping');
}

eval { require Test::Perl::Critic; };

if ( $@ ) {
Expand All @@ -14,8 +18,6 @@ my $rcfile = File::Spec->catfile( 't', 'perlcriticrc' );
Test::Perl::Critic->import( -profile => $rcfile );
all_critic_ok();



# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Expand Down
14 changes: 14 additions & 0 deletions t/lib/PAUSE/TestPAUSE.pm
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ has pause_config_overrides => (
builder => '_build_pause_config_overrides',
);

my $GIT_CONFIG = <<'END_GIT_CONFIG';
[user]
email = [email protected]
name = "PAUSE Daemon Git User"
END_GIT_CONFIG

sub _build_pause_config_overrides {
my ($self) = @_;

Expand All @@ -263,6 +269,14 @@ sub _build_pause_config_overrides {
{
my $chdir_guard = pushd($git_dir);
system(qw(git init)) and die "error running git init";

my $git_config = File::Spec->catdir($git_dir, '.git/config');
open my $config_fh, '>', $git_config
or die "can't create git config at $git_config: $!";

print {$config_fh} $GIT_CONFIG;
close $config_fh
or die "can't write git config at $git_config: $!";
}

my $dsnbase = "DBI:SQLite:dbname=$db_root";
Expand Down
7 changes: 7 additions & 0 deletions t/pause_2017/lib/Test/PAUSE/MySQL.pm
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
package Test::PAUSE::MySQL;

use Test::Builder ();
use Test::Requires qw(Test::mysqld);

BEGIN {
unless (-e '/usr/local/mysql/bin/mysql') {
Test::Builder->new->skip_all("no mysql found, needed for this test")
}
}

use Moose;
use Test::mysqld;
use Test::More;
Expand Down
2 changes: 1 addition & 1 deletion t/programs.t
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!perl -- -*- mode: cperl -*-
#!perl

use Test::More;
use File::Spec;
Expand Down
8 changes: 8 additions & 0 deletions t/run_test_class_tests.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
use strict;
use warnings;

use Test::Requires qw(Test::mysqld);

BEGIN {
unless (-e '/usr/local/mysql/bin/mysql') {
Test::Builder->new->skip_all("no mysql found, needed for this test")
}
}

use lib 't/lib';
use TestSetup;

Expand Down

0 comments on commit e7ea0b8

Please sign in to comment.