diff --git a/define_excluded/define_excluded.sh b/define_excluded/define_excluded.sh index d384ca92..13e0e66d 100755 --- a/define_excluded/define_excluded.sh +++ b/define_excluded/define_excluded.sh @@ -7,6 +7,7 @@ # Define directories usually excluded by various CI tools excluded=".git/ +.upgradenotes/*.yml auth/cas/CAS/ admin/tool/componentlibrary/hugo/dist/css/docs.css.map admin/tool/componentlibrary/docs/ diff --git a/tests/fixtures/31-whitespace-upgradenotes.patch b/tests/fixtures/31-whitespace-upgradenotes.patch new file mode 100644 index 00000000..90dbcfc8 --- /dev/null +++ b/tests/fixtures/31-whitespace-upgradenotes.patch @@ -0,0 +1,32 @@ +From d6a28ff1970f63efe4720a81c8feda8b22bdab0b Mon Sep 17 00:00:00 2001 +From: Andrew Nicols +Date: Thu, 3 Oct 2024 23:35:55 +0800 +Subject: [PATCH 1/1] Ignore whitespace issues in upgradenotes + +--- + .upgradenotes/MDL-81675-2024052916042539.yml | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + create mode 100644 .upgradenotes/MDL-81675-2024052916042539.yml + +diff --git a/.upgradenotes/MDL-81675-2024052916042539.yml b/.upgradenotes/MDL-81675-2024052916042539.yml +new file mode 100644 +index 0000000000..ed29757e0c +--- /dev/null ++++ b/.upgradenotes/MDL-81675-2024052916042539.yml +@@ -0,0 +1,13 @@ ++issueNumber: MDL-81675 ++notes: ++ core_course: ++ - message: >+ ++ - New optional `sectionNum` parameter has been added to `activitychooser` ++ AMD module initializer. ++ ++ - New option `sectionnum` parameter has been added to ++ `get_course_content_items()` external function. ++ ++ - New optional `sectionnum` parameter has been added to ++ `get_content_items_for_user_in_course()` function. ++ type: improved +-- +2.42.0 + diff --git a/tests/illegal_whitespace.bats b/tests/illegal_whitespace.bats index 0c87523a..61ed7ecf 100755 --- a/tests/illegal_whitespace.bats +++ b/tests/illegal_whitespace.bats @@ -37,6 +37,18 @@ teardown () { assert_output --partial "continue in best results ever" } +@test "illegal_whitespace: failure ignored for excluded file" { + # Lets introduce a whitespace error and ensure it fails + git_apply_fixture 31-whitespace-upgradenotes.patch + + ci_run illegal_whitespace/illegal_whitespace.sh + assert_success + assert_output --partial "current count: 959" + assert_output --partial "previous count: 959" + assert_output --partial "best count: 959" + assert_output --partial "continue in best results ever" +} + @test "illegal_whitespace: failure reported when whitespace error detected" { # Lets introduce a whitespace error and ensure it fails git_apply_fixture 31-whitespace-error.patch