Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

#34 - Introduce unit tests #35

Merged
merged 20 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0ebfef2
#34 - Introduce unit tests
miroslavpojer Jan 22, 2024
e9681cb
- Rework exit calls and exception throwing to use core.setFailed().
miroslavpojer Jan 22, 2024
c61db84
- Debugging and fixes.
miroslavpojer Jan 22, 2024
f553522
- Debugging and fixes.
miroslavpojer Jan 22, 2024
650597d
- Backup of latest dev state before experiments.
miroslavpojer Jan 23, 2024
47e69aa
- Backup of latest dev state before experiments.
miroslavpojer Jan 23, 2024
52f0b71
- Backup of latest dev state before next test development.
miroslavpojer Jan 23, 2024
1fdc68e
- Fix of failing usage in yml file.
miroslavpojer Jan 23, 2024
2eb9c02
- Implemented new test.
miroslavpojer Jan 23, 2024
7a301c4
- 6 unit tests passing / 12 skipped.
miroslavpojer Jan 24, 2024
e053106
- +2 unit tests passing / 10 skipped.
miroslavpojer Jan 24, 2024
cce6519
- 9 unit tests passing / 9 skipped.
miroslavpojer Jan 24, 2024
d6f66de
- Debugging no previous release tests.
miroslavpojer Jan 25, 2024
5c88f0f
- All planned unit tests implemented and passing.
miroslavpojer Jan 25, 2024
8923ef5
- Code review and clean up.
miroslavpojer Jan 25, 2024
b0c719f
- Code review and clean up.
miroslavpojer Jan 25, 2024
8ed98df
Merge branch 'master' into feature/34_Introduce_unit_tests
miroslavpojer Jan 25, 2024
ce94bf2
- Debugging the problem with providing PR older than since value.
miroslavpojer Jan 25, 2024
aea52a4
- Debugging the problem with providing PR older than since value.
miroslavpojer Jan 25, 2024
1fed581
- Fixed bug in PR before 'since' decision logic.
miroslavpojer Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ npm run build

Then, commit action.yml and dist/index.js to your repository.

### Run unit test
First install [jest](https://jestjs.io/) testing framework.
```
npm install --save-dev jest
npm install @actions/core
npm install @actions/github
```
Launch unit tests.
```
npm test
```
## Features
### Release Notes Extraction Process
Expand Down
29 changes: 29 additions & 0 deletions __tests__/data/rls_notes_empty_with_all_chapters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### Breaking Changes 💥
No entries detected.

### New Features 🎉
No entries detected.

### Bugfixes 🛠
No entries detected.

### Closed Issues without Pull Request ⚠️
All closed issues linked to a Pull Request.

### Closed Issues without User Defined Labels ⚠️
All closed issues contain at least one of user defined labels.

### Closed Issues without Release Notes ⚠️
All closed issues have release notes.

### Merged PRs without Linked Issue ⚠️
All merged PRs are linked to issues.

### Merged PRs Linked to Open Issue ⚠️
All merged PRs are linked to Closed issues.

### Closed PRs without Linked Issue ⚠️
All closed PRs are linked to issues.

#### Full Changelog
https://github.com/owner/repo/commits/v0.1.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#### Full Changelog
https://github.com/owner/repo/commits/v0.1.1
11 changes: 11 additions & 0 deletions __tests__/data/rls_notes_empty_with_hidden_warning_chapters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Breaking Changes 💥
No entries detected.

### New Features 🎉
No entries detected.

### Bugfixes 🛠
No entries detected.

#### Full Changelog
https://github.com/owner/repo/commits/v0.1.1
20 changes: 20 additions & 0 deletions __tests__/data/rls_notes_empty_with_no_custom_chapters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### Closed Issues without Pull Request ⚠️
All closed issues linked to a Pull Request.

### Closed Issues without User Defined Labels ⚠️
All closed issues contain at least one of user defined labels.

### Closed Issues without Release Notes ⚠️
All closed issues have release notes.

### Merged PRs without Linked Issue ⚠️
All merged PRs are linked to issues.

### Merged PRs Linked to Open Issue ⚠️
All merged PRs are linked to Closed issues.

### Closed PRs without Linked Issue ⚠️
All closed PRs are linked to issues.

#### Full Changelog
https://github.com/owner/repo/commits/v0.1.1
54 changes: 54 additions & 0 deletions __tests__/data/rls_notes_fully_populated_custom_skip_label.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
### Breaking Changes 💥
- #8 _Issue title 8 - with co-author|private mail_ implemented by @johnDoe, Jane Doe in [#8](link-to-pr-8)
- note about change in Issue 8
- #7 _Issue title 7 - with co-author|public mail_ implemented by @janeDoe, @johnDoe in [#7](link-to-pr-7)
- note about change in Issue 7


### New Features 🎉
- #6 _Issue title 6 - not assigned|no PR_ implemented by "Missing Assignee or Contributor"
- note about change in Issue 6
- #4 _Issue title 4 - assigned|one PR_ implemented by @johnDoe in [#4](link-to-pr-4)
- note about change in Issue 4
- #2 _Issue title 2_ implemented by @johnDoe in [#2](link-to-pr-2)
- note about change in Issue 2


### Bugfixes 🛠
- #1 _Issue title 1_ implemented by @janeDoe in [#1](link-to-pr-1)
- note about change in Issue 1


### Closed Issues without Pull Request ⚠️
- #10 _Issue title 10 - skip label_ implemented by @janeDoe
- #6 _Issue title 6 - not assigned|no PR_ implemented by "Missing Assignee or Contributor"
- note about change in Issue 6


### Closed Issues without User Defined Labels ⚠️
- #10 _Issue title 10 - skip label_ implemented by @janeDoe
- #9 _Issue title 9 - no user defined label_ implemented by @janeDoe in [#9](link-to-pr-9)
- note about change in Issue 9
- #3 _Issue title 3 - no release note comment|typo label_ implemented by @janeDoe in [#3](link-to-pr-3)


### Closed Issues without Release Notes ⚠️
- #10 _Issue title 10 - skip label_ implemented by @janeDoe
- #3 _Issue title 3 - no release note comment|typo label_ implemented by @janeDoe in [#3](link-to-pr-3)


### Merged PRs without Linked Issue ⚠️
#1004 _Pull Request 4 - no linked issue - merged_
#1006 _Pull Request 6 - skip label_


### Merged PRs Linked to Open Issue ⚠️
#1003 _Pull Request 3 - linked to open issue_


### Closed PRs without Linked Issue ⚠️
#1002 _Pull Request 2 - no linked issue - closed_


#### Full Changelog
https://github.com/owner/repo/compare/v0.1.0...v0.1.1
53 changes: 53 additions & 0 deletions __tests__/data/rls_notes_fully_populated_first_release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
### Breaking Changes 💥
- #8 _Issue title 8 - with co-author|private mail_ implemented by @johnDoe, Jane Doe in [#8](link-to-pr-8)
- note about change in Issue 8
- #7 _Issue title 7 - with co-author|public mail_ implemented by @janeDoe, @johnDoe in [#7](link-to-pr-7)
- note about change in Issue 7


### New Features 🎉
- #6 _Issue title 6 - not assigned|no PR_ implemented by "Missing Assignee or Contributor"
- note about change in Issue 6
- #5 _Issue title 5 - not assigned|three PRs_ implemented by "Missing Assignee or Contributor" in [#5](link-to-pr-5), [#15](link-to-pr-15), [#16](link-to-pr-16)
- note about change in Issue 5
- #4 _Issue title 4 - assigned|one PR_ implemented by @johnDoe in [#4](link-to-pr-4)
- note about change in Issue 4
- #2 _Issue title 2_ implemented by @johnDoe in [#2](link-to-pr-2)
- note about change in Issue 2


### Bugfixes 🛠
- #1 _Issue title 1_ implemented by @janeDoe in [#1](link-to-pr-1)
- note about change in Issue 1


### Closed Issues without Pull Request ⚠️
- #6 _Issue title 6 - not assigned|no PR_ implemented by "Missing Assignee or Contributor"
- note about change in Issue 6


### Closed Issues without User Defined Labels ⚠️
- #9 _Issue title 9 - no user defined label_ implemented by @janeDoe in [#9](link-to-pr-9)
- note about change in Issue 9
- #3 _Issue title 3 - no release note comment|typo label_ implemented by @janeDoe in [#3](link-to-pr-3)


### Closed Issues without Release Notes ⚠️
- #3 _Issue title 3 - no release note comment|typo label_ implemented by @janeDoe in [#3](link-to-pr-3)


### Merged PRs without Linked Issue ⚠️
#1001 _Pull Request 1_
#1004 _Pull Request 4 - no linked issue - merged_


### Merged PRs Linked to Open Issue ⚠️
#1003 _Pull Request 3 - linked to open issue_


### Closed PRs without Linked Issue ⚠️
#1002 _Pull Request 2 - no linked issue - closed_


#### Full Changelog
https://github.com/owner/repo-no-rls/commits/v0.1.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
### Breaking Changes 💥
- #8 _Issue title 8 - with co-author|private mail_ implemented by @johnDoe, Jane Doe in [#8](link-to-pr-8)
- note about change in Issue 8
- #7 _Issue title 7 - with co-author|public mail_ implemented by @janeDoe, @johnDoe in [#7](link-to-pr-7)
- note about change in Issue 7


### New Features 🎉
- #6 _Issue title 6 - not assigned|no PR_ implemented by "Missing Assignee or Contributor"
- note about change in Issue 6
- #5 _Issue title 5 - not assigned|three PRs_ implemented by "Missing Assignee or Contributor" in [#5](link-to-pr-5), [#15](link-to-pr-15), [#16](link-to-pr-16)
- note about change in Issue 5
- #4 _Issue title 4 - assigned|one PR_ implemented by @johnDoe in [#4](link-to-pr-4)
- note about change in Issue 4
- #2 _Issue title 2_ implemented by @johnDoe in [#2](link-to-pr-2)
- note about change in Issue 2


### Bugfixes 🛠
- #1 _Issue title 1_ implemented by @janeDoe in [#1](link-to-pr-1)
- note about change in Issue 1


#### Full Changelog
https://github.com/owner/repo/compare/v0.1.0...v0.1.1
53 changes: 53 additions & 0 deletions __tests__/data/rls_notes_fully_populated_in_default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
### Breaking Changes 💥
- #8 _Issue title 8 - with co-author|private mail_ implemented by @johnDoe, Jane Doe in [#8](link-to-pr-8)
- note about change in Issue 8
- #7 _Issue title 7 - with co-author|public mail_ implemented by @janeDoe, @johnDoe in [#7](link-to-pr-7)
- note about change in Issue 7


### New Features 🎉
- #6 _Issue title 6 - not assigned|no PR_ implemented by "Missing Assignee or Contributor"
- note about change in Issue 6
- #5 _Issue title 5 - not assigned|three PRs_ implemented by "Missing Assignee or Contributor" in [#5](link-to-pr-5), [#15](link-to-pr-15), [#16](link-to-pr-16)
- note about change in Issue 5
- #4 _Issue title 4 - assigned|one PR_ implemented by @johnDoe in [#4](link-to-pr-4)
- note about change in Issue 4
- #2 _Issue title 2_ implemented by @johnDoe in [#2](link-to-pr-2)
- note about change in Issue 2


### Bugfixes 🛠
- #1 _Issue title 1_ implemented by @janeDoe in [#1](link-to-pr-1)
- note about change in Issue 1


### Closed Issues without Pull Request ⚠️
- #6 _Issue title 6 - not assigned|no PR_ implemented by "Missing Assignee or Contributor"
- note about change in Issue 6


### Closed Issues without User Defined Labels ⚠️
- #9 _Issue title 9 - no user defined label_ implemented by @janeDoe in [#9](link-to-pr-9)
- note about change in Issue 9
- #3 _Issue title 3 - no release note comment|typo label_ implemented by @janeDoe in [#3](link-to-pr-3)


### Closed Issues without Release Notes ⚠️
- #3 _Issue title 3 - no release note comment|typo label_ implemented by @janeDoe in [#3](link-to-pr-3)


### Merged PRs without Linked Issue ⚠️
#1001 _Pull Request 1_
#1004 _Pull Request 4 - no linked issue - merged_


### Merged PRs Linked to Open Issue ⚠️
#1003 _Pull Request 3 - linked to open issue_


### Closed PRs without Linked Issue ⚠️
#1002 _Pull Request 2 - no linked issue - closed_


#### Full Changelog
https://github.com/owner/repo/compare/v0.1.0...v0.1.1
44 changes: 44 additions & 0 deletions __tests__/data/rls_notes_fully_populated_no_custom_chapters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
### Closed Issues without Pull Request ⚠️
- #6 _Issue title 6 - not assigned|no PR_ implemented by "Missing Assignee or Contributor"
- note about change in Issue 6


### Closed Issues without User Defined Labels ⚠️
- #9 _Issue title 9 - no user defined label_ implemented by @janeDoe in [#9](link-to-pr-9)
- note about change in Issue 9
- #8 _Issue title 8 - with co-author|private mail_ implemented by @johnDoe, Jane Doe in [#8](link-to-pr-8)
- note about change in Issue 8
- #7 _Issue title 7 - with co-author|public mail_ implemented by @janeDoe, @johnDoe in [#7](link-to-pr-7)
- note about change in Issue 7
- #6 _Issue title 6 - not assigned|no PR_ implemented by "Missing Assignee or Contributor"
- note about change in Issue 6
- #5 _Issue title 5 - not assigned|three PRs_ implemented by "Missing Assignee or Contributor" in [#5](link-to-pr-5), [#15](link-to-pr-15), [#16](link-to-pr-16)
- note about change in Issue 5
- #4 _Issue title 4 - assigned|one PR_ implemented by @johnDoe in [#4](link-to-pr-4)
- note about change in Issue 4
- #3 _Issue title 3 - no release note comment|typo label_ implemented by @janeDoe in [#3](link-to-pr-3)
- #2 _Issue title 2_ implemented by @johnDoe in [#2](link-to-pr-2)
- note about change in Issue 2
- #1 _Issue title 1_ implemented by @janeDoe in [#1](link-to-pr-1)
- note about change in Issue 1


### Closed Issues without Release Notes ⚠️
- #3 _Issue title 3 - no release note comment|typo label_ implemented by @janeDoe in [#3](link-to-pr-3)


### Merged PRs without Linked Issue ⚠️
#1001 _Pull Request 1_
#1004 _Pull Request 4 - no linked issue - merged_


### Merged PRs Linked to Open Issue ⚠️
#1003 _Pull Request 3 - linked to open issue_


### Closed PRs without Linked Issue ⚠️
#1002 _Pull Request 2 - no linked issue - closed_


#### Full Changelog
https://github.com/owner/repo/compare/v0.1.0...v0.1.1
29 changes: 29 additions & 0 deletions __tests__/data/rls_notes_fully_populated_second_release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### Breaking Changes 💥
No entries detected.

### New Features 🎉
No entries detected.

### Bugfixes 🛠
No entries detected.

### Closed Issues without Pull Request ⚠️
All closed issues linked to a Pull Request.

### Closed Issues without User Defined Labels ⚠️
All closed issues contain at least one of user defined labels.

### Closed Issues without Release Notes ⚠️
All closed issues have release notes.

### Merged PRs without Linked Issue ⚠️
All merged PRs are linked to issues.

### Merged PRs Linked to Open Issue ⚠️
All merged PRs are linked to Closed issues.

### Closed PRs without Linked Issue ⚠️
All closed PRs are linked to issues.

#### Full Changelog
https://github.com/owner/repo-2nd-rls/compare/v0.1.0...v0.1.1
Loading