Skip to content

Commit

Permalink
Merge pull request #309 from andrewnicols/whitespaceIgnoreUpgradeNotes
Browse files Browse the repository at this point in the history
Ignore whitespace issues in upgrade notes yml
  • Loading branch information
sarjona authored Oct 3, 2024
2 parents 779bfa9 + 52d531e commit b8dff00
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions define_excluded/define_excluded.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
32 changes: 32 additions & 0 deletions tests/fixtures/31-whitespace-upgradenotes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From d6a28ff1970f63efe4720a81c8feda8b22bdab0b Mon Sep 17 00:00:00 2001
From: Andrew Nicols <andrew@nicols.co.uk>
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

12 changes: 12 additions & 0 deletions tests/illegal_whitespace.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b8dff00

Please sign in to comment.