-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added functional tests for provided integration scripts - bumped version to 1.1.1 - made codeowner file configurable and modified documentation accordingly
- Loading branch information
Showing
29 changed files
with
493 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,6 @@ package GPH; | |
use strict; | ||
use warnings FATAL => 'all'; | ||
|
||
our $VERSION = '1.1.0'; | ||
our $VERSION = '1.1.1'; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
|
||
use Test2::V0; | ||
use Test2::Tools::Spec; | ||
|
||
use Data::Dumper; | ||
use File::Temp; | ||
|
||
BEGIN { | ||
@ENV{"DEV_TEAM", "EXCLUDE_PATHS", "CODEOWNERS"} = ('@teams/alpha', '.gitlab-ci.yml', './t/share/Gitlab/CODEOWNERS-functional'); | ||
} | ||
|
||
describe "generate phpmd config" => sub { | ||
tests "compare config" => sub { | ||
my ($c, $fh, $exception, $warnings, $stdout, $file); | ||
|
||
$exception = dies { | ||
$warnings = warns { | ||
$file = File::Temp::tmpnam(); | ||
$c = system("$^X codeowner2commaseparatedlist.pl > $file"); | ||
}; | ||
}; | ||
|
||
is($exception, undef, 'no exception thrown'); | ||
is($warnings, 0, 'no warnings generated'); | ||
is($c, 0, 'program exited with successful exit code', $c); | ||
|
||
open $fh, '<', $file or die $!; | ||
$stdout = do { | ||
local $/; | ||
<$fh> | ||
}; | ||
close($fh); | ||
|
||
is($stdout, '/src/Command/,/src/Service/', 'config content correct') or diag Dumper($stdout); | ||
|
||
unlink($file); | ||
|
||
}; | ||
}; | ||
|
||
done_testing(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
|
||
use Test2::V0; | ||
use Test2::Tools::Spec; | ||
|
||
use Data::Dumper; | ||
use File::Temp; | ||
|
||
BEGIN { | ||
@ENV{"DEV_TEAM", "CYCLO_LEVEL"} = ('@teams/alpha', "3"); | ||
} | ||
|
||
describe "generate phpmd config" => sub { | ||
tests "compare config" => sub { | ||
my ($c, $fh, $file, $mock, $stdout, $exception, $warnings); | ||
|
||
$exception = dies { | ||
$warnings = warns { | ||
$file = File::Temp::tmpnam(); | ||
$c = system("$^X codeowner2phpmd.pl > $file"); | ||
}; | ||
}; | ||
|
||
is($exception, undef, 'no exception thrown'); | ||
is($warnings, 0, 'no warnings generated'); | ||
is($c, 0, 'program exited with successful exit code', $c); | ||
|
||
open $fh, '<', './t/share/PHPMD/phpmd-ruleset-functional.xml' or die $!; | ||
$mock = do { | ||
local $/; | ||
<$fh> | ||
}; | ||
close($fh); | ||
|
||
open $fh, '<', $file or die $!; | ||
$stdout = do { | ||
local $/; | ||
<$fh> | ||
}; | ||
close($fh); | ||
|
||
is($stdout, $mock, 'config content correct') or diag Dumper($stdout); | ||
|
||
unlink($file); | ||
}; | ||
}; | ||
|
||
done_testing(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
|
||
use Test2::V0; | ||
use Test2::Tools::Spec; | ||
|
||
use Data::Dumper; | ||
use File::Temp; | ||
|
||
BEGIN { | ||
@ENV{"DEV_TEAM", "CODEOWNERS", "EXCLUDE_PATHS", "PHPSTAN_LEVEL", "PHPSTAN_IGNORED_DIRS", "PHPSTAN_INCLUDES", "PHPSTAN_BASELINE", "PHPSTAN_CACHE_DIR", "PHPSTAN_THREADS"} = ('@teams/alpha', './t/share/Gitlab/CODEOWNERS-functional', '.gitlab-ci.yml', '1', "/ignored/", '/includes/', './baselines/baseline.xml', '/tmp', '6'); | ||
} | ||
|
||
describe "generate PHPStan config" => sub { | ||
tests "compare config" => sub { | ||
my ($c, $fh, $file, $mock, $stdout, $exception, $warnings); | ||
|
||
$exception = dies { | ||
$warnings = warns { | ||
$file = File::Temp::tmpnam(); | ||
$c = system("$^X codeowner2phpstan.pl > $file"); | ||
}; | ||
}; | ||
|
||
is($exception, undef, 'no exception thrown'); | ||
is($warnings, 0, 'no warnings generated'); | ||
is($c, 0, 'program exited with successful exit code', $c); | ||
|
||
open $fh, '<', './t/share/PHPStan/phpstan-functional.neon' or die $!; | ||
$mock = do { | ||
local $/; | ||
<$fh> | ||
}; | ||
close($fh); | ||
|
||
open $fh, '<', $file or die $!; | ||
$stdout = do { | ||
local $/; | ||
<$fh> | ||
}; | ||
close($fh); | ||
|
||
is($stdout, $mock, 'config content correct') or diag Dumper($stdout); | ||
|
||
unlink($file); | ||
}; | ||
}; | ||
|
||
done_testing(); | ||
|
Oops, something went wrong.