Skip to content

Conversation

ziegenberg
Copy link
Contributor

@ziegenberg ziegenberg commented Jul 21, 2025

As MDLSITE-7597 has now landed and the code style regarding the wrapping of lines is now following the PSR-12 approach, we need to adjust some tests.

Test 8 (local_ci_fixture_phpcs_aware_components) of remote_branch_checker has now one error in the phpcs check because of the Squiz rulseset (rule="WhiteSpace.ControlStructureSpacing.SpacingAfterOpen")

[...]

#     <summary status="error" numerrors="1" numwarnings="0" condensedresult="smurf,error,1,0:overview,success,0,0;phplint,success,0,0;phpcs,error,1,0;js,success,0,0;css,success,0,0;phpdoc,success,0,0;savepoint,success,0,0;thirdparty,success,0,0;grunt,success,0,0;shifter,success,0,0;mustache,success,0,0;gherkin,success,0,0">

[...]


#     <check id="phpcs" title="PHP coding style problems" url="https://moodledev.io/general/development/policies/codingstyle" numerrors="1" numwarnings="0" allowfiltering="1">
#       <description>This section shows the coding style problems detected in the code by phpcs</description>
#       <mess>
#         <problem file="mod/forum/db/upgrade.php" linefrom="338" lineto="338" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/fb0e3aacb3036e0353aab727b86a186f8001a8f0/mod/forum/db/upgrade.php#L338" ruleset="Squiz" rule="WhiteSpace.ControlStructureSpacing.SpacingAfterOpen" url="https://moodledev.io/general/development/policies/codingstyle" type="error" weight="5">
#           <message>Blank line found at start of control structure</message>
#           <description/>
#           <code/>
#         </problem>
#       </mess>
#     </check>

Test 9 (local_ci_fixture_upgrade_external_backup_skipped_for_plugins) of remote_branch_checker now has one additional error in the phpcs check because of the RSR12 rulseset (rule="Classes.OpeningBraceSpace.Found")

[...]

#       <detail name="phpcs" status="error" numerrors="3" numwarnings="1"/>

[...]

#     <check id="phpcs" title="PHP coding style problems" url="https://moodledev.io/general/development/policies/codingstyle" numerrors="3" numwarnings="1" allowfiltering="1">
#       <description>This section shows the coding style problems detected in the code by phpcs</description>
#       <mess>
#         <problem file="mod/glossary/tests/lib_test.php" linefrom="17" lineto="17" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/737b1bd19c9b979ec9d146f91c559c0fa7df5899/mod/glossary/tests/lib_test.php#L17" ruleset="moodle" rule="PHPUnit.TestCaseNames.UnexpectedNS" url="https://moodledev.io/general/development/policies/codingstyle" type="error" weight="5">
#           <message>PHPUnit class namespace "mod_wrong" does not match expected file namespace "mod_glossary"</message>
#           <description/>
#           <code/>
#         </problem>
#         <problem file="mod/glossary/tests/lib_test.php" linefrom="40" lineto="40" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/737b1bd19c9b979ec9d146f91c559c0fa7df5899/mod/glossary/tests/lib_test.php#L40" ruleset="moodle" rule="PHPUnit.TestCaseNames.NoMatch" url="https://moodledev.io/general/development/policies/codingstyle" type="warning" weight="1">
#           <message>PHPUnit testcase name "mod_glossary_lib_testcase_also_wrong" does not match file name "lib_test"</message>
#           <description/>
#           <code/>
#         </problem>
#         <problem file="mod/glossary/tests/lib_test.php" linefrom="40" lineto="40" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/737b1bd19c9b979ec9d146f91c559c0fa7df5899/mod/glossary/tests/lib_test.php#L40" ruleset="moodle" rule="PHPUnit.TestCaseNames.Irregular" url="https://moodledev.io/general/development/policies/codingstyle" type="error" weight="5">
#           <message>PHPUnit irregular testcase name found: mod_glossary_lib_testcase_also_wrong (_test/_testcase ended expected)</message>
#           <description/>
#           <code/>
#         </problem>
#         <problem file="mod/glossary/tests/lib_test.php" linefrom="40" lineto="40" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/737b1bd19c9b979ec9d146f91c559c0fa7df5899/mod/glossary/tests/lib_test.php#L40" ruleset="PSR12" rule="Classes.OpeningBraceSpace.Found" url="https://moodledev.io/general/development/policies/codingstyle" type="error" weight="5">
#           <message>Opening brace must not be followed by a blank line</message>
#           <description/>
#           <code/>
#         </problem>
#       </mess>
#     </check>

@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 30.23%. Comparing base (c1677c0) to head (2e58231).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #365      +/-   ##
==========================================
+ Coverage   25.22%   30.23%   +5.01%     
==========================================
  Files          72       72              
  Lines        3271     3271              
==========================================
+ Hits          825      989     +164     
+ Misses       2446     2282     -164     
Flag Coverage Δ
check_upgrade_savepoints 0.45% <ø> (ø)
checkstyle_manipulations 0.00% <ø> (ø)
compare_databases 2.35% <ø> (ø)
continuous_manage_queues_validation 1.37% <ø> (ø)
define_excluded 1.10% <ø> (ø)
detect_conflicts 1.46% <ø> (ø)
diff_extract_changes 0.00% <ø> (ø)
git_sync_two_branches ?
grunt_process 2.96% <ø> (ø)
illegal_whitespace 2.59% <ø> (ø)
list_valid_components 0.00% <ø> (ø)
mustache_lint 2.81% <ø> (ø)
mustache_lint_plugins 1.31% <ø> (ø)
php_lint 1.22% <ø> (ø)
prepare_npm_stuff 1.49% <ø> (ø)
remote_branch_checker 17.33% <ø> (?)
remote_branch_reporter 0.00% <ø> (ø)
setup 0.00% <ø> (ø)
thirdparty_check 1.55% <ø> (ø)
travis-branch-checker 0.00% <ø> (ø)
upgrade_external_backup 1.62% <ø> (ø)
verifications 0.00% <ø> (ø)
verify_commit_messages 2.59% <ø> (ø)
versions_check_set 5.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…yling

As MDLSITE-7597 has now landed and the code style regarding the wrapping
of lines is now following the PSR-12 approach we need to adjust some
tests.

Signed-off-by: Daniel Ziegenberg <[email protected]>
@ziegenberg ziegenberg force-pushed the fix-remote_branch_checker branch from 932ab3e to 2e58231 Compare July 21, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants