Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve reporting to users #246

Merged
merged 65 commits into from
Feb 23, 2022
Merged
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
be1936d
Add scan details message
gudmdharalds Feb 15, 2022
631f90f
Append scan details message to reviews/generic comments
gudmdharalds Feb 15, 2022
a9aaab2
Adding function to get PHPCS version number.
gudmdharalds Feb 15, 2022
cd38812
Adding file with other utilities.
gudmdharalds Feb 15, 2022
f5585fb
Logic for output security.
gudmdharalds Feb 15, 2022
b0f1616
Apply WordPress coding standard, include new files.
gudmdharalds Feb 15, 2022
8f25dcd
Add --version support, clean options before using to construct report
gudmdharalds Feb 15, 2022
21e84cd
Set repo-options-set in $options; special case in array handling.
gudmdharalds Feb 15, 2022
2ce2e4d
WP CS update
gudmdharalds Feb 15, 2022
7cd429a
WP CS fix
gudmdharalds Feb 15, 2022
1e5596e
Add Generic.PHP.Syntax.PHPSyntax to ignore list
gudmdharalds Feb 15, 2022
296535a
Adding logic for reports.
gudmdharalds Feb 15, 2022
7055099
$results parameter not needed for vipgoci_report_create_scan_details()
gudmdharalds Feb 15, 2022
51c832a
Exclude Generic.PHP.Syntax PHPCS sniff
gudmdharalds Feb 15, 2022
a184629
Merge branch 'main' into add/better-reporting-to-users
gudmdharalds Feb 17, 2022
cc0bcb5
Move functions to new home.
gudmdharalds Feb 18, 2022
a2ec26e
Moving functions between files, renaming functions.
gudmdharalds Feb 18, 2022
afd4428
Apply WP CS partially
gudmdharalds Feb 18, 2022
e511d91
Apply more WP CS
gudmdharalds Feb 18, 2022
26bd6ce
Apply WP CS
gudmdharalds Feb 18, 2022
3cd8557
Apply WP CS
gudmdharalds Feb 18, 2022
24d09e3
Sort require_once order
gudmdharalds Feb 21, 2022
b62bd80
Rename test, add testing for empty string value, apply WP CS.
gudmdharalds Feb 21, 2022
82ebd89
Merge branch 'add/better-reporting-to-users' of github.com:Automattic…
gudmdharalds Feb 21, 2022
97e9389
Add helper function.
gudmdharalds Feb 21, 2022
4204c69
Add define for vipgoci_github_wait()
gudmdharalds Feb 21, 2022
2463e19
Adding explanatory comment.
gudmdharalds Feb 21, 2022
a834d15
Removing extra '.' in path
gudmdharalds Feb 21, 2022
0cdfd72
Handle --help the same way as --version
gudmdharalds Feb 21, 2022
6c226b0
Update vipgoci_output_html_escape() so to retain (and encode) HTML tags.
gudmdharalds Feb 21, 2022
60965d4
Sleep time for vipgoci_github_wait() specified as a constant.
gudmdharalds Feb 21, 2022
ecf2f50
Check if $options['repo-options-set'] is set correctly.
gudmdharalds Feb 21, 2022
bb099cd
Fix whitespacing issue.
gudmdharalds Feb 21, 2022
d8e824a
Adding test for vipgoci_github_wait()
gudmdharalds Feb 21, 2022
9a81ff4
Adding test for vipgoci_util_php_interpreter_get_version()
gudmdharalds Feb 21, 2022
16f1720
Adding test for vipgoci_output_html_escape()
gudmdharalds Feb 21, 2022
6efd0fb
Add test for vipgoci_output_sanitize_version_number()
gudmdharalds Feb 21, 2022
41e8766
Adding note about new setUp() usage.
gudmdharalds Feb 22, 2022
17f8eef
Adding defines for no issues found messages.
gudmdharalds Feb 22, 2022
9eedcbc
Add support for maybe reporting no issues found.
gudmdharalds Feb 22, 2022
6334243
Keep track of original phpcs-standard via $options['phpcs-standard-or…
gudmdharalds Feb 22, 2022
9d4ed12
Add comments for WP CS
gudmdharalds Feb 22, 2022
9f86eaf
Tweak test to allow for variation in time spent.
gudmdharalds Feb 22, 2022
806a1f7
Suppress/unsupress messages, test PHPCS disabled.
gudmdharalds Feb 22, 2022
a39c91b
Adding vipgoci_log() to helper.
gudmdharalds Feb 22, 2022
c930139
Switch to running in separate processes, require in setUp(), adding a…
gudmdharalds Feb 22, 2022
a9c6dc6
Fixing @covers
gudmdharalds Feb 22, 2022
dfef651
Renaming function vipgoci_github_pr_generic_support_comment_submit() …
gudmdharalds Feb 22, 2022
da40054
Adding helper functions for ReportCreateScanDetails* tests.
gudmdharalds Feb 22, 2022
0b34265
Adding test for vipgoci_phpcs_get_version()
gudmdharalds Feb 22, 2022
0be483e
Testing for vipgoci_report_results_to_github_were_submitted()
gudmdharalds Feb 22, 2022
7503785
Add test for vipgoci_report_create_scan_details_svg_configuration()
gudmdharalds Feb 22, 2022
b5bd9be
Fix WP CS issue.
gudmdharalds Feb 22, 2022
7b22e3b
Adding test for vipgoci_report_create_scan_details_software_versions()
gudmdharalds Feb 22, 2022
27323f3
Adding test for vipgoci_report_create_scan_details_list()
gudmdharalds Feb 22, 2022
cbccc8c
Adding test for vipgoci_report_create_scan_details_php_lint_options()
gudmdharalds Feb 22, 2022
9f10ee5
Apply WP CS
gudmdharalds Feb 22, 2022
5459aae
Function should return array.
gudmdharalds Feb 22, 2022
1adf429
Adding test for vipgoci_report_create_scan_details_phpcs_configuration()
gudmdharalds Feb 22, 2022
0877b3d
Adding test for vipgoci_report_create_scan_details_auto_approve_confi…
gudmdharalds Feb 22, 2022
2fa2c17
Reporting into functions; no issues message; fix extra reviews bug; r…
gudmdharalds Feb 22, 2022
b3632a6
WP CS fixes
gudmdharalds Feb 22, 2022
4292a49
Adding --report-no-issues-found and --scan-details-msg-include options.
gudmdharalds Feb 23, 2022
d5fcaba
Enable config of --scan-details-msg-include and --report-no-issues-fo…
gudmdharalds Feb 23, 2022
5b5e052
Document --scan-details-msg-include and --report-no-issues-found
gudmdharalds Feb 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding test for vipgoci_phpcs_get_version()
  • Loading branch information
gudmdharalds committed Feb 22, 2022
commit 0b342658b564893dd3256aca9a134c90745ae44f
83 changes: 83 additions & 0 deletions tests/integration/PhpcsScanGetVersionTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
/**
* Test vipgoci_phpcs_get_version() function.
*
* @package Automattic/vip-go-ci
*/

declare(strict_types=1);

namespace Vipgoci\Tests\Integration;

require_once __DIR__ . '/IncludesForTests.php';

use PHPUnit\Framework\TestCase;

/**
* Class that implements the testing.
*
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
*/
final class PhpcsScanGetVersion extends TestCase {
/**
* Options array.
*
* @var $options_phpcs
*/
private array $options_phpcs = array(
'phpcs-php-path' => null,
'phpcs-path' => null,
);

/**
* Fetch config values.
*/
protected function setUp(): void {
vipgoci_unittests_get_config_values(
'phpcs-scan',
$this->options_phpcs
);
}

/**
* Unset option variable.
*/
protected function tearDown(): void {
unset( $this->options_phpcs );
}

/**
* Test if fetched PHP interpreter version looks good.
* Uses internal function to do this.
*
* @return void
*
* @covers ::vipgoci_phpcs_get_version
*/
public function testPhpcsPhpInterpreterGetVersion() :void {
$options_test = vipgoci_unittests_options_test(
$this->options_phpcs,
array(),
$this
);

if ( -1 === $options_test ) {
return;
}

$phpcs_version = vipgoci_phpcs_get_version(
$this->options_phpcs['phpcs-path'],
$this->options_phpcs['phpcs-php-path'],
);

/*
* Let version_compare() take care of validating the returned
* version number; the function does various sanity checks for
* us so we do not have to do it manually.
*/
$this->assertTrue(
version_compare( $phpcs_version, '1.0.0', '>=' )
);
}
}