Skip to content

Commit

Permalink
CI test prior to release
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jan 16, 2025
1 parent 9ea9fc7 commit 0b3d0b4
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.precomp/
/IRC-Client-*
/releases/
*.rakucov
12 changes: 10 additions & 2 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
Revision history for IRC::Client

{{$NEXT}}
- Use modern test file extensions, and move release tests
to "xt" directory, so they'd be run on upload
- Remove test dependencies, as these are only needed for
author testing
- Moved the release tests out of immediate testing, as they
(or the perl backend) have severely bitrotted
- Update copyright year

4.0.12 2024-08-31T20:30:02+02:00
- Bump version of IO::Socket::Async::SSL, and make it accept any
future versions as well, to prevent clashes with e.g. Whateverable
- Bump version of IO::Socket::Async::SSL, and make it accept
any future versions as well, to prevent clashes with
e.g. Whateverable
- Add separate badges for each OS
- Add sponsor button
- Update copyright year
Expand Down
10 changes: 3 additions & 7 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@
"resources": [
],
"source-url": "https://github.com/lizmat/IRC-Client.git",
"support": {
"source": "https://github.com/lizmat/IRC-Client.git"
},
"tags": [
"Net",
"IRC"
"NET",
"IRC",
"CLIENT"
],
"test-depends": [
"Test::When",
"Test::Notice"
],
"version": "4.0.12"
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ DOCUMENTATION MAP
AUTHORS
=======

* Zoffix Znet (2015-2018)
* Zoffix Znet

* Elizabeth Mattijsen (2021-) <[email protected]>
* Elizabeth Mattijsen

Source can be located at: https://github.com/lizmat/IRC-Client . Comments and Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

CONTRIBUTORS
============

Expand All @@ -58,9 +60,7 @@ COPYRIGHT AND LICENSE

Copyright 2015-2021 Zoffix Znet

Copyright 2021-2024 Elizabeth Mattijsen

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!
Copyright 2021-2025 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

Expand Down
2 changes: 1 addition & 1 deletion dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = IRC-Client

[ReadmeFromPod]
; enable = false
filename = lib/IRC/Client.rakumod
filename = doc/IRC-Client.rakudoc

[PruneFiles]
; match = ^ 'xt/'
Expand Down
74 changes: 74 additions & 0 deletions doc/IRC-Client.rakudoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
=begin pod

=head1 NAME

IRC::Client - Extendable Internet Relay Chat client

=head1 SYNOPSIS

=begin code :lang<raku>

use IRC::Client;
use Pastebin;

.run with IRC::Client.new:
:host<irc.libera.chat>
:channels<#rakubot #zofbot>
:debug
:plugins(
class { method irc-to-me ($ where /hello/) { 'Hello to you too!'} }
)
:filters(
-> $text where .chars > 200 {
'The output is too large to show here. See: '
~ Pastebin.new.paste: $text;
}
);

=end code

=head1 DESCRIPTION

The module provides the means to create clients to communicate with
IRC (Internet Relay Chat) servers. Has support for non-blocking responses
and output post-processing.

=head1 DOCUMENTATION MAP

* [Blog Post](https://github.com/Raku/CCR/blob/main/Remaster/Zoffix%20Znet/IRC-Client-Raku-Multi-Server-IRC-or-Awesome-Async-Interfaces-with-Raku.md)
* [Basics Tutorial](https://github.com/lizmat/IRC-Client/blob/main/docs/01-basics.md)
* [Event Reference](https://github.com/lizmat/IRC-Client/blob/main/docs/02-event-reference.md)
* [Method Reference](https://github.com/lizmat/IRC-Client/blob/main/docs/03-method-reference.md)
* [Big-Picture Behaviour](https://github.com/lizmat/IRC-Client/blob/main/docs/04-big-picture-behaviour.md)
* [Examples](https://github.com/lizmat/IRC-Client/blob/main/examples/)

=head1 AUTHORS

=item Zoffix Znet
=item Elizabeth Mattijsen

Source can be located at: https://github.com/lizmat/IRC-Client . Comments and
Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a
L<small sponsorship|https://github.com/sponsors/lizmat/> would mean a great
deal to me!

=head1 CONTRIBUTORS

=item Daniel Green
=item Patrick Spek

=head1 COPYRIGHT AND LICENSE

Copyright 2015-2021 Zoffix Znet

Copyright 2021-2025 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

The C<META6.json> file of this distribution may be distributed and modified without restrictions or attribution.

=end pod

# vim: expandtab shiftwidth=4
8 changes: 5 additions & 3 deletions t/release/01-basic.t → release/01-basic.rakutest
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
use lib <lib t/release>;
use Test;
use Test::When <release>;
use Test::Notice;
use IRC::Client;

use lib $*PROGRAM.parent;
use Test::IRC::Server;

my $Wait = (%*ENV<IRC_CLIENT_TEST_WAIT>//1) * 5;

notice 'Testing connection to one server and joining two channels';

diag 'Starting IRC Server';
my $s = Test::IRC::Server.new;
my $s = Test::IRC::Server.new(
server => $*PROGRAM.sibling("servers").add("01-basic.pl").absolute
);
END { $s.kill };

loop {
Expand Down
14 changes: 8 additions & 6 deletions t/release/02-multi-server.t → release/02-multi-server.rakutest
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
use lib <lib t/release>;
use Test;
use Test::When <release>;
use Test::Notice;
use IRC::Client;

use lib $*PROGRAM.parent;
use Test::IRC::Server;

my $Wait = (%*ENV<IRC_CLIENT_TEST_WAIT>//1) * 5;

notice 'Testing connection to four servers and joining two channels in each';

my $server := $*PROGRAM.sibling("servers").add("01-basic.pl").absolute;

diag 'Starting IRC Servers';
my $s1 = Test::IRC::Server.new: :port<5020>;
my $s2 = Test::IRC::Server.new: :port<5021>;
my $s3 = Test::IRC::Server.new: :port<5022>;
my $s4 = Test::IRC::Server.new: :port<5023>;
my $s1 = Test::IRC::Server.new: :$server, :port<5020>;
my $s2 = Test::IRC::Server.new: :$server, :port<5021>;
my $s3 = Test::IRC::Server.new: :$server, :port<5022>;
my $s4 = Test::IRC::Server.new: :$server, :port<5023>;
END { $s1.kill; $s2.kill; $s3.kill; $s4.kill; };

loop {
Expand Down
File renamed without changes.
File renamed without changes.
73 changes: 71 additions & 2 deletions run-tests
Original file line number Diff line number Diff line change
@@ -1,8 +1,66 @@
unit sub MAIN(:a($author), :i($install));
unit sub MAIN(
:a($author),
:i($install),
:$rmd,
:$disable-spesh,
:$disable-spesh-inline,
:$disable-JIT,
:$enable-spesh-nodelay,
:$enable-spesh-blocking,
:$enable-spesh-log,
);

say run(<raku --version>, :out).out.slurp.chomp;
say "Running on $*DISTRO.gist().\n";

if $rmd {
%*ENV<RAKUDO_MODULE_DEBUG> := 1;
say "RAKUDO_MODULE_DEBUG=1";
}

if $disable-spesh {
%*ENV<MVM_SPESH_DISABLE> := 1;
say "MVM_SPESH_DISABLE=1";
}

if $disable-spesh-inline {
%*ENV<MVM_SPESH_INLINE_DISABLE> := 1;
say "MVM_SPESH_INLINE_DISABLE=1";
}

if $disable-JIT {
%*ENV<MVM_JIT_DISABLE> := 1;
say "MVM_JIT_DISABLE=1";
}

if $enable-spesh-nodelay {
%*ENV<MVM_SPESH_NODELAY> := 1;
say "MVM_SPESH_NODELAY=1";
}

if $enable-spesh-blocking {
%*ENV<MVM_SPESH_BLOCKING> := 1;
say "MVM_SPESH_BLOCKING=1";
}

my $spesh-log;
if $enable-spesh-log {
$spesh-log = (
$enable-spesh-log ~~ Bool ?? "spesh-log" !! $enable-spesh-log
).IO;
%*ENV<MVM_SPESH_LOG> := $spesh-log.absolute;
say "MVM_SPESH_LOG=$spesh-log.relative()";
}

say ""
if $rmd
|| $disable-spesh
|| $disable-spesh-inline
|| $disable-JIT
|| $enable-spesh-nodelay
|| $enable-spesh-blocking
|| $enable-spesh-log;

say "Testing {
"dist.ini".IO.lines.head.substr(7)
}{
Expand All @@ -15,6 +73,7 @@ my $done = 0;
sub process($proc, $filename) {
if $proc {
$proc.out.slurp;
$spesh-log.unlink if $spesh-log;
}
else {
@failed.push($filename);
Expand All @@ -32,6 +91,12 @@ sub process($proc, $filename) {
else {
say "No output received, exit-code $proc.exitcode() ($proc.signal()):\n$proc.os-error()";
}

if $spesh-log {
say "\nSpesh log requested, showing last 20000 lines:";
say $spesh-log.lines(:!chomp).tail(20000).join;
$spesh-log.unlink;
}
}
}

Expand All @@ -51,8 +116,12 @@ sub test-dir($dir) {
}

test-dir("t");
test-dir($_) for dir("t", :test({ !.starts-with(".") && "t/$_".IO.d})).map(*.Str).sort;
test-dir("xt") if $author && "xt".IO.e;
install if $install;
if $install {
install;
++$done;
}

if @failed {
say "\nFAILED: {+@failed} of $done:";
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions xt/coverage.rakutest
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use Test::Coverage;

plan 2;

todo "needs more tests";
coverage-at-least 75;

todo "needs more tests";
uncovered-at-most 1;

source-with-coverage;

report;

# vim: expandtab shiftwidth=4

0 comments on commit 0b3d0b4

Please sign in to comment.