[Bps-public-commit] app-aws-cloudwatch-monitor branch master updated. a683d8799ef2e6a3c21a98c98fcc15dec7ae3801

BPS Git Server git at git.bestpractical.com
Fri Apr 5 14:43:30 UTC 2024


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 "app-aws-cloudwatch-monitor".

The branch, master has been updated
       via  a683d8799ef2e6a3c21a98c98fcc15dec7ae3801 (commit)
       via  4f385217d9a1128e1ba2422c5ae83483fbcb6dc5 (commit)
       via  830444a5648d33e9e6c28b80efd85a3f83d35d66 (commit)
      from  76615591f818f21652ef512a12667f6af4ea4230 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a683d8799ef2e6a3c21a98c98fcc15dec7ae3801
Author: Blaine Motsinger <blaine at renderorange.com>
Date:   Wed Mar 13 13:27:44 2024 -0500

    Add RELEASE tests to MANIFEST.SKIP

diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
index 627f0d9..1f78b04 100644
--- a/MANIFEST.SKIP
+++ b/MANIFEST.SKIP
@@ -42,6 +42,8 @@ MYMETA\.yml$
 README.md
 
 # Author tests and files
+994_version.t
+995_manifest.t
 996_perl-tidy.t
 997_perl-critic.t
 998_pod-checker.t
commit 4f385217d9a1128e1ba2422c5ae83483fbcb6dc5
Author: Blaine Motsinger <blaine at renderorange.com>
Date:   Tue Mar 12 16:58:59 2024 -0500

    Add release tests
    
    This commit adds release tests to verify the version is set on
    each file, the changes file contains an entry matching the latest
    version, and the manifest is up to date.
    
    Before releasing a new version, these tests can be run by setting
    TEST_RELEASE=1 in ENV.

diff --git a/t/994_version.t b/t/994_version.t
new file mode 100644
index 0000000..086958b
--- /dev/null
+++ b/t/994_version.t
@@ -0,0 +1,88 @@
+use strict;
+use warnings;
+
+use FindBin    ();
+use File::Find ();
+use File::Spec ();
+use Test::More;
+
+unless ( $ENV{TEST_RELEASE} ) {
+    my $msg = 'Release test. Set $ENV{TEST_RELEASE} to a true value to run.';
+    plan( skip_all => $msg );
+}
+
+my $dir = $FindBin::RealBin;
+
+my ( $ret, $msg ) = read_file( $dir . '/../Changes' );
+if ( !$ret ) {
+    BAIL_OUT "$msg";
+}
+
+my @changes_versions;
+foreach my $line ( split /\n/, $ret ) {
+    if ( $line =~ /^(\d+\.\d+)\s+\d{4}/ ) {
+        push @changes_versions, $1;
+    }
+}
+
+my $latest_version = $changes_versions[0];
+if ( $latest_version ) {
+    Test::More::note( "latest version in Changes: $latest_version" );
+}
+else {
+    BAIL_OUT "unable to read the latest version from Changes";
+}
+
+my @files = find_all_files();
+subtest 'all file versions match latest version in Changes' => sub {
+    plan tests => scalar @files;
+
+    foreach my $file ( @files ) {
+        my ( $ret, $msg ) = read_file( $dir . '/' . $file );
+        if ( !$ret ) {
+            BAIL_OUT "$msg";
+        }
+
+        my $file_version = '';
+        if ( $ret =~ /VERSION\s+=\s+'(\d+\.\d+)'/ ) {
+            $file_version = $1;
+        }
+
+        is( $file_version, $latest_version, $file );
+    }
+};
+
+done_testing();
+
+sub read_file {
+    my $file_path = shift;
+
+    if ( !$file_path ) {
+        return ( 0, 'file_path is required' );
+    }
+
+    my $file_contents;
+    open( my $fh, '<', $file_path )
+        or return ( 0, "open $file_path: $!" );
+    while ( my $line = <$fh> ) {
+        $file_contents .= $line;
+    }
+    close($fh);
+
+    return $file_contents;
+}
+
+sub find_all_files {
+    my @modules;
+    File::Find::find(
+        sub {
+            my $file = $File::Find::name;
+            return unless $file =~ /\.pm$/ || $file =~ /\/bin\/aws-cloudwatch-monitor/;
+
+            push( @modules, File::Spec->abs2rel( $file, $dir ) );
+        },
+        $dir . '/../',
+    );
+
+    return @modules;
+}
diff --git a/t/995_manifest.t b/t/995_manifest.t
new file mode 100644
index 0000000..11618f7
--- /dev/null
+++ b/t/995_manifest.t
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+unless ( $ENV{TEST_RELEASE} ) {
+    my $msg = 'Release test. Set $ENV{TEST_RELEASE} to a true value to run.';
+    plan( skip_all => $msg );
+}
+
+eval { require ExtUtils::Manifest; };
+
+if ($@) {
+    my $msg = 'ExtUtils::Manifest required to test manifest';
+    plan( skip_all => $msg );
+}
+
+my ( $missing, $extra ) = ExtUtils::Manifest::fullcheck();
+ok( !scalar @{$missing}, 'no files in the manifest are missing' );
+ok( !scalar @{$extra}, 'no files are missing from the manifest' );
+
+done_testing();
commit 830444a5648d33e9e6c28b80efd85a3f83d35d66
Author: Blaine Motsinger <blaine at renderorange.com>
Date:   Tue Mar 12 16:57:41 2024 -0500

    Add vim artifacts to MANIFEST.SKIP

diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
index 61c20fc..627f0d9 100644
--- a/MANIFEST.SKIP
+++ b/MANIFEST.SKIP
@@ -27,6 +27,8 @@
 \#$
 \b\.#
 \.bak$
+\.swp$
+\.swo$
 
 # Avoid Devel::Cover files.
 \bcover_db\b
-----------------------------------------------------------------------

Summary of changes:
 MANIFEST.SKIP    |  4 +++
 t/994_version.t  | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 t/995_manifest.t | 22 ++++++++++++++
 3 files changed, 114 insertions(+)
 create mode 100644 t/994_version.t
 create mode 100644 t/995_manifest.t


hooks/post-receive
-- 
app-aws-cloudwatch-monitor


More information about the Bps-public-commit mailing list