├── index.html ├── .htaccess ├── tests ├── fixtures │ ├── remote_branch_reporter │ │ ├── MDL-54987 │ │ │ ├── csslint.out │ │ │ ├── stylelint.xml │ │ │ ├── phplint.xml │ │ │ ├── shifter.xml │ │ │ ├── savepoints.xml │ │ │ ├── thirdparty.xml │ │ │ ├── errors.txt │ │ │ ├── errors.xml │ │ │ ├── grunt.xml │ │ │ └── eslint.xml │ │ ├── MDL-55322 │ │ │ ├── csslint.out │ │ │ ├── stylelint.xml │ │ │ ├── commits.xml │ │ │ ├── docs.xml │ │ │ ├── grunt.xml │ │ │ ├── phplint.xml │ │ │ ├── shifter.xml │ │ │ ├── cs.xml │ │ │ ├── savepoints.xml │ │ │ ├── thirdparty.xml │ │ │ ├── patchset.xml │ │ │ └── eslint.xml │ │ └── README.md │ ├── checkstyle │ │ ├── commits-info.txt │ │ ├── gherkinlint_ok.xml │ │ ├── grunt-errors.txt │ │ ├── commits-info.xml │ │ ├── savepoints.txt │ │ ├── shifter.xml │ │ ├── commits.txt │ │ ├── savepoints.xml │ │ ├── grunt-build-failed.xml │ │ ├── thirdparty.xml │ │ ├── thirdparty.txt │ │ ├── grunt-build-failed.txt │ │ ├── gherkinlint_ok.txt │ │ ├── commits.xml │ │ ├── phplint.txt │ │ ├── phplint.xml │ │ ├── grunt.xml │ │ ├── gherkinlint_err.txt │ │ ├── gherkinlint_err.xml │ │ ├── mustachelint.txt │ │ ├── grunt.txt │ │ └── mustachelint.xml │ ├── diff_extract_changes │ │ ├── diff_extract_changes-edge-expected.txt │ │ ├── diff_extract_changes-edge-expected.xml │ │ └── diff_extract_changes-edge-input.patch │ ├── remote_branch_checker │ │ ├── local_ci_fixture_good_amos_commit.regex │ │ ├── local_ci_fixture_upgrade_txt_for_404.regex │ │ ├── local_ci_fixture_upgrade_txt_for_405.regex │ │ ├── local_ci_fixture_oldbranch_38.regex │ │ ├── local_ci_fixture_grunt_build_failed.regex │ │ ├── local_ci_fixture_upgrade_external_backup_skipped_for_plugins.regex │ │ ├── local_ci_fixture_mustache_lint_js.regex │ │ ├── local_ci_fixture_gherkin_lint.regex │ │ ├── local_ci_fixture_bad_amos_command.regex │ │ ├── local_ci_fixture_phpcs_aware_components.regex │ │ ├── local_ci_fixture_upgrade_external_backup.regex │ │ ├── local_ci_fixture_thirdparty_css.regex │ │ ├── local_ci_fixture_mustache_lint.regex │ │ ├── local_ci_fixture_manyproblems_38.regex │ │ └── local_ci_fixture_stylelint.regex │ ├── define_excluded │ │ ├── format-excluded_list_wildchars-expected.txt │ │ ├── format-excluded_grep-expected.txt │ │ ├── format-excluded_comma_wildchars-expected.txt │ │ ├── format-excluded_comma-expected.txt │ │ ├── format-excluded_list-expected.txt │ │ └── format-excluded-expected.txt │ ├── verify_commit_messages │ │ ├── no-issue-id.patch │ │ ├── no-code-area.patch │ │ ├── no-colon.patch │ │ ├── ok.patch │ │ ├── includes-parent-in-message.patch │ │ ├── too-long.patch │ │ ├── too-long-body.patch │ │ ├── warning-elsewhere.patch │ │ ├── amos-no-modified-files.patch │ │ ├── backslash-ended-lines.patch │ │ ├── amos-good-commands.patch │ │ ├── amos-bad-syntax.patch │ │ └── amos-incomplete.patch │ ├── check_upgrade_savepoints │ │ ├── no_return_statement.patch │ │ ├── blank_upgrade_file.patch │ │ ├── repeated_savepoint.patch │ │ ├── if_without_savepoint.patch │ │ ├── multiple_return.patch │ │ ├── returning_bool.patch │ │ ├── wrong_savepoint_version.patch │ │ ├── too_high_savepoint.patch │ │ └── out_of_order.patch │ ├── verify_phpunit_xml │ │ ├── add_uncovered_test.patch │ │ └── multiple_classes_in_file.patch │ ├── versions_check_set │ │ ├── no_moodle_internal.patch │ │ ├── main_version_missing.patch │ │ ├── invalid_component.patch │ │ ├── no_version_defined.patch │ │ ├── invalid_date.patch │ │ ├── extra_version_digit.patch │ │ ├── short_version.patch │ │ ├── version_too_far_in_future.patch │ │ └── short_array_syntax.patch │ ├── 402-php_lint-bad.patch │ ├── 31-thirdparty-edgecase.patch │ ├── 402-php_lint-ok.patch │ ├── 35-thirdparty-lib-added.patch │ ├── 39-grunt-js-unbuilt.patch │ ├── 402-php_lint-vendor.patch │ ├── 402-mustache_lint-str.patch │ ├── 31-mustache_lint-js_test.patch │ ├── 31-whitespace-error.patch │ ├── 31-mustache_lint-js_token_test.patch │ ├── 39-grunt-scss-unbuilt.patch │ ├── 31-mustache_lint-full-html-body.patch │ ├── 31-mustache_lint-quote_and_uniq.patch │ ├── 31-thirdparty-error.patch │ ├── 31-whitespace-upgradenotes.patch │ ├── 39-mustache_lint_plugins-ignores.patch │ ├── 31-mustache_lint-partials-loaded.patch │ ├── 31-mustache_lint-theme_loading.patch │ ├── 31-thirdparty-ok.patch │ ├── 31-mustache_lint-html-validator-fail.patch │ ├── 31-mustache_lint-mustache-syntax-error.patch │ ├── 31-mustache_lint-no-content.patch │ ├── 31-mustache_lint-no-example.patch │ ├── 31-mustache_lint-invalid-json.patch │ ├── 31-mustache_lint-ok.patch │ ├── 311-upgrade_external_backup-all-wrong.patch │ └── compare_databases_wrong.patch ├── libs │ ├── bats-assert │ │ └── load.bash │ └── bats-support │ │ ├── load.bash │ │ └── src │ │ └── error.bash ├── list_valid_components.bats ├── define_excluded.bats ├── diff_extract_changes.bats ├── setup.bats ├── detect_conflicts.bats ├── thirdparty_check.bats ├── remote_branch_reporter.bats ├── php_lint.bats ├── mustache_lint_plugins.bats ├── illegal_whitespace.bats ├── checkstyle_manipulations.bats └── travis-branch-checker.bats ├── jenkins_cli └── jenkins-cli.jar ├── package.json ├── mustache_lint ├── running_validator.txt ├── simple_core_component_mustache_loader.php └── mustache_lint.sh ├── tracker_automations ├── bulk_prelaunch_jobs │ └── criteria │ │ ├── list_of_mdls_sdev │ │ ├── postissue.sh │ │ └── query.sh │ │ ├── multi_database │ │ ├── postissue.sh │ │ └── query.sh │ │ ├── awaiting_integration │ │ ├── postissue.sh │ │ ├── query.sh │ │ └── jobs.sh │ │ ├── awaiting_component_lead_review │ │ ├── postissue.sh │ │ ├── query.sh │ │ └── jobs.sh │ │ └── list_of_mdls │ │ ├── query.sh │ │ └── postissue.sh ├── bulk_precheck_issues │ ├── criteria │ │ ├── developer_request │ │ │ ├── query.sh │ │ │ └── postissue.sh │ │ ├── awaiting_integration │ │ │ ├── query.sh │ │ │ ├── postissue.sh │ │ │ └── override-defaults.sh │ │ └── awaiting_peer_review │ │ │ ├── postissue.sh │ │ │ └── query.sh │ └── util.sh ├── check_marked_as_integrated │ └── util.sh ├── remove_ci_label_from_wip │ └── remove_ci_label_from_wip.sh ├── close_tested_issues │ └── close_tested_issues.sh └── delay_awaiting_issues │ └── delay_awaiting_issues.sh ├── .github └── workflows │ └── auto-author-assign.yml ├── tracker_content_gadget ├── clr_candidate_picker.html ├── personal_current_picker.html ├── personal_candidate_picker.html └── clr_candidate_picker_split.html ├── composer.json ├── .gitignore ├── project_size_report └── project_size_report.sh ├── git_sync_two_branches └── lib.sh ├── lang └── en │ └── local_ci.php ├── check_upgrade_savepoints └── check_upgrade_savepoints.sh ├── version.php ├── groovyscripts ├── remove_post_action_from_all_jobs.groovy └── add_notification_webhook_to_all_jobs.groovy ├── README.md ├── git_garbage_collector └── git_garbage_collector.sh ├── jira.sh ├── run_phpunittests └── config.php.template ├── list_changed_files └── list_changed_files.sh ├── prepare_composer_stuff └── prepare_composer_stuff.sh ├── thirdparty_check └── thirdparty_check.sh ├── verify_commit_messages └── check_amos.php └── php_lint └── php_lint.sh /index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all 2 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-54987/csslint.out: -------------------------------------------------------------------------------- 1 | csslint: No files specified. 2 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-55322/csslint.out: -------------------------------------------------------------------------------- 1 | csslint: No files specified. 2 | -------------------------------------------------------------------------------- /tests/libs/bats-assert/load.bash: -------------------------------------------------------------------------------- 1 | source "$(dirname "${BASH_SOURCE[0]}")/src/assert.bash" 2 | -------------------------------------------------------------------------------- /jenkins_cli/jenkins-cli.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moodlehq/moodle-local_ci/HEAD/jenkins_cli/jenkins-cli.jar -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/commits-info.txt: -------------------------------------------------------------------------------- 1 | b21c515*info*AMOS - String to be copied: searchengine/admin to type_search/plugin 2 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-54987/stylelint.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-55322/stylelint.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/gherkinlint_ok.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-54987/phplint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-54987/shifter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-55322/commits.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-55322/docs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-55322/grunt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-55322/phplint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-55322/shifter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/fixtures/diff_extract_changes/diff_extract_changes-edge-expected.txt: -------------------------------------------------------------------------------- 1 | another_binary.png: 2 | diff_extract_changes_edge_cases.txt:10-10;13-13; 3 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-54987/savepoints.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-54987/thirdparty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-55322/cs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-55322/savepoints.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-55322/thirdparty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/libs/bats-support/load.bash: -------------------------------------------------------------------------------- 1 | source "$(dirname "${BASH_SOURCE[0]}")/src/output.bash" 2 | source "$(dirname "${BASH_SOURCE[0]}")/src/error.bash" 3 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/grunt-errors.txt: -------------------------------------------------------------------------------- 1 | shifter [err] /var/lib/jenkins/git_repositories/prechecker/lib/editor/atto/plugins/image/yui/src/button/js/button.js contains 2 lint errors 2 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-54987/errors.txt: -------------------------------------------------------------------------------- 1 | Info: not important 2 | Warn: warning1 3 | Error: error1 4 | Warn: another warning 5 | Error: error2 6 | Ignorable line too 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "moodle-local_ci", 3 | "version": "0.0.1", 4 | "description": "Tools for CI with Moodle", 5 | "private": true, 6 | "dependencies": { 7 | "vnu-jar": "23.4.11" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /mustache_lint/running_validator.txt: -------------------------------------------------------------------------------- 1 | Running a local instance of the validator for more reliability.. 2 | 3 | 4 | 1/ npm install 5 | 2/ The mustache_lint.sh script should use the npm-installed version of validator automatically. 6 | -------------------------------------------------------------------------------- /tracker_automations/bulk_prelaunch_jobs/criteria/list_of_mdls_sdev/postissue.sh: -------------------------------------------------------------------------------- 1 | # Update the automated testing field with the results. 2 | ${basereq} --action setFieldValue \ 3 | --issue ${issue} \ 4 | --field "Automated test results" \ 5 | --file "${resultfile}.${issue}.txt" 6 | -------------------------------------------------------------------------------- /tracker_automations/bulk_prelaunch_jobs/criteria/multi_database/postissue.sh: -------------------------------------------------------------------------------- 1 | # Update the automated testing field with the results. 2 | ${basereq} --action setFieldValue \ 3 | --issue ${issue} \ 4 | --field "Automated test results" \ 5 | --file "${resultfile}.${issue}.txt" 6 | -------------------------------------------------------------------------------- /tracker_automations/bulk_prelaunch_jobs/criteria/awaiting_integration/postissue.sh: -------------------------------------------------------------------------------- 1 | # Update the automated testing field with the results. 2 | ${basereq} --action setFieldValue \ 3 | --issue ${issue} \ 4 | --field "Automated test results" \ 5 | --file "${resultfile}.${issue}.txt" 6 | -------------------------------------------------------------------------------- /tracker_automations/bulk_prelaunch_jobs/criteria/awaiting_component_lead_review/postissue.sh: -------------------------------------------------------------------------------- 1 | # Update the automated testing field with the results. 2 | ${basereq} --action setFieldValue \ 3 | --issue ${issue} \ 4 | --field "Automated test results" \ 5 | --file "${resultfile}.${issue}.txt" 6 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/commits-info.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/savepoints.txt: -------------------------------------------------------------------------------- 1 | - /var/lib/jenkins/git_repositories/prechecker/lib/db/upgrade.php: 2 | + found 201 matching 'if' blocks and 'savepoint' calls 3 | + versions in upgrade blocks properly ordered 4 | + ERROR: version 2015082001.00 has wrong savepoint call with version 2015082001.01 5 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_good_amos_commit.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/shifter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tracker_automations/bulk_precheck_issues/criteria/developer_request/query.sh: -------------------------------------------------------------------------------- 1 | ${basereq} --action getIssueList \ 2 | --jql "project = 'Moodle' \ 3 | AND labels IN (cime) \ 4 | ORDER BY priority DESC, votes DESC, 'Last comment date' ASC" \ 5 | --outputFormat 101 \ 6 | --file "${resultfile}" 7 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/commits.txt: -------------------------------------------------------------------------------- 1 | 6733d12*error*The commit message does not begin with the expected issue code MDL-[0-9]{3,6} and a space. 2 | 6733d12*error*The commit message does not contain the expected issue code MDL-55061 and a space. 3 | ee73cbd*warning*The commit message does not define a code area ending with a colon and a space after the issue code. 4 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/savepoints.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.github/workflows/auto-author-assign.yml: -------------------------------------------------------------------------------- 1 | name: Auto Author Assign 2 | 3 | on: 4 | pull_request_target: 5 | types: [ opened, reopened ] 6 | 7 | permissions: 8 | pull-requests: write 9 | 10 | jobs: 11 | assign-author: 12 | name: Auto assign PR 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: toshimaru/auto-author-assign@v2.1.0 16 | -------------------------------------------------------------------------------- /tests/fixtures/diff_extract_changes/diff_extract_changes-edge-expected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_txt_for_404.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | condensedresult="smurf,success,0,0:overview,success,0,0 6 | 7 | -------------------------------------------------------------------------------- /tests/fixtures/define_excluded/format-excluded_list_wildchars-expected.txt: -------------------------------------------------------------------------------- 1 | # Each line contents must exist independently in results. 2 | --exclude */*.csv* 3 | --exclude */*.gif* --exclude */*.ics* --exclude */*.jpg* 4 | --exclude */admin/tool/installaddon/tests/fixtures/versionphp/version1.php* 5 | --exclude */auth/cas/CAS/* --exclude */auth/fc/fcFPP.php* 6 | --exclude */enrol/lti/ims-blti/* 7 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/grunt-build-failed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tracker_automations/bulk_prelaunch_jobs/criteria/list_of_mdls/query.sh: -------------------------------------------------------------------------------- 1 | ${basereq} --action getIssueList \ 2 | --jql "project = 'Moodle' \ 3 | AND issue IN (${issueslist}) \ 4 | AND level IS EMPTY \ 5 | ORDER BY priority DESC, votes DESC, 'Last comment date' ASC" \ 6 | --outputFormat 101 \ 7 | --file "${resultfile}" 8 | -------------------------------------------------------------------------------- /tracker_automations/bulk_prelaunch_jobs/criteria/multi_database/query.sh: -------------------------------------------------------------------------------- 1 | ${basereq} --action getIssueList \ 2 | --jql "project = 'Moodle' \ 3 | AND issue IN (${issueslist}) \ 4 | AND level IS EMPTY \ 5 | ORDER BY priority DESC, votes DESC, 'Last comment date' ASC" \ 6 | --outputFormat 101 \ 7 | --file "${resultfile}" 8 | -------------------------------------------------------------------------------- /tracker_content_gadget/clr_candidate_picker.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Personal Candidate Picker 4 | 5 | 6 |

7 | Pick mine! 8 |

9 | 10 | 11 | -------------------------------------------------------------------------------- /tracker_content_gadget/personal_current_picker.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Personal Current Picker 4 | 5 | 6 |

7 | Pick mine! 8 |

9 | 10 | 11 | -------------------------------------------------------------------------------- /tracker_content_gadget/personal_candidate_picker.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Personal Candidate Picker 4 | 5 | 6 |

7 | Pick mine! 8 |

9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/thirdparty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/thirdparty.txt: -------------------------------------------------------------------------------- 1 | INFO: Checking for third party modifications from 0324fefaf6bccbb3443070af41d0f34ac3ed81ee to MOODLE_30_STABLE_precheck 2 | INFO: Detected third party modification in lib/adodb 3 | /var/lib/jenkins/git_repositories/prechecker/lib/adodb/drivers/adodb-oci8po.inc.php - WARN: modification to third party library (lib/adodb) without update to lib/thirdpartylibs.xml or lib/adodb/readme_moodle.txt 4 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_txt_for_405.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | condensedresult="smurf,error,1,0:overview,error,1,0 6 | 7 | The patchset contains changes to upgrade.txt or UPGRADING.md files. 8 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/grunt-build-failed.txt: -------------------------------------------------------------------------------- 1 | Running "startup" task 2 | 3 | Running "stylelint:scss" (stylelint) task 4 | >> Linted 117 files without errors 5 | 6 | Running "stylelint:less" (stylelint) task 7 | >> theme/bootstrapbase/less/moodle/modules.less 8 | >> 15:1 ✖ Expected indentation of 4 spaces indentation 9 | Warning: Task "stylelint:less" failed. Use --force to continue. 10 | 11 | Aborted due to warnings. 12 | ERROR: Problems running grunt 13 | -------------------------------------------------------------------------------- /tests/fixtures/define_excluded/format-excluded_grep-expected.txt: -------------------------------------------------------------------------------- 1 | # Each line contents must exist independently in results. 2 | |/backup/cc/schemas/|/backup/cc/schemas11/| 3 | |/enrol/lti/ims-blti/| 4 | |/filter/algebra/AlgParser\.pm| 5 | |/lib/amd/src/mustache\.js| 6 | |/lib/editor/atto/tests/fixtures/pretty-good-en\.vtt|/lib/editor/atto/tests/fixtures/pretty-good-sv\.vtt| 7 | /lib/editor/atto/yui/src/rangy/js|/lib/editor/atto/yui/src/rangy/js/.*\..*| 8 | |/node_modules/| 9 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_oldbranch_38.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | summary status="error" 6 | has not been rebased recently 7 | 'foo' is assigned a value but never used 8 | Missing semicolon 9 | The commit message does not begin with the expected issue code 10 | Problems running grunt 11 | -------------------------------------------------------------------------------- /tracker_automations/bulk_precheck_issues/criteria/developer_request/postissue.sh: -------------------------------------------------------------------------------- 1 | # Remove the "cime" label. 2 | ${basereq} --action removeLabels \ 3 | --issue ${issue} \ 4 | --labels "cime CIME Cime CiMe" # the uppercase to fix MDLSITE-4716 and cases like MDL-64431 5 | 6 | # Update the pre-check field with the results. 7 | ${basereq} --action setFieldValue \ 8 | --issue ${issue} \ 9 | --field "Pre-check results" \ 10 | --file "${resultfile}.${issue}.txt" 11 | -------------------------------------------------------------------------------- /tracker_automations/bulk_prelaunch_jobs/criteria/list_of_mdls_sdev/query.sh: -------------------------------------------------------------------------------- 1 | ${basereq} --action getIssueList \ 2 | --jql "project = 'Moodle' \ 3 | AND issue IN (${issueslist}) \ 4 | AND \"${customfield_pullFromRepository}\" ~ 'integration/security-testing' \ 5 | AND level IS NOT EMPTY \ 6 | ORDER BY priority DESC, votes DESC, 'Last comment date' ASC" \ 7 | --outputFormat 101 \ 8 | --file "${resultfile}" 9 | -------------------------------------------------------------------------------- /tracker_automations/bulk_precheck_issues/criteria/awaiting_integration/query.sh: -------------------------------------------------------------------------------- 1 | ${basereq} --action getIssueList \ 2 | --jql "project = 'Moodle' \ 3 | AND status = 'Waiting for integration review' \ 4 | AND (labels IS EMPTY OR labels NOT IN (ci, security_held, integration_held)) \ 5 | AND level IS EMPTY \ 6 | ORDER BY priority DESC, votes DESC, 'Last comment date' ASC" \ 7 | --outputFormat 101 \ 8 | --file "${resultfile}" 9 | -------------------------------------------------------------------------------- /tracker_automations/bulk_precheck_issues/criteria/awaiting_integration/postissue.sh: -------------------------------------------------------------------------------- 1 | # Add the "ci" label. 2 | ${basereq} --action addLabels \ 3 | --issue ${issue} \ 4 | --labels "ci" 5 | 6 | # Remove the "cime" label. 7 | ${basereq} --action removeLabels \ 8 | --issue ${issue} \ 9 | --labels "cime" 10 | 11 | # Update the pre-check field with the results. 12 | ${basereq} --action setFieldValue \ 13 | --issue ${issue} \ 14 | --field "Pre-check results" \ 15 | --file "${resultfile}.${issue}.txt" 16 | -------------------------------------------------------------------------------- /tracker_automations/bulk_precheck_issues/criteria/awaiting_peer_review/postissue.sh: -------------------------------------------------------------------------------- 1 | # Add the "ci" label. 2 | ${basereq} --action addLabels \ 3 | --issue ${issue} \ 4 | --labels "ci" 5 | 6 | # Remove the "cime" label. 7 | ${basereq} --action removeLabels \ 8 | --issue ${issue} \ 9 | --labels "cime" 10 | 11 | # Update the pre-check field with the results. 12 | ${basereq} --action setFieldValue \ 13 | --issue ${issue} \ 14 | --field "Pre-check results" \ 15 | --file "${resultfile}.${issue}.txt" 16 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "moodlehq/moodle-local_ci", 3 | "description": "Stuff run by Moodle CI integration servers.", 4 | "keywords": ["moodle", "ci", "integration", "jira", "jenkins", "automations"], 5 | "license": "GPL-3.0-or-later", 6 | "require": { 7 | "moodlehq/moodle-cs": "^3.7", 8 | "mustache/mustache": "^2.14.2" 9 | }, 10 | "config": { 11 | "allow-plugins": { 12 | "dealerdirect/phpcodesniffer-composer-installer": true 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tracker_automations/bulk_precheck_issues/criteria/awaiting_peer_review/query.sh: -------------------------------------------------------------------------------- 1 | ${basereq} --action getIssueList \ 2 | --jql "project = 'Moodle' \ 3 | AND (status = 'Waiting for peer review' OR status = 'Peer review in progress') \ 4 | AND (labels IS EMPTY OR labels NOT IN (ci, security_held, integration_held)) \ 5 | AND level IS EMPTY \ 6 | ORDER BY priority DESC, votes DESC, 'Last comment date' ASC" \ 7 | --outputFormat 101 \ 8 | --file "${resultfile}" 9 | -------------------------------------------------------------------------------- /tracker_automations/bulk_prelaunch_jobs/criteria/list_of_mdls/postissue.sh: -------------------------------------------------------------------------------- 1 | if [[ "${post_results_in_customfield}" == "true" ]]; then 2 | # Update the automated testing field with the results. 3 | ${basereq} --action setFieldValue \ 4 | --issue ${issue} \ 5 | --field "Automated test results" \ 6 | --file "${resultfile}.${issue}.txt" 7 | else 8 | # Just add the results as a comment. 9 | ${basereq} --action addComment \ 10 | --issue ${issue} \ 11 | --file "${resultfile}.${issue}.txt" 12 | fi 13 | -------------------------------------------------------------------------------- /tracker_automations/bulk_prelaunch_jobs/criteria/awaiting_integration/query.sh: -------------------------------------------------------------------------------- 1 | ${basereq} --action getIssueList \ 2 | --jql "project = 'Moodle' \ 3 | AND status = 'Waiting for integration review' \ 4 | AND status WAS NOT 'Waiting for integration review' ON '-${schedulemins}' \ 5 | AND level IS EMPTY \ 6 | AND 'Automated test results' IS EMPTY \ 7 | ORDER BY priority DESC, votes DESC, 'Last comment date' ASC" \ 8 | --outputFormat 101 \ 9 | --file "${resultfile}" 10 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_grunt_build_failed.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | 6 | 7 | Problems running grunt 8 | Task "stylelint:scss" failed. Use --force to continue. 9 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-54987/errors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tracker_automations/bulk_prelaunch_jobs/criteria/awaiting_component_lead_review/query.sh: -------------------------------------------------------------------------------- 1 | ${basereq} --action getIssueList \ 2 | --jql "project = 'Moodle' \ 3 | AND status = 'Waiting for component lead review' \ 4 | AND status WAS NOT 'Waiting for component lead review' ON '-${schedulemins}' \ 5 | AND level IS EMPTY \ 6 | AND 'Automated test results' IS EMPTY \ 7 | ORDER BY priority DESC, votes DESC, 'Last comment date' ASC" \ 8 | --outputFormat 101 \ 9 | --file "${resultfile}" 10 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_external_backup_skipped_for_plugins.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | # Just verify that there isn't any externalbackup section in the report 6 | condensedresult="smurf,success,0,0:overview,success,0,0;phplint,success,0,0;phpcs,success,0,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" 7 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_mustache_lint_js.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | 6 | 7 | ESLint warning \[camelcase\]: Identifier 'my_message' is not in camel case.* 8 | ESLint warning \[no-alert\]: Unexpected alert.*/message> 9 | -------------------------------------------------------------------------------- /tracker_automations/bulk_precheck_issues/criteria/awaiting_integration/override-defaults.sh: -------------------------------------------------------------------------------- 1 | # Allows awaiting_integration criteria options to be customized. 2 | 3 | # Note the following is just a (disabled) example about how the 4 | # bulk_checker variables can be customized by criteria, enabling 5 | # different behaviors for different types of execution. This can 6 | # be used to support different checks/plans by criteria or any 7 | # other customization requiring custom handling. 8 | 9 | # Max number of commits accepted per run. Error if exceeded. Defaults to 100. We want to reduce them for this criteria. 10 | # maxcommitserror=15 11 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/README.md: -------------------------------------------------------------------------------- 1 | ## How to add fixture here ## 2 | 3 | 1. Go to the jenkins build page e.g. https://integration.moodle.org/job/Precheck%20remote%20branch/22118/ 4 | 2. Go to build artefacts / work 5 | 3. Download all files in zip 6 | 4. Extract the zip and rename as directory here 7 | 5. Remove the non-required files with `rm *.{zip,txt,files,diff}` 8 | 9 | **Note** 10 | 11 | The test fixtures depend on the files generated in `/var/lib/jenkins/git_repositories/prechecker/` - you will 12 | need to rewrite the urls if it doesn't match that. (E.g. `sed -i.bak "s#/my/dir/#/var/lib/jenkins/git_repositories/prechecker#g" *.xml`) 13 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/gherkinlint_ok.txt: -------------------------------------------------------------------------------- 1 | [{"filePath":"/mod/glossary/tests/behat/categories.feature","errors":[]},{"filePath":"/mod/glossary/tests/behat/edit_tags.feature","errors":[]},{"filePath":"/mod/glossary/tests/behat/entries_always_editable.feature","errors":[]},{"filePath":"/mod/glossary/tests/behat/entries_require_approval.feature","errors":[]},{"filePath":"/mod/glossary/tests/behat/import_entries.feature","errors":[]},{"filePath":"/mod/glossary/tests/behat/prevent_duplicate_entries.feature","errors":[]},{"filePath":"/mod/glossary/tests/behat/print_friendly_version.feature","errors":[]},{"filePath":"/mod/glossary/tests/behat/search_entries.feature","errors":[]}] 2 | -------------------------------------------------------------------------------- /tests/fixtures/define_excluded/format-excluded_comma_wildchars-expected.txt: -------------------------------------------------------------------------------- 1 | # Each line contents must exist independently in results. 2 | */*\.csv*,*/*\.gif*,*/*\.ics*,*/*\.jpg*,*/*\.png*,*/*\.svg*,*/\.git/*, 3 | lib/amd/src/loglevel\.js*,*/lib/amd/src/mustache\.js*, 4 | */lib/editor/atto/tests/fixtures/pretty-good-sv\.vtt*, 5 | */lib/editor/atto/yui/src/rangy/js*,*/lib/editor/atto/yui/src/rangy/js/*\.**, 6 | */lib/jquery/*, 7 | */mod/assign/feedback/editpdf/fpdi/*, 8 | */theme/bootstrapbase/amd/src/bootstrap\.js*, 9 | */vendor/*, 10 | */webservice/amf/testclient/AMFTester\.mxml*, 11 | */webservice/amf/testclient/customValidators/JSONValidator\.as*, 12 | */work/* 13 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/commits.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/no-issue-id.patch: -------------------------------------------------------------------------------- 1 | From bf0158b7cc195edcb71ef9af287db273197d5fb9 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 29 Jul 2016 12:54:22 +0100 4 | Subject: [PATCH 1/1] I forgot the issue number! 5 | 6 | --- 7 | README.txt | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/README.txt b/README.txt 11 | index 729dbe4..af81703 100644 12 | --- a/README.txt 13 | +++ b/README.txt 14 | @@ -26,3 +26,5 @@ Moodle is written in PHP and JavaScript and uses an SQL database for storing 15 | the data. 16 | 17 | See for details of Moodle's many features. 18 | + 19 | +a dummy commit! 20 | -- 21 | 2.9.0 22 | 23 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-54987/grunt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/no-code-area.patch: -------------------------------------------------------------------------------- 1 | From 72df2d6fad1c575b5fd31798df8534a1c2e603f6 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 29 Jul 2016 12:54:22 +0100 4 | Subject: [PATCH 1/1] MDL-12345 short summary with code area 5 | 6 | --- 7 | README.txt | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/README.txt b/README.txt 11 | index 729dbe4..af81703 100644 12 | --- a/README.txt 13 | +++ b/README.txt 14 | @@ -26,3 +26,5 @@ Moodle is written in PHP and JavaScript and uses an SQL database for storing 15 | the data. 16 | 17 | See for details of Moodle's many features. 18 | + 19 | +a dummy commit! 20 | -- 21 | 2.9.0 22 | 23 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/no-colon.patch: -------------------------------------------------------------------------------- 1 | From 8c89b6067be94947b9ea027ea8445ce62317ce28 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 29 Jul 2016 12:54:22 +0100 4 | Subject: [PATCH 1/1] MDL-12345: component: ok warn me for this 5 | 6 | --- 7 | README.txt | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/README.txt b/README.txt 11 | index 729dbe4..af81703 100644 12 | --- a/README.txt 13 | +++ b/README.txt 14 | @@ -26,3 +26,5 @@ Moodle is written in PHP and JavaScript and uses an SQL database for storing 15 | the data. 16 | 17 | See for details of Moodle's many features. 18 | + 19 | +a dummy commit! 20 | -- 21 | 2.9.0 22 | 23 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-55322/patchset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_gherkin_lint.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | 6 | 7 | Feature name is already used in: mod/glossary/tests/behat/categories.feature 8 | Multiple empty lines are not allowed 9 | Wrong indentation for "and", expected indentation level of 4, but got 6 10 | -------------------------------------------------------------------------------- /tests/fixtures/check_upgrade_savepoints/no_return_statement.patch: -------------------------------------------------------------------------------- 1 | From b11edea305738091fdd5a4468585d7f87dc69185 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 20:46:05 +0100 4 | Subject: [PATCH 1/1] no return statement 5 | 6 | --- 7 | mod/quiz/db/upgrade.php | 1 - 8 | 1 file changed, 1 deletion(-) 9 | 10 | diff --git a/mod/quiz/db/upgrade.php b/mod/quiz/db/upgrade.php 11 | index f42c007..42765c2 100644 12 | --- a/mod/quiz/db/upgrade.php 13 | +++ b/mod/quiz/db/upgrade.php 14 | @@ -193,5 +193,4 @@ function xmldb_quiz_upgrade($oldversion) { 15 | // Moodle v3.1.0 release upgrade line. 16 | // Put any upgrade step following this. 17 | 18 | - return true; 19 | } 20 | -- 21 | 2.9.0 22 | 23 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_bad_amos_command.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | 6 | This section shows the problems detected in the commit messages by the commits checker 7 | AMOS - No valid commands parsed, but 'AMOS BEGIN' in commit. Syntax is wrong. 8 | AMOS - Instruction not understood 'MOV \[nametextarea, mod_data\]\[fieldtypelabel, datafield_textarea\]' 9 | AMOS - String to be moved: nameurl/data to fieldtypelabel/datafield_url 10 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/ok.patch: -------------------------------------------------------------------------------- 1 | From 6e0eeb392b286f2837ce28b2d40d6bc967371648 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 29 Jul 2016 12:54:22 +0100 4 | Subject: [PATCH 1/1] MDL-12345 area: short summary 5 | 6 | This could be seen as a perfect commit message! 7 | --- 8 | README.txt | 2 ++ 9 | 1 file changed, 2 insertions(+) 10 | 11 | diff --git a/README.txt b/README.txt 12 | index 729dbe4..af81703 100644 13 | --- a/README.txt 14 | +++ b/README.txt 15 | @@ -26,3 +26,5 @@ Moodle is written in PHP and JavaScript and uses an SQL database for storing 16 | the data. 17 | 18 | See for details of Moodle's many features. 19 | + 20 | +a dummy commit! 21 | -- 22 | 2.9.0 23 | 24 | -------------------------------------------------------------------------------- /tests/list_valid_components.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load libs/shared_setup 4 | 5 | setup () { 6 | create_git_branch MOODLE_31_STABLE v3.1.0 7 | } 8 | 9 | @test "list_valid_components: 31 components" { 10 | # We need to rewrite the directory in the fixture for verifying correct result. 11 | EXPECTED=$WORKSPACE/valid_components_expected.txt 12 | sed -e "s#\[gitdir\]#${gitdir}#" $BATS_TEST_DIRNAME/fixtures/31-valid_components.txt > $EXPECTED 13 | 14 | OUTPUT=$WORKSPACE/valid_components_out.txt 15 | 16 | # Run test 17 | ci_run_php "list_valid_components/list_valid_components.php --basedir=$gitdir > $OUTPUT" 18 | assert_success 19 | assert_files_same $EXPECTED $OUTPUT 20 | 21 | rm $EXPECTED $OUTPUT 22 | } 23 | 24 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_phpcs_aware_components.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | 6 | This section shows the coding style problems detected in the code by phpcs 7 | 3 | Date: Tue, 7 Jun 2022 16:29:15 +0200 4 | Subject: [PATCH] Add a test into admin/tests 5 | 6 | --- 7 | admin/tests/some_test.php | 6 ++++++ 8 | 1 file changed, 6 insertions(+) 9 | create mode 100644 admin/tests/some_test.php 10 | 11 | diff --git a/admin/tests/some_test.php b/admin/tests/some_test.php 12 | new file mode 100644 13 | index 0000000000..25ec9d94b0 14 | --- /dev/null 15 | +++ b/admin/tests/some_test.php 16 | @@ -0,0 +1,6 @@ 17 | + 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This file specifies intentionally untracked files that all Moodle git 2 | # repositories should ignore. It is recommended not to modify this file in your 3 | # local clone. Instead, use .git/info/exclude and add new records there as 4 | # needed. 5 | # 6 | # Example: if you deploy a contributed plugin mod/foobar into your site, put 7 | # the following line into .git/info/exclude file in your Moodle clone: 8 | # /mod/foobar/ 9 | # 10 | # See gitignore(5) man page for more details 11 | # 12 | *~ 13 | *.swp 14 | /tags 15 | /TAGS 16 | /cscope.* 17 | /.patches/ 18 | /.idea/ 19 | /nbproject/ 20 | CVS 21 | .DS_Store 22 | /.settings/ 23 | /.project 24 | /.buildpath 25 | /.cache 26 | phpunit.xml 27 | # Ignore composer bits. 28 | composer.phar 29 | composer.lock 30 | vendor/ 31 | node_modules/ 32 | -------------------------------------------------------------------------------- /tests/fixtures/check_upgrade_savepoints/blank_upgrade_file.patch: -------------------------------------------------------------------------------- 1 | From 5372cf1855d118c15710bc72e6b31c469d453260 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 20:34:13 +0100 4 | Subject: [PATCH 1/1] blank upgrade file 5 | 6 | --- 7 | admin/tool/messageinbound/db/upgrade.php | 4 ++++ 8 | 1 file changed, 4 insertions(+) 9 | create mode 100644 admin/tool/messageinbound/db/upgrade.php 10 | 11 | diff --git a/admin/tool/messageinbound/db/upgrade.php b/admin/tool/messageinbound/db/upgrade.php 12 | new file mode 100644 13 | index 0000000..c768782 14 | --- /dev/null 15 | +++ b/admin/tool/messageinbound/db/upgrade.php 16 | @@ -0,0 +1,4 @@ 17 | + 3 | Date: Sat, 30 Jul 2016 19:22:36 +0100 4 | Subject: [PATCH 1/1] no moodle internal 5 | 6 | --- 7 | blocks/lp/version.php | 2 -- 8 | 1 file changed, 2 deletions(-) 9 | 10 | diff --git a/blocks/lp/version.php b/blocks/lp/version.php 11 | index 838f0aa..4e38d27 100644 12 | --- a/blocks/lp/version.php 13 | +++ b/blocks/lp/version.php 14 | @@ -22,8 +22,6 @@ 15 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 16 | */ 17 | 18 | -defined('MOODLE_INTERNAL') || die(); 19 | - 20 | $plugin->version = 2016052300; 21 | $plugin->requires = 2016051900; 22 | $plugin->component = 'block_lp'; 23 | -- 24 | 2.9.0 25 | 26 | -------------------------------------------------------------------------------- /tests/fixtures/versions_check_set/main_version_missing.patch: -------------------------------------------------------------------------------- 1 | From 9fdb081861d1387b289ba7fbb95fd7444c0b3e58 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 17:48:10 +0100 4 | Subject: [PATCH 1/1] misisngbranch 5 | 6 | --- 7 | version.php | 1 - 8 | 1 file changed, 1 deletion(-) 9 | 10 | diff --git a/version.php b/version.php 11 | index d5b946c..a1e005e 100644 12 | --- a/version.php 13 | +++ b/version.php 14 | @@ -35,5 +35,4 @@ $version = 2016052300.00; // 20160523 = branching date YYYYMM 15 | 16 | $release = '3.1 (Build: 20160523)'; // Human-friendly version name 17 | 18 | -$branch = '31'; // This version's branch. 19 | $maturity = MATURITY_STABLE; // This version's maturity level. 20 | -- 21 | 2.9.0 22 | 23 | -------------------------------------------------------------------------------- /tests/fixtures/402-php_lint-bad.patch: -------------------------------------------------------------------------------- 1 | From dbe6c7fffdbb08918094540289bf6c1365f161cc Mon Sep 17 00:00:00 2001 2 | From: "Eloy Lafuente (stronk7)" 3 | Date: Fri, 4 Aug 2023 08:28:39 +0200 4 | Subject: [PATCH] MDLSITE-4211 fixture: for php_lint tests 5 | 6 | This should be applied on top of v4.1.0 7 | --- 8 | lib/moodlelib.php | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/lib/moodlelib.php b/lib/moodlelib.php 12 | index 7b7e462219..56ffe31218 100644 13 | --- a/lib/moodlelib.php 14 | +++ b/lib/moodlelib.php 15 | @@ -10882,6 +10882,7 @@ class lang_string { 16 | $this->forcedstring = true; 17 | return array('forcedstring', 'string', 'lang'); 18 | } 19 | +die('oh this is gonna be a problem! 20 | 21 | /** 22 | * Returns the identifier. 23 | -- 24 | 2.40.0 25 | 26 | -------------------------------------------------------------------------------- /tests/fixtures/check_upgrade_savepoints/repeated_savepoint.patch: -------------------------------------------------------------------------------- 1 | From 9c2d7f3f29d70392b53d067d0397df4e6c6a4d31 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 20:31:14 +0100 4 | Subject: [PATCH 1/1] Repeated savepoint call 5 | 6 | --- 7 | lib/db/upgrade.php | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php 11 | index ee468b6..a6ddf67 100644 12 | --- a/lib/db/upgrade.php 13 | +++ b/lib/db/upgrade.php 14 | @@ -2067,6 +2067,7 @@ function xmldb_main_upgrade($oldversion) { 15 | } 16 | // Main savepoint reached. 17 | upgrade_main_savepoint(true, 2016051700.01); 18 | + upgrade_main_savepoint(true, 2016051700.01); 19 | } 20 | 21 | // Moodle v3.1.0 release upgrade line. 22 | -- 23 | 2.9.0 24 | 25 | -------------------------------------------------------------------------------- /tests/fixtures/diff_extract_changes/diff_extract_changes-edge-input.patch: -------------------------------------------------------------------------------- 1 | diff --git a/another_binary.png b/another_binary.png 2 | new file mode 100644 3 | index 00000000000..3cb4b3d9aaf 4 | Binary files /dev/null and b/another_binary.png differ 5 | diff --git a/diff_extract_changes_edge_cases.txt b/diff_extract_changes_edge_cases.txt 6 | index 4e020b9abcd..21a2225922f 100644 7 | --- a/diff_extract_changes_edge_cases.txt 8 | +++ b/diff_extract_changes_edge_cases.txt 9 | @@ -5,10 +5,9 @@ Let's see how out diff extractor behaves with some edge cases. 10 | + 11 | - 12 | ++ 13 | --- 14 | +++ 15 | ---- 16 | ++ 17 | --- 18 | +++ 19 | + 20 | - 21 | +-- 22 | diff --git a/some_binary1.png b/some_binary1.png 23 | deleted file mode 100644 24 | index f6277460437..00000000000 25 | Binary files a/some_binary1.png and /dev/null differ 26 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/includes-parent-in-message.patch: -------------------------------------------------------------------------------- 1 | From 6e0eeb392b286f2837ce28b2d40d6bc967371648 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 29 Jul 2016 12:54:22 +0100 4 | Subject: [PATCH 1/1] MDL-12345 area: short summary 5 | 6 | This commit message should not fail just because it has the word 7 | parent as the first word in the line. 8 | 9 | --- 10 | README.txt | 2 ++ 11 | 1 file changed, 2 insertions(+) 12 | 13 | diff --git a/README.txt b/README.txt 14 | index 729dbe4..af81703 100644 15 | --- a/README.txt 16 | +++ b/README.txt 17 | @@ -26,3 +26,5 @@ Moodle is written in PHP and JavaScript and uses an SQL database for storing 18 | the data. 19 | 20 | See for details of Moodle's many features. 21 | + 22 | +a dummy commit! 23 | -- 24 | 2.9.0 25 | 26 | -------------------------------------------------------------------------------- /tests/fixtures/check_upgrade_savepoints/if_without_savepoint.patch: -------------------------------------------------------------------------------- 1 | From ea489d6722d370c233997d7f97bca49069c59ac6 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 20:54:30 +0100 4 | Subject: [PATCH 1/1] if without savepoint 5 | 6 | --- 7 | lib/db/upgrade.php | 2 -- 8 | 1 file changed, 2 deletions(-) 9 | 10 | diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php 11 | index ee468b6..1512804 100644 12 | --- a/lib/db/upgrade.php 13 | +++ b/lib/db/upgrade.php 14 | @@ -2049,8 +2049,6 @@ function xmldb_main_upgrade($oldversion) { 15 | // Add a default competency rating scale. 16 | make_competence_scale(); 17 | 18 | - // Savepoint reached. 19 | - upgrade_main_savepoint(true, 2016051300.00); 20 | } 21 | 22 | if ($oldversion < 2016051700.01) { 23 | -- 24 | 2.9.0 25 | 26 | -------------------------------------------------------------------------------- /tests/fixtures/31-thirdparty-edgecase.patch: -------------------------------------------------------------------------------- 1 | From 195ecddb57a7d3ecdfade8eca852b188f8297e14 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Thu, 20 Jul 2017 12:57:30 +0100 4 | Subject: [PATCH 1/1] Test modification to non-thirdparty file 5 | 6 | --- 7 | lib/requirejs.php | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/lib/requirejs.php b/lib/requirejs.php 11 | index 7cc8d0f64c..53e372cb20 100644 12 | --- a/lib/requirejs.php 13 | +++ b/lib/requirejs.php 14 | @@ -21,6 +21,7 @@ 15 | * @copyright 2015 Damyon Wiese 16 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 17 | */ 18 | +// Test modification to non-thirdparty file 19 | 20 | // Disable moodle specific debug messages and any errors in output, 21 | // comment out when debugging or better look into error log! 22 | -- 23 | 2.13.3 24 | 25 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/phplint.txt: -------------------------------------------------------------------------------- 1 | Running php syntax check from aeccf4bd944167f06e1cbe089af040174ef412f1 to main_precheck: 2 | /var/lib/jenkins/git_repositories/prechecker/lang/en/error.php - OK 3 | /var/lib/jenkins/git_repositories/prechecker/lang/en/moodle.php - OK 4 | /var/lib/jenkins/git_repositories/prechecker/lib/outputrequirementslib.php - OK 5 | /var/lib/jenkins/git_repositories/prechecker/repository/lib.php - ERROR: PHP Parse error: syntax error, unexpected '{' in /repository/lib.php on line 892 6 | /var/lib/jenkins/git_repositories/prechecker/repository/repository_ajax.php - ERROR: PHP Parse error: syntax error, unexpected '{' in /repository/repository_ajax.php on line 287 7 | /var/lib/jenkins/git_repositories/prechecker/repository/upload/lib.php - ERROR: PHP Parse error: syntax error, unexpected '{' in /repository/upload/lib.php on line 195 8 | PHP syntax errors found. 9 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/phplint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/fixtures/check_upgrade_savepoints/multiple_return.patch: -------------------------------------------------------------------------------- 1 | From 6015aacb1810c0066bbca35913d264919854b20e Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 20:50:55 +0100 4 | Subject: [PATCH 1/1] multiple return statements 5 | 6 | --- 7 | portfolio/googledocs/db/upgrade.php | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/portfolio/googledocs/db/upgrade.php b/portfolio/googledocs/db/upgrade.php 11 | index c02c769..93402d4 100644 12 | --- a/portfolio/googledocs/db/upgrade.php 13 | +++ b/portfolio/googledocs/db/upgrade.php 14 | @@ -23,6 +23,7 @@ defined('MOODLE_INTERNAL') || die(); 15 | function xmldb_portfolio_googledocs_upgrade($oldversion) { 16 | global $CFG; 17 | 18 | + return true; 19 | // Moodle v2.8.0 release upgrade line. 20 | // Put any upgrade step following this. 21 | 22 | -- 23 | 2.9.0 24 | 25 | -------------------------------------------------------------------------------- /tests/fixtures/402-php_lint-ok.patch: -------------------------------------------------------------------------------- 1 | From c6385705362f492fab3dc90cf5317e372fef60c8 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Wed, 15 Jun 2016 22:51:00 +0100 4 | Subject: [PATCH 1/1] MDLSITE-4211 OK fixture: for php_lint tests 5 | 6 | This should be applied on top of v4.1.0 7 | --- 8 | lib/moodlelib.php | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/lib/moodlelib.php b/lib/moodlelib.php 12 | index 8160f89..c7cadf2 100644 13 | --- a/lib/moodlelib.php 14 | +++ b/lib/moodlelib.php 15 | @@ -9321,7 +9321,7 @@ function object_array_unique($array, $keepkeyassoc = true) { 16 | * @return boolean 17 | */ 18 | function is_primary_admin($userid) { 19 | - $primaryadmin = get_admin(); 20 | + $primaryadmin = get_admin(); 21 | 22 | if ($userid == $primaryadmin->id) { 23 | return true; 24 | -- 25 | 2.8.1 26 | 27 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_external_backup.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | 6 | This section shows potential problems detected when there are new database structures.* 7 | problem file="mod/forum/db/upgrade.php" 8 | Database modifications \(new tables or columns\) detected in the patch without any change to some important areas. 9 | No changes detected to external functions, that may affect apps and other web service integrations, please verify! 10 | No changes detected to backup and restore, that may affect storage and transportability, please verify! 11 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/too-long.patch: -------------------------------------------------------------------------------- 1 | From 6643890e938b8c6774a60d768e320ed6dcb60d6c Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 29 Jul 2016 12:54:22 +0100 4 | Subject: [PATCH 1/1] MDL-12345 commits: A really really long commit message 5 | makes git tools cry doesn't it! 6 | 7 | https://docs.moodle.org/dev/index.php?title=Automated_code_review&redirect=no#The_git_commit_summary_limit_is_too_small 8 | --- 9 | README.txt | 2 ++ 10 | 1 file changed, 2 insertions(+) 11 | 12 | diff --git a/README.txt b/README.txt 13 | index 729dbe4..af81703 100644 14 | --- a/README.txt 15 | +++ b/README.txt 16 | @@ -26,3 +26,5 @@ Moodle is written in PHP and JavaScript and uses an SQL database for storing 17 | the data. 18 | 19 | See for details of Moodle's many features. 20 | + 21 | +a dummy commit! 22 | -- 23 | 2.9.0 24 | 25 | -------------------------------------------------------------------------------- /tests/fixtures/35-thirdparty-lib-added.patch: -------------------------------------------------------------------------------- 1 | From 96ec9462a7d7a05f39af044020b63e371831ab05 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Tue, 12 Jul 2016 11:23:56 +0100 4 | Subject: [PATCH] MDLSITE-4678 fixture: adding third party lib 5 | 6 | --- 7 | lib/thirdpartylibs.xml | 6 ++++++ 8 | 1 file changed, 6 insertions(+) 9 | 10 | diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml 11 | index c14a3e01d4..ba719b5f84 100644 12 | --- a/lib/thirdpartylibs.xml 13 | +++ b/lib/thirdpartylibs.xml 14 | @@ -323,4 +323,10 @@ 15 | MIT 16 | 1.1.1 17 | 18 | + 19 | + integrationtest 20 | + Moodle Integration test for MDLSITE-4678 21 | + GPL 22 | + 2.3.0 23 | + 24 | 25 | -- 26 | 2.39.1 27 | 28 | -------------------------------------------------------------------------------- /tests/fixtures/versions_check_set/invalid_component.patch: -------------------------------------------------------------------------------- 1 | From 64deffbccf19fb587ce7b1ff50bef1a1ba169fae Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 19:19:42 +0100 4 | Subject: [PATCH 1/1] invalid componennt 5 | 6 | --- 7 | theme/more/version.php | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/theme/more/version.php b/theme/more/version.php 11 | index b984d73..fbb631e 100644 12 | --- a/theme/more/version.php 13 | +++ b/theme/more/version.php 14 | @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die; 15 | 16 | $plugin->version = 2016052300; 17 | $plugin->requires = 2016051900; 18 | -$plugin->component = 'theme_more'; 19 | +$plugin->component = 'theme_morebeer'; 20 | $plugin->dependencies = array( 21 | 'theme_bootstrapbase' => 2016051900, 22 | 'theme_clean' => 2016051900, 23 | -- 24 | 2.9.0 25 | 26 | -------------------------------------------------------------------------------- /project_size_report/project_size_report.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # $gitdir: Directory containing git repo 3 | # $gitbranch: Branch we are going to check 4 | # $pearpath: Path where the pear executables are available 5 | # $phpcmd: php cli executable 6 | 7 | # file where results will be sent 8 | resultfile=${WORKSPACE}/project_size_report.csv 9 | 10 | # add the PEAR path 11 | PATH="$PATH:/opt/local/bin/:$pearpath"; export PATH 12 | 13 | # calculate some variables 14 | mydir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 15 | 16 | # list of excluded dirs 17 | . ${mydir}/../define_excluded/define_excluded.sh 18 | 19 | # checkout pristine copy of the configure branch 20 | cd ${gitdir} && git checkout ${gitbranch} && git fetch && git reset --hard origin/${gitbranch} 21 | 22 | # Run phploc against the whole codebase 23 | phploc ${excluded_list} --count-tests --log-csv "${resultfile}" ${gitdir} 24 | -------------------------------------------------------------------------------- /tests/fixtures/define_excluded/format-excluded_comma-expected.txt: -------------------------------------------------------------------------------- 1 | # Each line contents must exist independently in results. 2 | *.csv,*.gif,*.ics,*.jpg,*.png,*.svg,.git/, 3 | admin/tool/installaddon/tests/fixtures/versionphp/version1.php, 4 | auth/cas/CAS/,auth/fc/fcFPP.php,backup/bb/bb5.5_to_moodle.xsl, 5 | lib/dragmath/, 6 | lib/editor/atto/tests/fixtures/pretty-good-en.vtt,lib/editor/atto/tests/fixtures/pretty-good-sv.vtt, 7 | repository/s3/S3.php,repository/url/locallib.php,theme/boost/style/moodle.css, 8 | theme/bootstrapbase/amd/src/bootstrap.js,theme/bootstrapbase/javascript/html5shiv.js,theme/bootstrapbase/less/bootstrap,theme/bootstrapbase/less/bootstrap/,theme/classic/style/moodle.css, 9 | theme/mymobile/javascript/,theme/mymobile/jquery/,theme/mymobile/style/jmobile,vendor/,webservice/amf/testclient/AMFTester.mxml,webservice/amf/testclient/customValidators/JSONValidator.as,work/,yui/build/ 10 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/too-long-body.patch: -------------------------------------------------------------------------------- 1 | From 1e9449c06693c07c30b47f9c9589b99aae8d5479 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 29 Jul 2016 12:54:22 +0100 4 | Subject: [PATCH 1/1] MDL-12345 summary: the first line is good! 5 | 6 | But then it all goes wrong, with a message that goes really quite far down to the depths of the right hand side of the screen. This person has never heard of wrapping text, sad eh! 7 | --- 8 | README.txt | 2 ++ 9 | 1 file changed, 2 insertions(+) 10 | 11 | diff --git a/README.txt b/README.txt 12 | index 729dbe4..af81703 100644 13 | --- a/README.txt 14 | +++ b/README.txt 15 | @@ -26,3 +26,5 @@ Moodle is written in PHP and JavaScript and uses an SQL database for storing 16 | the data. 17 | 18 | See for details of Moodle's many features. 19 | + 20 | +a dummy commit! 21 | -- 22 | 2.9.0 23 | 24 | -------------------------------------------------------------------------------- /tests/fixtures/versions_check_set/no_version_defined.patch: -------------------------------------------------------------------------------- 1 | From d565a1d711167edcbdbfc03b14c70ae665037aa2 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 19:25:42 +0100 4 | Subject: [PATCH 1/1] No version set 5 | 6 | --- 7 | enrol/paypal/version.php | 1 - 8 | 1 file changed, 1 deletion(-) 9 | 10 | diff --git a/enrol/paypal/version.php b/enrol/paypal/version.php 11 | index ca3c3b9..edd3d9e 100644 12 | --- a/enrol/paypal/version.php 13 | +++ b/enrol/paypal/version.php 14 | @@ -25,7 +25,6 @@ 15 | 16 | defined('MOODLE_INTERNAL') || die(); 17 | 18 | -$plugin->version = 2016052300; // The current plugin version (Date: YYYYMMDDXX) 19 | $plugin->requires = 2016051900; // Requires this Moodle version 20 | $plugin->component = 'enrol_paypal'; // Full name of the plugin (used for diagnostics) 21 | $plugin->cron = 60; 22 | -- 23 | 2.9.0 24 | 25 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/warning-elsewhere.patch: -------------------------------------------------------------------------------- 1 | From 6e0eeb392b286f2837ce28b2d40d6bc967371648 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 29 Jul 2016 12:54:22 +0100 4 | Subject: [PATCH 1/1] MDL-99999 area: short summary 5 | 6 | And issue being part of an epic or subtask of another can have the issue 7 | code specified elsewhere, for example: Part of MDL-12345 8 | 9 | And that will lead to a more relaxed warning instead of error. 10 | --- 11 | README.txt | 2 ++ 12 | 1 file changed, 2 insertions(+) 13 | 14 | diff --git a/README.txt b/README.txt 15 | index 729dbe4..af81703 100644 16 | --- a/README.txt 17 | +++ b/README.txt 18 | @@ -26,3 +26,5 @@ Moodle is written in PHP and JavaScript and uses an SQL database for storing 19 | the data. 20 | 21 | See for details of Moodle's many features. 22 | + 23 | +a dummy commit! 24 | -- 25 | 2.9.0 26 | 27 | -------------------------------------------------------------------------------- /tests/fixtures/verify_phpunit_xml/multiple_classes_in_file.patch: -------------------------------------------------------------------------------- 1 | From c8985b50116b5d27018f428b7e0f2e0678096efa Mon Sep 17 00:00:00 2001 2 | From: "Eloy Lafuente (stronk7)" 3 | Date: Tue, 7 Jun 2022 18:09:41 +0200 4 | Subject: [PATCH] Using more than one unit test class in a file is detected 5 | 6 | --- 7 | mod/glossary/tests/lib_test.php | 3 +++ 8 | 1 file changed, 3 insertions(+) 9 | 10 | diff --git a/mod/glossary/tests/lib_test.php b/mod/glossary/tests/lib_test.php 11 | index 9d78bed6c3..fb4df1206a 100644 12 | --- a/mod/glossary/tests/lib_test.php 13 | +++ b/mod/glossary/tests/lib_test.php 14 | @@ -29,6 +29,9 @@ global $CFG; 15 | require_once($CFG->dirroot . '/mod/glossary/lib.php'); 16 | require_once($CFG->dirroot . '/mod/glossary/locallib.php'); 17 | 18 | +class another_test extends \advanced_testcase { 19 | +} 20 | + 21 | /** 22 | * Glossary lib testcase. 23 | * 24 | -- 25 | 2.36.1 26 | 27 | -------------------------------------------------------------------------------- /tests/fixtures/39-grunt-js-unbuilt.patch: -------------------------------------------------------------------------------- 1 | From 7999a12d1839d17ab9ddaae20cf672ead09bd8bf Mon Sep 17 00:00:00 2001 2 | From: "Eloy Lafuente (stronk7)" 3 | Date: Thu, 29 Sep 2022 09:40:38 +0200 4 | Subject: [PATCH] NOBUG fixture: unbuilt js change for grunt 5 | 6 | --- 7 | lib/amd/src/url.js | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/lib/amd/src/url.js b/lib/amd/src/url.js 11 | index 61dd56b85e8..0150c1dbfa4 100644 12 | --- a/lib/amd/src/url.js 13 | +++ b/lib/amd/src/url.js 14 | @@ -38,7 +38,7 @@ define(['jquery', 'core/config'], function($, config) { 15 | */ 16 | fileUrl: function(relativeScript, slashArg) { 17 | 18 | - var url = config.wwwroot + relativeScript; 19 | + var url = config.wwwroot + relativeScript + 'hey!'; 20 | 21 | // Force a / 22 | if (slashArg.charAt(0) != '/') { 23 | -- 24 | 2.37.2 25 | 26 | -------------------------------------------------------------------------------- /tests/fixtures/check_upgrade_savepoints/returning_bool.patch: -------------------------------------------------------------------------------- 1 | From 2316d2cae62f8f8e63fe4be5bebdc8a15f5045d5 Mon Sep 17 00:00:00 2001 2 | From: "Eloy Lafuente (stronk7)" 3 | Date: Wed, 13 Jan 2021 17:21:41 +0100 4 | Subject: [PATCH] Return type hint in xmldb upgrade functions 5 | 6 | --- 7 | lib/db/upgrade.php | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php 11 | index 685de9e34da..73493473b6e 100644 12 | --- a/lib/db/upgrade.php 13 | +++ b/lib/db/upgrade.php 14 | @@ -84,7 +84,7 @@ defined('MOODLE_INTERNAL') || die(); 15 | * @param int $oldversion 16 | * @return bool always true 17 | */ 18 | -function xmldb_main_upgrade($oldversion) { 19 | +function xmldb_main_upgrade($oldversion): bool { 20 | global $CFG, $DB; 21 | 22 | require_once($CFG->libdir.'/db/upgradelib.php'); // Core Upgrade-related functions. 23 | -- 24 | 2.30.0 25 | 26 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/grunt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/amos-no-modified-files.patch: -------------------------------------------------------------------------------- 1 | From 0a9f4ab624b0f88c377cbe19189102155d505e06 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 19 Aug 2016 14:15:15 +0100 4 | Subject: [PATCH 1/1] MDL-12345 amos: good syntax, no modified files 5 | 6 | This should be correct AMOS syntax, but not 7 | have any modified causing amos to parse it. 8 | 9 | AMOS BEGIN 10 | CPY [searchengine,admin],[type_search,plugin] 11 | AMOS END 12 | --- 13 | index.php | 1 - 14 | 1 file changed, 1 deletion(-) 15 | 16 | diff --git a/index.php b/index.php 17 | index b500007..43a3c12 100644 18 | --- a/index.php 19 | +++ b/index.php 20 | @@ -16,7 +16,6 @@ 21 | 22 | /** 23 | * Moodle frontpage. 24 | - * 25 | * @package core 26 | * @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com) 27 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 28 | -- 29 | 2.9.0 30 | 31 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_thirdparty_css.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | 7 | 8 | This section shows problems detected with the modification of third party libraries 9 | 10 | modification to third party library \(lib/jquery\) without update to lib/thirdpartylibs.xml or lib/jquery/readme_moodle.txt 11 | -------------------------------------------------------------------------------- /tests/fixtures/check_upgrade_savepoints/wrong_savepoint_version.patch: -------------------------------------------------------------------------------- 1 | From d2e570acddbf7d9270fb12f60df455e6d95e1f60 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 20:56:34 +0100 4 | Subject: [PATCH 1/1] incorrect savepoint version 5 | 6 | --- 7 | mod/lesson/db/upgrade.php | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/mod/lesson/db/upgrade.php b/mod/lesson/db/upgrade.php 11 | index ca0e48b..7342f5b 100644 12 | --- a/mod/lesson/db/upgrade.php 13 | +++ b/mod/lesson/db/upgrade.php 14 | @@ -382,7 +382,7 @@ function xmldb_lesson_upgrade($oldversion) { 15 | } 16 | 17 | // Lesson savepoint reached. 18 | - upgrade_mod_savepoint(true, 2016012800, 'lesson'); 19 | + upgrade_mod_savepoint(true, 2016011800, 'lesson'); 20 | } 21 | // Moodle v3.1.0 release upgrade line. 22 | // Put any upgrade step following this. 23 | -- 24 | 2.9.0 25 | 26 | -------------------------------------------------------------------------------- /tests/fixtures/402-php_lint-vendor.patch: -------------------------------------------------------------------------------- 1 | From d453b3f9d588c8d8355cfcc25a843c68d2afea0a Mon Sep 17 00:00:00 2001 2 | From: "Eloy Lafuente (stronk7)" 3 | Date: Thu, 24 Sep 2020 13:10:01 +0200 4 | Subject: [PATCH] Fixture for php_lint vendor tests 5 | 6 | --- 7 | lib/vendor/test.php | 3 +++ 8 | vendor/test.php | 3 +++ 9 | 2 files changed, 6 insertions(+) 10 | create mode 100644 lib/vendor/test.php 11 | create mode 100644 vendor/test.php 12 | 13 | diff --git a/lib/vendor/test.php b/lib/vendor/test.php 14 | new file mode 100644 15 | index 0000000000..d075f480b6 16 | --- /dev/null 17 | +++ b/lib/vendor/test.php 18 | @@ -0,0 +1,3 @@ 19 | +> "${logfile}" 30 | } 31 | -------------------------------------------------------------------------------- /tests/fixtures/402-mustache_lint-str.patch: -------------------------------------------------------------------------------- 1 | From d64cf216e6f0cdfed617b538fde5b4e193e7da88 Mon Sep 17 00:00:00 2001 2 | From: "Eloy Lafuente (stronk7)" 3 | Date: Tue, 11 Jul 2023 15:16:18 +0200 4 | Subject: [PATCH] MDL-12345: test str helper 5 | 6 | --- 7 | lib/templates/test_str.mustache | 11 +++++++++++ 8 | 1 file changed, 11 insertions(+) 9 | create mode 100644 lib/templates/test_str.mustache 10 | 11 | diff --git a/lib/templates/test_str.mustache b/lib/templates/test_str.mustache 12 | new file mode 100644 13 | index 00000000000..cb7a906deb9 14 | --- /dev/null 15 | +++ b/lib/templates/test_str.mustache 16 | @@ -0,0 +1,11 @@ 17 | +{{! 18 | + @template core/test_str 19 | + 20 | + Example context (json): 21 | + { 22 | + } 23 | + 24 | +}} 25 | +

{{#str}} string, component {{/str}}

26 | + 27 | +Link 28 | -- 29 | 2.40.0 30 | 31 | -------------------------------------------------------------------------------- /tests/fixtures/versions_check_set/invalid_date.patch: -------------------------------------------------------------------------------- 1 | From 1a018f8239e433935461784f12584011bf4a5c1b Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 19:15:15 +0100 4 | Subject: [PATCH 1/1] mod_assign_invalid_date 5 | 6 | --- 7 | mod/assign/version.php | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/mod/assign/version.php b/mod/assign/version.php 11 | index 455abac..9d9aea2 100644 12 | --- a/mod/assign/version.php 13 | +++ b/mod/assign/version.php 14 | @@ -25,6 +25,6 @@ 15 | defined('MOODLE_INTERNAL') || die(); 16 | 17 | $plugin->component = 'mod_assign'; // Full name of the plugin (used for diagnostics). 18 | -$plugin->version = 2016052300; // The current module version (Date: YYYYMMDDXX). 19 | +$plugin->version = 2016222300; // The current module version (Date: YYYYMMDDXX). 20 | $plugin->requires = 2016051900; // Requires this Moodle version. 21 | $plugin->cron = 60; 22 | -- 23 | 2.9.0 24 | 25 | -------------------------------------------------------------------------------- /tests/fixtures/versions_check_set/extra_version_digit.patch: -------------------------------------------------------------------------------- 1 | From 2b23ec51f4e63452a30a861c4bc60f8c1130b58e Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 19:02:03 +0100 4 | Subject: [PATCH 1/1] extra-version-digit 5 | 6 | --- 7 | admin/tool/phpunit/version.php | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/admin/tool/phpunit/version.php b/admin/tool/phpunit/version.php 11 | index 878297a..66c3b2e 100644 12 | --- a/admin/tool/phpunit/version.php 13 | +++ b/admin/tool/phpunit/version.php 14 | @@ -24,7 +24,7 @@ 15 | 16 | defined('MOODLE_INTERNAL') || die(); 17 | 18 | -$plugin->version = 2016052300; // The current plugin version (Date: YYYYMMDDXX) 19 | +$plugin->version = 20160523001; // The current plugin version (Date: YYYYMMDDXX) 20 | $plugin->requires = 2016051900; // Requires this Moodle version 21 | $plugin->component = 'tool_phpunit'; // Full name of the plugin (used for diagnostics) 22 | 23 | -- 24 | 2.9.0 25 | 26 | -------------------------------------------------------------------------------- /tests/fixtures/31-mustache_lint-js_test.patch: -------------------------------------------------------------------------------- 1 | From 8fea79e251e80b79067c4caee9db54049409d266 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 4 Nov 2016 12:07:47 +0000 4 | Subject: [PATCH 1/1] MDL-12345 mustache: fixture for js problem detection 5 | 6 | --- 7 | lib/templates/js_test.mustache | 16 ++++++++++++++++ 8 | 1 file changed, 16 insertions(+) 9 | create mode 100644 lib/templates/js_test.mustache 10 | 11 | diff --git a/lib/templates/js_test.mustache b/lib/templates/js_test.mustache 12 | new file mode 100644 13 | index 0000000..4cc8914 14 | --- /dev/null 15 | +++ b/lib/templates/js_test.mustache 16 | @@ -0,0 +1,16 @@ 17 | +{{! 18 | + @template core/js_test 19 | + 20 | + Fixture for detecting eslint problems. 21 | + 22 | + Example context (json): 23 | + { 24 | + "text": "World!" 25 | + } 26 | + 27 | +}} 28 | +

Hello {{text}}

29 | +{{#js}} 30 | + var my_message = 'Hello {{text}}'; 31 | + alert(my_message); 32 | +{{/js}} 33 | -- 34 | 2.10.0 35 | 36 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/gherkinlint_err.txt: -------------------------------------------------------------------------------- 1 | [{"filePath":"/admin/tool/behat/tests/fixtures/core/test_2.feature","errors":[]},{"filePath":"/admin/tool/behat/tests/fixtures/theme/withfeatures/theme_test_1.feature","errors":[{"message":"Wrong indentation for \"given\", expected indentation level of 4, but got 6","rule":"indentation","line":9},{"message":"Wrong indentation for \"given\", expected indentation level of 4, but got 6","rule":"indentation","line":10}]},{"filePath":"/admin/tool/behat/tests/fixtures/theme/withfeatures/theme_test_2.feature","errors":[{"message":"Feature name is already used in: admin/tool/behat/tests/fixtures/core/test_2.feature","rule":"no-dupe-feature-names","line":2}]},{"filePath":"/admin/tool/capability/tests/behat/show_capabilies.feature","errors":[]},{"filePath":"/admin/tool/task/tests/behat/clear_fail_delay.feature","errors":[{"message":"Multiple empty lines are not allowed","rule":"no-multiple-empty-lines","line":26}]},{"filePath":"/admin/tool/task/tests/behat/manage_tasks.feature","errors":[]}] 2 | -------------------------------------------------------------------------------- /tests/fixtures/31-whitespace-error.patch: -------------------------------------------------------------------------------- 1 | From e85a153c0a41fdf85c1a8f2a4467647eabfc87d6 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Wed, 13 Jul 2016 17:25:47 +0100 4 | Subject: [PATCH 1/1] MDLSITE-4685 whitespace: intoduce error 5 | 6 | Should be applied on top of v3.1.1 7 | --- 8 | config-dist.php | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/config-dist.php b/config-dist.php 12 | index 30d8c15..7be9f53 100644 13 | --- a/config-dist.php 14 | +++ b/config-dist.php 15 | @@ -28,7 +28,7 @@ 16 | // // 17 | /////////////////////////////////////////////////////////////////////////// 18 | unset($CFG); // Ignore this line 19 | -global $CFG; // This is necessary here for PHPUnit execution 20 | +global $CFG; // This is necessary here for PHPUnit execution 21 | $CFG = new stdClass(); 22 | 23 | //========================================================================= 24 | -- 25 | 2.9.0 26 | 27 | -------------------------------------------------------------------------------- /tests/fixtures/versions_check_set/short_version.patch: -------------------------------------------------------------------------------- 1 | From 2e1a493cddbe211f9c9e56fd802ce3b977f285a6 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 19:32:56 +0100 4 | Subject: [PATCH 1/1] Non-full version number 5 | 6 | --- 7 | message/output/jabber/version.php | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/message/output/jabber/version.php b/message/output/jabber/version.php 11 | index 96ae502..5e988ae 100644 12 | --- a/message/output/jabber/version.php 13 | +++ b/message/output/jabber/version.php 14 | @@ -24,6 +24,6 @@ 15 | 16 | defined('MOODLE_INTERNAL') || die(); 17 | 18 | -$plugin->version = 2016052300; // The current plugin version (Date: YYYYMMDDXX) 19 | +$plugin->version = 20; // The current plugin version (Date: YYYYMMDDXX) 20 | $plugin->requires = 2016051900; // Requires this Moodle version 21 | $plugin->component = 'message_jabber'; // Full name of the plugin (used for diagnostics) 22 | -- 23 | 2.9.0 24 | 25 | -------------------------------------------------------------------------------- /tests/fixtures/31-mustache_lint-js_token_test.patch: -------------------------------------------------------------------------------- 1 | From 7c4ad58c7f7a462e39577959a6c4e05a868cc610 Mon Sep 17 00:00:00 2001 2 | From: Andrew Nicols 3 | Date: Mon, 8 Aug 2022 15:07:36 +0800 4 | Subject: [PATCH 1/1] MDL-12345 mustache: fixture for js parsing failure 5 | detection 6 | 7 | --- 8 | lib/templates/js_token_test.mustache | 14 ++++++++++++++ 9 | 1 file changed, 14 insertions(+) 10 | create mode 100644 lib/templates/js_token_test.mustache 11 | 12 | diff --git a/lib/templates/js_token_test.mustache b/lib/templates/js_token_test.mustache 13 | new file mode 100644 14 | index 0000000000..022896ea27 15 | --- /dev/null 16 | +++ b/lib/templates/js_token_test.mustache 17 | @@ -0,0 +1,14 @@ 18 | +{{! 19 | + @template core/js_token_test 20 | + 21 | + Fixture for testing eslint parsing errors. 22 | + 23 | + Example context (json): 24 | + { 25 | + "text": "World!" 26 | + } 27 | +}} 28 | +

Hello {{text}}

29 | +{{#js}} 30 | + var foo bar baz = 'bum'; 31 | +{{/js}} 32 | -- 33 | 2.37.0 34 | 35 | -------------------------------------------------------------------------------- /tests/fixtures/39-grunt-scss-unbuilt.patch: -------------------------------------------------------------------------------- 1 | From 4f1772815048e2177f8df4fd543db01babdc2a86 Mon Sep 17 00:00:00 2001 2 | From: "Eloy Lafuente (stronk7)" 3 | Date: Thu, 29 Sep 2022 09:34:02 +0200 4 | Subject: [PATCH] NOBUG fixture: scss unbuilt for grunt tests 5 | 6 | --- 7 | theme/boost/scss/moodle/reports.scss | 3 +++ 8 | 1 file changed, 3 insertions(+) 9 | 10 | diff --git a/theme/boost/scss/moodle/reports.scss b/theme/boost/scss/moodle/reports.scss 11 | index 79289a17eee..edb83053744 100644 12 | --- a/theme/boost/scss/moodle/reports.scss 13 | +++ b/theme/boost/scss/moodle/reports.scss 14 | @@ -3,6 +3,9 @@ 15 | // The home for small tweaks to reports that don't require 16 | // changes drastic enough to pull in the full module css 17 | // and replace it completely. 18 | +.integrationcsschange { 19 | + display: none; 20 | +} 21 | 22 | #page-report-participation-index .participationselectform div label { // Using 'div' here to override the report styles.css 23 | display: inline-block; 24 | -- 25 | 2.37.2 26 | 27 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/gherkinlint_err.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/fixtures/check_upgrade_savepoints/too_high_savepoint.patch: -------------------------------------------------------------------------------- 1 | From 759377f2f8e235ee37c71f8ac789a4a88444e0c0 Mon Sep 17 00:00:00 2001 2 | From: "Eloy Lafuente (stronk7)" 3 | Date: Fri, 29 Sep 2017 00:56:54 +0200 4 | Subject: [PATCH] Too high versions in savepoints 5 | 6 | --- 7 | mod/assign/db/upgrade.php | 8 ++++++++ 8 | 1 file changed, 8 insertions(+) 9 | 10 | diff --git a/mod/assign/db/upgrade.php b/mod/assign/db/upgrade.php 11 | index c0935c5a21..72c5f823ba 100644 12 | --- a/mod/assign/db/upgrade.php 13 | +++ b/mod/assign/db/upgrade.php 14 | @@ -200,5 +200,13 @@ function xmldb_assign_upgrade($oldversion) { 15 | // Moodle v3.1.0 release upgrade line. 16 | // Put any upgrade step following this. 17 | 18 | + if ($oldversion < 2017022300) { 19 | + 20 | + // v3.1.1 is 2016052300, hardly can accept anything higher than that 21 | + 22 | + // Assign savepoint reached. 23 | + upgrade_mod_savepoint(true, 2017022300, 'assign'); 24 | + } 25 | + 26 | return true; 27 | } 28 | -- 29 | 2.14.1 30 | 31 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/backslash-ended-lines.patch: -------------------------------------------------------------------------------- 1 | From 1e9449c06693c07c30b47f9c9589b99aae8d5479 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 29 Jul 2016 12:54:22 +0100 4 | Subject: [PATCH 1/1] MDL-12345 summary: the first line is good! 5 | 6 | But then it all goes wrong, with a message that goes really quite \ 7 | far down to the depths of the right hand side of the screen. This \ 8 | person has never heard of wrapping text, sad eh! 9 | 10 | The above lines are correct, and shell won't expand those backslashes, but this line will fail for sure because it continues being too long. 11 | --- 12 | README.txt | 2 ++ 13 | 1 file changed, 2 insertions(+) 14 | 15 | diff --git a/README.txt b/README.txt 16 | index 729dbe4..af81703 100644 17 | --- a/README.txt 18 | +++ b/README.txt 19 | @@ -26,3 +26,5 @@ Moodle is written in PHP and JavaScript and uses an SQL database for storing 20 | the data. 21 | 22 | See for details of Moodle's many features. 23 | + 24 | +a dummy commit! 25 | -- 26 | 2.9.0 27 | 28 | -------------------------------------------------------------------------------- /tests/fixtures/31-mustache_lint-full-html-body.patch: -------------------------------------------------------------------------------- 1 | From d7f48a533d3d1bf7bff0e48d5ad6930b4d0838e7 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Wed, 2 Nov 2016 10:41:20 +0000 4 | Subject: [PATCH 1/1] MDL-12345 mustache: fixture for full html 5 | 6 | --- 7 | lib/templates/full-html-page.mustache | 19 +++++++++++++++++++ 8 | 1 file changed, 19 insertions(+) 9 | create mode 100644 lib/templates/full-html-page.mustache 10 | 11 | diff --git a/lib/templates/full-html-page.mustache b/lib/templates/full-html-page.mustache 12 | new file mode 100644 13 | index 0000000..386ffb0 14 | --- /dev/null 15 | +++ b/lib/templates/full-html-page.mustache 16 | @@ -0,0 +1,19 @@ 17 | +{{! 18 | + @template core/full-html-page 19 | + 20 | + Full HTML page test. 21 | + 22 | + Example context (json): 23 | + { 24 | + "message": "Hello world!" 25 | + } 26 | +}} 27 | + 28 | + 29 | + 30 | +Test page 31 | + 32 | + 33 | +

{{message}}

34 | + 35 | + 36 | -- 37 | 2.10.0 38 | 39 | -------------------------------------------------------------------------------- /tests/fixtures/31-mustache_lint-quote_and_uniq.patch: -------------------------------------------------------------------------------- 1 | From 102f9eaa8ba06e42222291a0f7ab10d70d91e7db Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Wed, 2 Nov 2016 19:09:18 +0000 4 | Subject: [PATCH 1/1] MDL-12345: test quote helpers 5 | 6 | --- 7 | lib/templates/test_uniq_and_quote.mustache | 13 +++++++++++++ 8 | 1 file changed, 13 insertions(+) 9 | create mode 100644 lib/templates/test_uniq_and_quote.mustache 10 | 11 | diff --git a/lib/templates/test_uniq_and_quote.mustache b/lib/templates/test_uniq_and_quote.mustache 12 | new file mode 100644 13 | index 0000000..d157d8a 14 | --- /dev/null 15 | +++ b/lib/templates/test_uniq_and_quote.mustache 16 | @@ -0,0 +1,13 @@ 17 | +{{! 18 | + @template core/test_uniq_and_quote 19 | + 20 | + Example context (json): 21 | + { 22 | + "trickycontent": "Some content with \" in it" 23 | + } 24 | + 25 | +}} 26 | +
27 | + 28 | + 29 | +
30 | -- 31 | 2.10.0 32 | 33 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_mustache_lint.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | 6 | 7 | HTML Validation error, line 4: End tag for “body” seen, but there were unclosed elements. 8 | HTML Validation error, line 2: Unclosed element “span”. 9 | Mustache syntax exception: Example context JSON is unparsable, fails with: Syntax error 10 | Example context missing. 11 | Example context missing \(@template section not found.\) 12 | -------------------------------------------------------------------------------- /lang/en/local_ci.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * CI scripts lang strings 19 | * 20 | * @package local_ci 21 | * @copyright 2012 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | defined('MOODLE_INTERNAL') || die; 26 | 27 | $string['pluginname'] = 'CI scripts'; 28 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/amos-good-commands.patch: -------------------------------------------------------------------------------- 1 | From 4a862609d3dc3eaba942f1379cbfde73485e40d6 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 19 Aug 2016 14:15:15 +0100 4 | Subject: [PATCH 1/1] MDL-12345 amos: good commit 5 | 6 | This should be correct AMOS syntax 7 | 8 | AMOS BEGIN 9 | CPY [searchengine,admin],[type_search,plugin] 10 | CPY [emailpasswordchangeinfosubject,core],[emailpasswordchangeinfosubject,auth_oauth2] 11 | AMOS END 12 | --- 13 | lang/en/admin.php | 1 - 14 | 1 file changed, 1 deletion(-) 15 | 16 | diff --git a/lang/en/admin.php b/lang/en/admin.php 17 | index 1101ecf..2255a8c 100644 18 | --- a/lang/en/admin.php 19 | +++ b/lang/en/admin.php 20 | @@ -935,7 +935,6 @@ $string['rssglobaldisabled'] = 'Disabled at server level'; 21 | $string['save'] = 'Save'; 22 | $string['savechanges'] = 'Save changes'; 23 | $string['search'] = 'Search'; 24 | -$string['searchengine'] = 'Search engine'; 25 | $string['searchinsettings'] = 'Search in settings'; 26 | $string['searchresults'] = 'Search results'; 27 | $string['searchsetupinfo'] = 'Search setup'; 28 | -- 29 | 2.9.0 30 | 31 | -------------------------------------------------------------------------------- /tests/fixtures/versions_check_set/version_too_far_in_future.patch: -------------------------------------------------------------------------------- 1 | From b76b0fb4697c0fdceddde11f1d462b25c972400b Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Sat, 30 Jul 2016 19:35:21 +0100 4 | Subject: [PATCH 1/1] Too far in future date. 5 | 6 | Hopefully in 700 years we won't still be using these tests 7 | --- 8 | cache/stores/static/version.php | 4 ++-- 9 | 1 file changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/cache/stores/static/version.php b/cache/stores/static/version.php 12 | index 925c395..e70673b 100644 13 | --- a/cache/stores/static/version.php 14 | +++ b/cache/stores/static/version.php 15 | @@ -27,6 +27,6 @@ 16 | 17 | defined('MOODLE_INTERNAL') || die; 18 | 19 | -$plugin->version = 2016052300; // The current module version (Date: YYYYMMDDXX) 20 | +$plugin->version = 2716052300; // The current module version (Date: YYYYMMDDXX) 21 | $plugin->requires = 2016051900; // Requires this Moodle version. 22 | -$plugin->component = 'cachestore_static'; // Full name of the plugin. 23 | \ No newline at end of file 24 | +$plugin->component = 'cachestore_static'; // Full name of the plugin. 25 | -- 26 | 2.9.0 27 | 28 | -------------------------------------------------------------------------------- /tests/fixtures/31-thirdparty-error.patch: -------------------------------------------------------------------------------- 1 | From 096f3a432dcc478a7277889dee49f46f833c39b5 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Wed, 15 Jun 2016 23:21:24 +0100 4 | Subject: [PATCH 1/1] MDLSITE-4211 fixture: for thirdparty check 5 | 6 | This should be applied on top of v3.1.0 7 | --- 8 | lib/amd/src/mustache.js | 7 ------- 9 | 1 file changed, 7 deletions(-) 10 | 11 | diff --git a/lib/amd/src/mustache.js b/lib/amd/src/mustache.js 12 | index a3ce19e..1075fad 100644 13 | --- a/lib/amd/src/mustache.js 14 | +++ b/lib/amd/src/mustache.js 15 | @@ -25,13 +25,6 @@ 16 | // 17 | 18 | // Description of import into Moodle: 19 | -// Checkout from https://github.com/moodle/custom-mustache.js 20 | -// Rebase onto latest release tag from https://github.com/janl/mustache.js 21 | -// Copy mustache.js into lib/amd/src/ in Moodle folder. 22 | -// Add the license as a comment to the file and these instructions. 23 | -// Add jshint tags so this file is not linted. 24 | -// Remove the "global define:" comment (hint for linter) 25 | -// Make sure that you have not removed the custom code for '$' and '<'. 26 | 27 | /*! 28 | * mustache.js - Logic-less {{mustache}} templates with JavaScript 29 | -- 30 | 2.8.1 31 | 32 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_checker/local_ci_fixture_manyproblems_38.regex: -------------------------------------------------------------------------------- 1 | # Add here as many extended regular expressions (one by line) 2 | # that match the most relevant aspects of the test being executed 3 | # and its smurf.xml results. 4 | 5 | 3 | Date: Fri, 19 Aug 2016 13:00:18 +0100 4 | Subject: [PATCH 1/1] MDL-12345 amos: dummy commit 5 | 6 | Here we are going to test the commit checker.. 7 | 8 | This commit should fail because i'm introducing an amos syntax error 9 | with nametextarea and mod__bar 10 | 11 | AMOS BEGIN 12 | MOV [nametextarea, mod_data][fieldtypelabel, datafield_textarea] 13 | CPY [foo,bar],[foo,mod__bar] 14 | AMOS END 15 | --- 16 | mod/data/lang/en/data.php | 1 - 17 | 1 file changed, 1 deletion(-) 18 | 19 | diff --git a/mod/data/lang/en/data.php b/mod/data/lang/en/data.php 20 | index 0d01c13..e4bb55c 100644 21 | --- a/mod/data/lang/en/data.php 22 | +++ b/mod/data/lang/en/data.php 23 | @@ -259,7 +259,6 @@ $string['namenumber'] = 'Number field'; 24 | $string['namepicture'] = 'Picture field'; 25 | $string['nameradiobutton'] = 'Radio button field'; 26 | $string['nametext'] = 'Text field'; 27 | -$string['nametextarea'] = 'Textarea field'; 28 | $string['nameurl'] = 'URL field'; 29 | $string['newentry'] = 'New entry'; 30 | $string['newfield'] = 'Create a new field'; 31 | -- 32 | 2.9.0 33 | 34 | -------------------------------------------------------------------------------- /tests/libs/bats-support/src/error.bash: -------------------------------------------------------------------------------- 1 | # 2 | # bats-support - Supporting library for Bats test helpers 3 | # 4 | # Written in 2016 by Zoltan Tombol 5 | # 6 | # To the extent possible under law, the author(s) have dedicated all 7 | # copyright and related and neighboring rights to this software to the 8 | # public domain worldwide. This software is distributed without any 9 | # warranty. 10 | # 11 | # You should have received a copy of the CC0 Public Domain Dedication 12 | # along with this software. If not, see 13 | # . 14 | # 15 | 16 | # 17 | # error.bash 18 | # ---------- 19 | # 20 | # Functions implementing error reporting. Used by public helper 21 | # functions or test suits directly. 22 | # 23 | 24 | # Fail and display a message. When no parameters are specified, the 25 | # message is read from the standard input. Other functions use this to 26 | # report failure. 27 | # 28 | # Globals: 29 | # none 30 | # Arguments: 31 | # $@ - [=STDIN] message 32 | # Returns: 33 | # 1 - always 34 | # Inputs: 35 | # STDIN - [=$@] message 36 | # Outputs: 37 | # STDERR - message 38 | fail() { 39 | (( $# == 0 )) && batslib_err || batslib_err "$@" 40 | return 1 41 | } 42 | -------------------------------------------------------------------------------- /tests/fixtures/verify_commit_messages/amos-incomplete.patch: -------------------------------------------------------------------------------- 1 | From 4194b17cdc46b5b76539cc134ac1bb2c3b9a8b17 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 19 Aug 2016 13:03:07 +0100 4 | Subject: [PATCH 1/1] MDL-12345 amos: another problem AMOS commit 5 | 6 | This one should fail because of a started command which 7 | is not complete.. 8 | 9 | AMOS BEGIN 10 | MOV [namefile, mod_data],[fieldtypelabel, datafield_file] 11 | MOV [namecheckbox, mod_data],[fieldtypelabel, datafield_checkbox] 12 | MOV [namelatlong, mod_data],[fieldtypelabel, datafield_latlong] 13 | --- 14 | mod/data/lang/en/data.php | 1 - 15 | 1 file changed, 1 deletion(-) 16 | 17 | diff --git a/mod/data/lang/en/data.php b/mod/data/lang/en/data.php 18 | index 0d01c13..e4bb55c 100644 19 | --- a/mod/data/lang/en/data.php 20 | +++ b/mod/data/lang/en/data.php 21 | @@ -259,7 +259,6 @@ $string['namenumber'] = 'Number field'; 22 | $string['namepicture'] = 'Picture field'; 23 | $string['nameradiobutton'] = 'Radio button field'; 24 | $string['nametext'] = 'Text field'; 25 | -$string['nametextarea'] = 'Textarea field'; 26 | $string['nameurl'] = 'URL field'; 27 | $string['newentry'] = 'New entry'; 28 | $string['newfield'] = 'Create a new field'; 29 | -- 30 | 2.9.0 31 | 32 | -------------------------------------------------------------------------------- /tests/fixtures/31-whitespace-upgradenotes.patch: -------------------------------------------------------------------------------- 1 | From d6a28ff1970f63efe4720a81c8feda8b22bdab0b Mon Sep 17 00:00:00 2001 2 | From: Andrew Nicols 3 | Date: Thu, 3 Oct 2024 23:35:55 +0800 4 | Subject: [PATCH 1/1] Ignore whitespace issues in upgradenotes 5 | 6 | --- 7 | .upgradenotes/MDL-81675-2024052916042539.yml | 13 +++++++++++++ 8 | 1 file changed, 13 insertions(+) 9 | create mode 100644 .upgradenotes/MDL-81675-2024052916042539.yml 10 | 11 | diff --git a/.upgradenotes/MDL-81675-2024052916042539.yml b/.upgradenotes/MDL-81675-2024052916042539.yml 12 | new file mode 100644 13 | index 0000000000..ed29757e0c 14 | --- /dev/null 15 | +++ b/.upgradenotes/MDL-81675-2024052916042539.yml 16 | @@ -0,0 +1,13 @@ 17 | +issueNumber: MDL-81675 18 | +notes: 19 | + core_course: 20 | + - message: >+ 21 | + - New optional `sectionNum` parameter has been added to `activitychooser` 22 | + AMD module initializer. 23 | + 24 | + - New option `sectionnum` parameter has been added to 25 | + `get_course_content_items()` external function. 26 | + 27 | + - New optional `sectionnum` parameter has been added to 28 | + `get_content_items_for_user_in_course()` function. 29 | + type: improved 30 | -- 31 | 2.42.0 32 | 33 | -------------------------------------------------------------------------------- /tracker_content_gadget/clr_candidate_picker_split.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Personal Candidate Picker 4 | 5 | 6 |

7 | [ All ] 8 | [ Alpha ] 9 | [ Moppies ] 10 | [ Hedgehog ] 11 | [ Omega ] 12 | [ Q&Q ] 13 | [ Other ] 14 |

15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/fixtures/39-mustache_lint_plugins-ignores.patch: -------------------------------------------------------------------------------- 1 | From 02c7c121afe0cec8dacdb36ec5dd821ed92a15dc Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?David=20Mudr=C3=A1k?= 3 | Date: Mon, 7 Sep 2020 15:50:28 +0200 4 | Subject: [PATCH 2/2] Add .mustachelintignore to exclude files from HTML 5 | validation 6 | 7 | --- 8 | local/test/templates/.mustachelintignore | 2 ++ 9 | local/test/templates/local/mobile/.mustachelintignore | 3 +++ 10 | 2 files changed, 5 insertions(+) 11 | create mode 100644 local/test/templates/.mustachelintignore 12 | create mode 100644 local/test/templates/local/mobile/.mustachelintignore 13 | 14 | diff --git a/local/test/templates/.mustachelintignore b/local/test/templates/.mustachelintignore 15 | new file mode 100644 16 | index 0000000000..f2d6f7d6b4 17 | --- /dev/null 18 | +++ b/local/test/templates/.mustachelintignore 19 | @@ -0,0 +1,2 @@ 20 | +# Ignore all the mobile app templates. 21 | +mobile_*.mustache 22 | diff --git a/local/test/templates/local/mobile/.mustachelintignore b/local/test/templates/local/mobile/.mustachelintignore 23 | new file mode 100644 24 | index 0000000000..379d827608 25 | --- /dev/null 26 | +++ b/local/test/templates/local/mobile/.mustachelintignore 27 | @@ -0,0 +1,3 @@ 28 | +# Ignore all the templates here. 29 | + 30 | +*.mustache 31 | -- 32 | 2.26.2 33 | 34 | -------------------------------------------------------------------------------- /tests/define_excluded.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load libs/shared_setup 4 | 5 | setup () { 6 | create_git_branch MOODLE_31_STABLE v3.1.0 7 | } 8 | 9 | # Helper for repetitive excluded asserions on all the formats 10 | # usage: assert_define_excluded format 11 | assert_define_excluded_format () { 12 | export format=$1 13 | expected=$BATS_TEST_DIRNAME/fixtures/define_excluded/format-$format-expected.txt 14 | 15 | ci_run define_excluded/define_excluded.sh 16 | assert_success 17 | # Don't want full paths ever 18 | refute_output --partial "$(dirname $gitdir)" 19 | 20 | # Verify all expectations in fixture are in results. 21 | while read -r expectation; do 22 | [[ "$expectation" =~ ^#.*$ ]] && continue # Skip comments. 23 | assert_output --partial "$expectation" 24 | done < "$expected" 25 | } 26 | 27 | @test "define_excluded: generates results correctly for all formats" { 28 | formats=('excluded' 'excluded_comma' 'excluded_comma_wildchars' \ 29 | 'excluded_grep' 'excluded_list' 'excluded_list_wildchars') 30 | for format in "${formats[@]}"; do 31 | assert_define_excluded_format $format 32 | done 33 | } 34 | 35 | @test "define_excluded: is immune to trailing slashes in gitdir" { 36 | export gitdir=$gitdir//// 37 | assert_define_excluded_format excluded 38 | } 39 | -------------------------------------------------------------------------------- /tests/diff_extract_changes.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load libs/shared_setup 4 | 5 | # Helper to assert diff_extract_changes output 6 | # usage: pssert_diff_extract_changes format fixturefilename expectedfilename 7 | assert_diff_extract_changes() { 8 | format=$1 9 | fixture=$BATS_TEST_DIRNAME/fixtures/diff_extract_changes/$2 10 | expected=$BATS_TEST_DIRNAME/fixtures/diff_extract_changes/$3 11 | 12 | out=$BATS_TMPDIR/diff_extract_changes-out 13 | 14 | ci_run_php "diff_extract_changes/diff_extract_changes.php --diff=$fixture --output=$format > $out" 15 | assert_success 16 | assert_files_same $expected $out 17 | rm $out 18 | } 19 | 20 | @test "diff_extract_changes (normal): xml" { 21 | assert_diff_extract_changes xml diff_extract_changes-normal-input.patch diff_extract_changes-normal-expected.xml 22 | } 23 | 24 | @test "diff_extract_changes (normal): txt" { 25 | assert_diff_extract_changes txt diff_extract_changes-normal-input.patch diff_extract_changes-normal-expected.txt 26 | } 27 | 28 | @test "diff_extract_changes (edge): xml" { 29 | assert_diff_extract_changes xml diff_extract_changes-edge-input.patch diff_extract_changes-edge-expected.xml 30 | } 31 | 32 | @test "diff_extract_changes (edge): txt" { 33 | assert_diff_extract_changes txt diff_extract_changes-edge-input.patch diff_extract_changes-edge-expected.txt 34 | } 35 | -------------------------------------------------------------------------------- /tests/fixtures/31-mustache_lint-partials-loaded.patch: -------------------------------------------------------------------------------- 1 | From e5c0e94dde233f5bcf627980ef1afbe91f975a65 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Fri, 14 Oct 2016 12:25:22 +0100 4 | Subject: [PATCH] MDLSITE-4770 - A template to check that partial loading is 5 | working. 6 | 7 | --- 8 | .../templates/test_partial_loading.mustache | 22 +++++++++++++++++++ 9 | 1 file changed, 22 insertions(+) 10 | create mode 100644 blocks/lp/templates/test_partial_loading.mustache 11 | 12 | diff --git a/blocks/lp/templates/test_partial_loading.mustache b/blocks/lp/templates/test_partial_loading.mustache 13 | new file mode 100644 14 | index 00000000000..853d13ea79a 15 | --- /dev/null 16 | +++ b/blocks/lp/templates/test_partial_loading.mustache 17 | @@ -0,0 +1,22 @@ 18 | +{{! 19 | + @template block_lp/test_partial_loading 20 | + 21 | + A template for our lint test to check that partial loading is working. 22 | + 23 | + Classes required for JS: 24 | + * None 25 | + 26 | + Data attibutes required for JS: 27 | + * None 28 | + 29 | + Context variables required for this template: 30 | + * None 31 | + 32 | + Example context (json): { 33 | + "message": "Your pants are on fire!", 34 | + "closebutton": 1, 35 | + "announce": 1, 36 | + "extraclasses": "foo bar" 37 | + } 38 | +}} 39 | +{{> core/notification_info}} 40 | -- 41 | 2.40.0 42 | 43 | -------------------------------------------------------------------------------- /tracker_automations/check_marked_as_integrated/util.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # Checks if any commit from $2 issue is present in the specified major branch. 6 | # (since last roll happened, aka, since upstream last commit) 7 | function check_issue () { 8 | # Fetch the equivalent moodle.git branch (from where we are looking for existing commits). 9 | if ! $(${1} fetch -q git://git.moodle.org/moodle.git ${3#"origin/"}); then 10 | echo " WARNING: moodle.git ${3#"origin/"} fetching problems, cannot look for commits. Please check if that's correct." 11 | return 0 12 | fi 13 | if [[ -z $( ${1} log --grep "${2}" --pretty=oneline --abbrev-commit FETCH_HEAD...${3} ) ]]; then 14 | # If the 2 branch heads (moodle.git and integration.git are exactly the same... it means that 15 | # we have just rolled. In those cases, we give the integrator up to 60 minutes to proceed to 16 | # close the issues. After then, proceed normally, no commits found means error. 17 | if [[ "$( ${1} rev-parse FETCH_HEAD )" == "$( ${1} rev-parse ${3} )" ]]; then 18 | if [[ -n $( ${1} log --pretty=oneline --abbrev-commit --after='60 minutes ago' FETCH_HEAD ) ]]; then 19 | return 0 20 | fi 21 | fi 22 | # Arrived here, it's a problem, commit is missing. 23 | return 1 24 | fi 25 | return 0 26 | } 27 | -------------------------------------------------------------------------------- /check_upgrade_savepoints/check_upgrade_savepoints.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # $WORKSPACE 3 | # $phpcmd: Path to the PHP CLI executable 4 | # $gitdir: Directory containing git repo 5 | # $gitbranch: Branch we are going to check 6 | 7 | # Let's go strict (exit on error) 8 | set -e 9 | 10 | # Verify everything is set 11 | required="WORKSPACE phpcmd gitdir gitbranch" 12 | for var in $required; do 13 | if [ -z "${!var}" ]; then 14 | echo "Error: ${var} environment variable is not defined. See the script comments." 15 | exit 1 16 | fi 17 | done 18 | 19 | # file where results will be sent 20 | resultfile=$WORKSPACE/check_upgrade_savepoints_${gitbranch}.txt 21 | echo -n > "$resultfile" 22 | 23 | # calculate some variables 24 | mydir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 25 | 26 | # checkout pristine copy of the configure branch 27 | cd $gitdir && git reset --hard $gitbranch 28 | 29 | # copy the checker to the gitdir 30 | cp $mydir/check_upgrade_savepoints.php $gitdir/ 31 | 32 | # Run the savpoints checker utility, saving results to file 33 | ${phpcmd} $gitdir/check_upgrade_savepoints.php > "$resultfile" 34 | 35 | # remove the checker from gitdir 36 | rm -fr $gitdir/check_upgrade_savepoints.php 37 | 38 | # Look for ERROR or WARN in the resultsfile 39 | count=`grep -P "ERROR|WARN" "$resultfile" | wc -l` 40 | # Check if there are problems 41 | if (($count > 0)) 42 | then 43 | exit 1 44 | fi 45 | exit 0 46 | -------------------------------------------------------------------------------- /version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * CI scripts version information 19 | * 20 | * @package local_ci 21 | * @copyright 2012 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | defined('MOODLE_INTERNAL') || die; 26 | 27 | $plugin->version = 2022093000; 28 | $plugin->requires = 2019111800; // Moodle 3.8.0 (Build 20191118) and upwards. 29 | $plugin->dependencies = array( // Also requires these plugins to be installed. 30 | 'local_moodlecheck' => '2012011000', 31 | ); 32 | $plugin->component = 'local_ci'; 33 | $plugin->release = '0.9.2'; 34 | $plugin->maturity = MATURITY_BETA; 35 | -------------------------------------------------------------------------------- /groovyscripts/remove_post_action_from_all_jobs.groovy: -------------------------------------------------------------------------------- 1 | // Iterate over all the Freeform jobs in a Jenkins server 2 | // deleting a given (full class name) post-build action (also called publisher) 3 | // The script will fail if the PUBLISHER_TO_KILL plugin/class is not installed 4 | import hudson.model.FreeStyleProject 5 | import hudson.model.Hudson 6 | import hudson.tasks.Publisher 7 | 8 | Boolean DRYRUN = true 9 | Class PUBLISHER_TO_KILL = hudson.plugins.jabber.im.transport.JabberPublisher 10 | 11 | for (item in Hudson.instance.items) { 12 | 13 | println("Job: $item.displayName") 14 | modified = false 15 | 16 | if (Hudson.instance.getJob(item.displayName).getClass() != FreeStyleProject ) { 17 | println("Skipped: $item.displayName") 18 | continue 19 | } 20 | 21 | FreeStyleProject project = Hudson.instance.getJob(item.displayName) 22 | List publishers = project.getPublishersList() 23 | 24 | for (publisher in publishers) { 25 | classname = publisher.getClass() 26 | if (classname.equals(PUBLISHER_TO_KILL)) { 27 | if (DRYRUN) { 28 | println(" - $PUBLISHER_TO_KILL.name WOULD be deleted (DRYRUN enabled)") 29 | } else { 30 | publishers.remove(publisher) 31 | println(" - $PUBLISHER_TO_KILL.name DELETED") 32 | } 33 | modified = true 34 | } 35 | } 36 | if (!DRYRUN && modified) { 37 | project.save() 38 | println(" - Job saved") 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/setup.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load libs/shared_setup 4 | 5 | @test "Git is setup for tests." { 6 | [ -d "$gitdir/.git" ]; 7 | assert_success 8 | } 9 | 10 | @test "phpcs standard path is properly set" { 11 | run [ -f "$LOCAL_CI_TESTS_PHPCS_DIR/ruleset.xml" ]; 12 | assert_success 13 | } 14 | 15 | @test "phpcs is properly installed" { 16 | phpcs=$BATS_TEST_DIRNAME/../vendor/bin/phpcs 17 | 18 | run [ -x $phpcs ] 19 | assert_success 20 | 21 | run $phpcs --version 22 | assert_output --regexp "PHP_CodeSniffer version [0-9]+\.[0-9]+\.[0-9]+ \(stable\) by Squiz and PHPCSStandards" 23 | } 24 | 25 | @test "GNU grep installed" { 26 | # Some scripts depend on grep -P 27 | echo 'test2' | grep -P '^(test\d|testing)$' 28 | assert_success 29 | } 30 | 31 | @test "GNU sed installed" { 32 | # Some scripts depend on sed -r 33 | echo 'test1' | sed -r 's/^test[0-9]$/replaced/' 34 | assert_success 35 | } 36 | 37 | @test "GNU wc installed" { 38 | # Some scripts depend on wc -l having no padding.. 39 | run bash -c "echo '1' | wc -l" 40 | assert_success 41 | assert_output '1' 42 | } 43 | 44 | @test "GNU date installed" { 45 | # Some scripts depend on date -I for iso date 46 | run date -I 47 | assert_success 48 | } 49 | 50 | @test "moodle.git short sha length is expected one" { 51 | # Some scripts depend on it being 10 52 | run bash -c "cd $gitdir && git rev-list --all --abbrev=0 --abbrev-commit | wc -L" 53 | assert_success 54 | assert_output '10' 55 | } 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CI local plugin 2 | 3 | [![Build Status](https://github.com/moodlehq/moodle-local_ci/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/moodlehq/moodle-local_ci/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/moodlehq/moodle-local_ci/graph/badge.svg?token=0u0rBbFrXj)](https://codecov.io/gh/moodlehq/moodle-local_ci) 4 | 5 | This local_ci plugin contains all the scripts needed 6 | by Moodle CI servers to automate checks while 7 | integration happens. 8 | 9 | ## Dependencies 10 | 11 | + Some checks require a MySQL, Moodle main-based site to be up and running. 12 | + Some checks require a PHP engine to run (other are pure shell scripts). 13 | + Some checks require the installation of 3rd part tools (phpunit...). 14 | + Some checks require the presence of local_moodlecheck local plugin. 15 | + To get all other dependencies installed, ensure that both composer and npm are run regularly. 16 | + You can run them standalone or also with the ease and functionalities coming with different tools like: 17 | - Jenkins: http://jenkins-php.org 18 | - GitHub workflows: https://docs.github.com/en/actions/language-and-framework-guides/using-php-with-github-actions 19 | - Travis: https://docs.travis-ci.com/user/languages/php/ 20 | - Docker: https://github.com/moodlehq/moodle-php-apache 21 | - ... 22 | 23 | ## TODO 24 | 25 | + Complete the documentation. 26 | + Document each check properly. 27 | 28 | ## Self-versions 29 | 30 | + 20121112 - Eloy - Initial version of this README.md. 31 | + 20190722 - Eloy - Replace bogus link by some general information alternatives to use the scripts. 32 | -------------------------------------------------------------------------------- /tests/fixtures/versions_check_set/short_array_syntax.patch: -------------------------------------------------------------------------------- 1 | From 96f06391aee02665b9aada9eabe43910d0f79063 Mon Sep 17 00:00:00 2001 2 | From: "Eloy Lafuente (stronk7)" 3 | Date: Fri, 22 Mar 2019 19:51:56 +0100 4 | Subject: [PATCH] Using short arrays syntax (1 and multiline) 5 | 6 | --- 7 | filter/data/version.php | 2 +- 8 | question/type/calculatedmulti/version.php | 4 ++-- 9 | 2 files changed, 3 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/filter/data/version.php b/filter/data/version.php 12 | index 6a662d442b..170a9c8a2d 100644 13 | --- a/filter/data/version.php 14 | +++ b/filter/data/version.php 15 | @@ -29,4 +29,4 @@ $plugin->version = 2016052300; 16 | $plugin->requires = 2016051900; // Requires this Moodle version. 17 | $plugin->component= 'filter_data'; 18 | 19 | -$plugin->dependencies = array('mod_data' => 2016051900); 20 | +$plugin->dependencies = ['mod_data' => 2016051900]; 21 | diff --git a/question/type/calculatedmulti/version.php b/question/type/calculatedmulti/version.php 22 | index 5d6ad23026..1449c9ae19 100644 23 | --- a/question/type/calculatedmulti/version.php 24 | +++ b/question/type/calculatedmulti/version.php 25 | @@ -29,10 +29,10 @@ $plugin->component = 'qtype_calculatedmulti'; 26 | $plugin->version = 2016052300; 27 | 28 | $plugin->requires = 2016051900; 29 | -$plugin->dependencies = array( 30 | +$plugin->dependencies = [ 31 | 'qtype_numerical' => 2016051900, 32 | 'qtype_calculated' => 2016051900, 33 | 'qtype_multichoice' => 2016051900, 34 | -); 35 | +]; 36 | 37 | $plugin->maturity = MATURITY_STABLE; 38 | -- 39 | 2.20.1 40 | 41 | -------------------------------------------------------------------------------- /git_garbage_collector/git_garbage_collector.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # $gitcmd: Path to git executable. 3 | # $gitdir: Directory containing git repo. 4 | # $gcinterval: Number of runs before performing a manual gc of the repo. Defaults to 25. 0 means disabled. 5 | # $gcaggressiveinterval: Number of runs before performing an aggressive gc of the repo. Defaults to 900. 0 means disabled. 6 | 7 | # Want exit on error. 8 | set -e 9 | 10 | # Apply some defaults 11 | gcinterval=${gcinterval:-25} 12 | gcaggressiveinterval=${gcaggressiveinterval:-900} 13 | 14 | # Verify everything is set 15 | required="gitcmd gitdir" 16 | for var in ${required}; do 17 | if [ -z "${!var}" ]; then 18 | echo "Error: ${var} environment variable is not defined. See the script comments." 19 | exit 1 20 | fi 21 | done 22 | 23 | # Calculate some variables 24 | mydir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 25 | 26 | # Verify we are under a git repo. 27 | if [[ ! -d "${gitdir}/.git" ]]; then 28 | echo "Error: Incorrect or non-git gitdir passed. Please fix it." 29 | exit 1 30 | fi 31 | 32 | cd "${gitdir}" 33 | 34 | # Let's verify if a git gc is required. 35 | 36 | random=${RANDOM} 37 | if [[ -n "${BUILD_TAG}" ]]; then # Running jenkins, use build number. 38 | random=${BUILD_NUMBER} 39 | fi 40 | 41 | if [[ ${gcaggressiveinterval} -gt 0 ]] && [[ $((${random} % ${gcaggressiveinterval})) -eq 0 ]]; then 42 | echo "Info: Executing git gc --aggressive" 43 | ${gitcmd} gc --aggressive --quiet 44 | elif [[ ${gcinterval} -gt 0 ]] && [[ $((${random} % ${gcinterval})) -eq 0 ]]; then 45 | echo "Info: Executing git gc" 46 | ${gitcmd} gc --quiet 47 | fi 48 | -------------------------------------------------------------------------------- /tests/fixtures/remote_branch_reporter/MDL-54987/eslint.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/fixtures/31-mustache_lint-theme_loading.patch: -------------------------------------------------------------------------------- 1 | From 05e34a539f00c89f9dc94bb695af4839b73b1f35 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Wed, 2 Nov 2016 12:17:41 +0000 4 | Subject: [PATCH 1/1] MDL-12345 mustache: fixture for theme loading 5 | 6 | --- 7 | .../bootstrapbase/templates/core_output/div-start.mustache | 1 + 8 | theme/bootstrapbase/templates/test-theme-loading.mustache | 13 +++++++++++++ 9 | 2 files changed, 14 insertions(+) 10 | create mode 100644 theme/bootstrapbase/templates/core_output/div-start.mustache 11 | create mode 100644 theme/bootstrapbase/templates/test-theme-loading.mustache 12 | 13 | diff --git a/theme/bootstrapbase/templates/core_output/div-start.mustache b/theme/bootstrapbase/templates/core_output/div-start.mustache 14 | new file mode 100644 15 | index 0000000..e54a273 16 | --- /dev/null 17 | +++ b/theme/bootstrapbase/templates/core_output/div-start.mustache 18 | @@ -0,0 +1 @@ 19 | +
20 | diff --git a/theme/bootstrapbase/templates/test-theme-loading.mustache b/theme/bootstrapbase/templates/test-theme-loading.mustache 21 | new file mode 100644 22 | index 0000000..57fd9f0 23 | --- /dev/null 24 | +++ b/theme/bootstrapbase/templates/test-theme-loading.mustache 25 | @@ -0,0 +1,13 @@ 26 | +{{! 27 | + @template theme_bootstrapbase/test.mustache 28 | + 29 | + A bit of a silly template to test that theme partials are being loaded. 30 | + 31 | + The partial 'core_output/div-start' doesn't exist in at 3.1.2, so this template 32 | + will only validate when we load from theme_bootstrapbase. 33 | + 34 | + Example context (json): {} 35 | +}} 36 | +{{> core_output/div-start}} 37 | +Hello World! 38 | +
39 | -- 40 | 2.10.0 41 | 42 | -------------------------------------------------------------------------------- /tests/detect_conflicts.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load libs/shared_setup 4 | 5 | setup () { 6 | create_git_branch MOODLE_31_STABLE v3.1.1 7 | # Restore workspace if not first test. 8 | first_test || restore_workspace 9 | } 10 | 11 | teardown () { 12 | # Store workspace if not last test. 13 | last_test || store_workspace 14 | } 15 | 16 | @test "detect_conflicts: first run OK" { 17 | # On first run, there are no results to compare to so should always 18 | # pass. 19 | ci_run detect_conflicts/detect_conflicts.sh 20 | assert_success 21 | assert_output --partial "current count: 0" 22 | # The 'no previously recorded value' number is 999999 23 | assert_output --partial "previous count: 999999" 24 | assert_output --partial "best count: 999999" 25 | assert_output --partial "got best results ever, yay!" 26 | } 27 | 28 | @test "detect_conflicts: normal state OK" { 29 | # On second run, should still pass with same results 30 | ci_run detect_conflicts/detect_conflicts.sh 31 | assert_success 32 | assert_output --partial "current count: 0" 33 | assert_output --partial "previous count: 0" 34 | assert_output --partial "best count: 0" 35 | assert_output --partial "continue in best results ever" 36 | } 37 | 38 | @test "detect_conflicts: failure reported when merge conflict detected" { 39 | git_apply_fixture 31-merge-conflict.patch 40 | 41 | ci_run detect_conflicts/detect_conflicts.sh 42 | assert_failure 43 | assert_output --partial "current count: 3" 44 | assert_output --partial "previous count: 0" 45 | assert_output --partial "best count: 0" 46 | assert_output --partial "worse results than previous counter" 47 | } 48 | -------------------------------------------------------------------------------- /jira.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # This file contains the standard configuration relating to all queries used for tracker automations. 4 | # Any use of numeric custom fields or filters should be defined here. 5 | # This file should be sourced by any script that needs to use the tracker. 6 | 7 | set -e 8 | 9 | customfield_automatedTestResults="Automated test results" 10 | customfield_componentLeadReview="Component Lead Review" 11 | customfield_currentlyInIntegration="Currently in integration" 12 | customfield_integrationDate="Integration date" 13 | customfield_integrationPriority="Integration priority" 14 | customfield_integrator="Integrator" 15 | customfield_pullFromRepository="Pull from Repository" 16 | customfield_tester="Tester" 17 | 18 | 19 | filter_candidatesForCLR="Weekly: Candidates for CLR (not held)" 20 | filter_candidatesForIntegration="Weekly: Candidates for Integration (not held)" 21 | filter_integrationCLRDecision="Weekly: Issues to decide between IR/CLR" 22 | filter_issuesHeldUntilAfterRelease="Issues agreed to be after release" 23 | filter_issuesVotedToUnhold="Issues that have been voted for unhold" 24 | filter_issuesWaitingForReviewOrInProgress="Integration: Current queue for issues waiting for review or review in progress" 25 | filter_mustFixIssues="All \"must-fix\" issues" 26 | 27 | # Verify everything is set 28 | required="jiraclicmd jiraserver jirauser jirapass" 29 | for var in $required; do 30 | if [ -z "${!var}" ]; then 31 | echo "Error: ${var} environment variable is not defined. See the script comments." 32 | exit 1 33 | fi 34 | done 35 | 36 | # Set the base request command. 37 | basereq="${jiraclicmd} --server ${jiraserver} --user ${jirauser} --password ${jirapass}" 38 | -------------------------------------------------------------------------------- /tests/fixtures/31-thirdparty-ok.patch: -------------------------------------------------------------------------------- 1 | From c0805275c6a79422632d0fb10bd7fa9f518929a8 Mon Sep 17 00:00:00 2001 2 | From: Dan Poltawski 3 | Date: Wed, 15 Jun 2016 23:21:24 +0100 4 | Subject: [PATCH 1/1] MDLSITE-4211 fixture: OK thirdparty check 5 | 6 | This should be applied on top of v3.1.0 7 | --- 8 | lib/amd/src/mustache.js | 7 ------- 9 | lib/thirdpartylibs.xml | 2 +- 10 | 2 files changed, 1 insertion(+), 8 deletions(-) 11 | 12 | diff --git a/lib/amd/src/mustache.js b/lib/amd/src/mustache.js 13 | index a3ce19e..1075fad 100644 14 | --- a/lib/amd/src/mustache.js 15 | +++ b/lib/amd/src/mustache.js 16 | @@ -25,13 +25,6 @@ 17 | // 18 | 19 | // Description of import into Moodle: 20 | -// Checkout from https://github.com/moodle/custom-mustache.js 21 | -// Rebase onto latest release tag from https://github.com/janl/mustache.js 22 | -// Copy mustache.js into lib/amd/src/ in Moodle folder. 23 | -// Add the license as a comment to the file and these instructions. 24 | -// Add jshint tags so this file is not linted. 25 | -// Remove the "global define:" comment (hint for linter) 26 | -// Make sure that you have not removed the custom code for '$' and '<'. 27 | 28 | /*! 29 | * mustache.js - Logic-less {{mustache}} templates with JavaScript 30 | diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml 31 | index 6440a73..2779103 100644 32 | --- a/lib/thirdpartylibs.xml 33 | +++ b/lib/thirdpartylibs.xml 34 | @@ -261,7 +261,7 @@ 35 | amd/src/mustache.js 36 | Mustache.js 37 | MIT 38 | - 2.2.1 39 | + 2.2.2 40 | 41 | 42 | graphlib.php 43 | -- 44 | 2.8.1 45 | 46 | -------------------------------------------------------------------------------- /mustache_lint/simple_core_component_mustache_loader.php: -------------------------------------------------------------------------------- 1 | = 8.1 warnings. 11 | $this->theme = $theme; 12 | } 13 | 14 | /** 15 | * Helper function for getting a Mustache template file name. 16 | * Uses the leading component to restrict us specific directories. 17 | * 18 | * @param string $name 19 | * @return string Template file name 20 | */ 21 | protected function getFileName($name) { 22 | if (strpos($name, '/') === false) { 23 | // Silently ignore. 24 | return false; 25 | } 26 | 27 | list($component, $templatename) = explode('/', $name, 2); 28 | 29 | if ($this->theme) { 30 | // The real mustache loader handles theme parents - we don't here for simplicity. 31 | $themedir = core_component::get_plugin_directory('theme', $this->theme); 32 | 33 | $themetemplate = $themedir . '/templates/' . $component . '/'. $templatename . '.mustache'; 34 | if (file_exists($themetemplate)) { 35 | return $themetemplate; 36 | } 37 | } 38 | 39 | $compdirectory = core_component::get_component_directory($component); 40 | $path = $compdirectory . '/templates/' . $templatename . '.mustache'; 41 | if (!file_exists($path)) { 42 | return false; 43 | } 44 | 45 | return $path; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tracker_automations/bulk_precheck_issues/util.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # Generates tracker code for positive emotion 5 | function positive_tracker_emoticon() { 6 | local rand=$[ RANDOM % 2] 7 | # Only do fun stuff 1/3 of the time: 8 | if [[ $rand -eq 0 ]] 9 | then 10 | image=$(get_happy_image) 11 | echo "${image}" 12 | else 13 | echo '(y)' 14 | fi 15 | } 16 | 17 | # Generates tracker comment code for negative emotion 18 | function negative_tracker_emoticon() { 19 | local rand=$[ RANDOM % 5] 20 | # Only do fun stuff 1/6 of the time: 21 | if [[ $rand -eq 0 ]] 22 | then 23 | image=$(get_sad_image) 24 | echo "${image}" 25 | else 26 | echo '(n)' 27 | fi 28 | } 29 | 30 | 31 | function get_happy_image() { 32 | # smiling face with halo 😇 33 | images[0]='😇' 34 | # balloon🎈 35 | images[1]='🎈' 36 | # party popper 🎉 37 | images[2]='🎉' 38 | # clinking beer mugs 🍻 39 | images[3]='🍻' 40 | # cookie 🍪 41 | images[4]='🍪' 42 | # cake 🍰 43 | images[5]='🍰' 44 | # glowing star 🌟 45 | images[6]='🌟' 46 | 47 | index=$[$RANDOM % ${#images[@]}] 48 | echo ${images[$index]} 49 | } 50 | 51 | function get_sad_image() { 52 | # fire 🔥 53 | images[0]='🔥' 54 | # pile of poo 💩 55 | images[1]='💩' 56 | # speak-no-evil monkey 🙊 57 | images[2]='🙊' 58 | # bug 🐜 59 | images[3]='🐜' 60 | # face screaming in fear 😱 61 | images[4]='😱' 62 | # construction sign 🚧 63 | images[5]='🚧' 64 | # sos 🆘 65 | images[6]='🆘' 66 | # skull 💀 67 | images[7]='💀' 68 | 69 | index=$[$RANDOM % ${#images[@]}] 70 | echo ${images[$index]} 71 | } 72 | -------------------------------------------------------------------------------- /tests/fixtures/checkstyle/mustachelint.txt: -------------------------------------------------------------------------------- 1 | Running mustache lint from f54a16fc738153a0b1bf766e7440d3655321a821 to 6b5d0e976a85dfdc1d978ceb2800dc0cb3f9a58d: 2 | /Users/danp/www/im/message/output/popup/templates/message_popover.mustache - ERROR: Mustache syntax exception: Nesting error: core/popover_region (on line 2) vs. classes (on line 3) 3 | /Users/danp/www/im/message/templates/message_area_contacts.mustache - WARNING: Example context missing. 4 | /Users/danp/www/im/message/templates/message_area_contacts_area.mustache - WARNING: Example context missing. 5 | /Users/danp/www/im/message/templates/message_area_contacts_area.mustache - WARNING: HTML Validation error, line 15: An element with “role=tab” must be contained in, or owned by, an element with “role=tablist”. (abs">