-
Notifications
You must be signed in to change notification settings - Fork 119
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
ci: Implement workflow for full suite IT (cron + manual) #1353
Conversation
06f2e57
to
797fa84
Compare
Timestamp: 2020-12-14 05:18:44 |
797fa84
to
f575ed7
Compare
Some changes to be implemented:
cc |
|
be678af
to
e073cbb
Compare
Codecov Report
@@ Coverage Diff @@
## master #1353 +/- ##
============================================
- Coverage 77.61% 77.58% -0.03%
Complexity 717 717
============================================
Files 248 248
Lines 4788 4788
Branches 915 915
============================================
- Hits 3716 3715 -1
Misses 572 572
- Partials 500 501 +1 |
bf90c3b
to
c49b850
Compare
8257dcc
to
8a4808a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is blocked shall we move it to draft?
I do not agree with this condition, because later on we will have running it on custom branches and the issue could be closed without resolution |
flank-scripts/src/main/kotlin/flank/scripts/integration/Extensions.kt
Outdated
Show resolved
Hide resolved
flank-scripts/src/main/kotlin/flank/scripts/integration/IssueList.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve comments and update flank-scripts/readme.md
also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Only a few minor formatting style-related suggestions.
I have to perform manual tests.
flank-scripts/src/main/kotlin/flank/scripts/integration/PrepareMessage.kt
Show resolved
Hide resolved
flank-scripts/src/main/kotlin/flank/scripts/integration/CommitList.kt
Outdated
Show resolved
Hide resolved
flank-scripts/src/main/kotlin/flank/scripts/integration/Extensions.kt
Outdated
Show resolved
Hide resolved
flank-scripts/src/main/kotlin/flank/scripts/integration/IssueList.kt
Outdated
Show resolved
Hide resolved
flank-scripts/src/main/kotlin/flank/scripts/integration/Extensions.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested step by step, everything works fine
MacBook-Pro-jan-gogo:flank-jan-gogo jan-gogo$ java -jar ./flank-scripts/build/libs/flank-scripts.jar integration processResults --result success --url https://any.url --github-token $(echo $GITHUB_TOKEN) --run-id 123456
** Parameters:
result: SUCCESS
url: https://any.url
runID: 123456
** No workflow run found for full_suite_integration_tests.yml
** No opened issue
MacBook-Pro-jan-gogo:flank-jan-gogo jan-gogo$ java -jar ./flank-scripts/build/libs/flank-scripts.jar integration processResults --result failure --url https://any.url --github-token $(echo $GITHUB_TOKEN) --run-id 123456
** Parameters:
result: FAILURE
url: https://any.url
runID: 123456
** No workflow run found for full_suite_integration_tests.yml
** No opened issue
** Creating new issue
{
"title": "Full Suite integration tests failed on master",
"body": "### Integration Test failed on master",
"labels": [
"IT_Failed",
"bug"
]
}
Error while doing GitHub request, because of Issues are disabled for this repo, more info at https://docs.github.com/v3/issues/
MacBook-Pro-jan-gogo:flank-jan-gogo jan-gogo$ java -jar ./flank-scripts/build/libs/flank-scripts.jar integration processResults --result failure --url https://any.url --github-token $(echo $GITHUB_TOKEN) --run-id 123456
** Parameters:
result: FAILURE
url: https://any.url
runID: 123456
** No workflow run found for full_suite_integration_tests.yml
** No opened issue
** Creating new issue
{
"title": "Full Suite integration tests failed on master",
"body": "### Integration Test failed on master",
"labels": [
"IT_Failed",
"bug"
]
}
** Issue created:
url: https://github.com/jan-gogo/flank/issues/3
number: 3
** Comment posted
{
"body": "### Full suite IT run :x: FAILED :x:\n**Timestamp:** 2020-12-11 14:04:23\n**Job run:** [123456](https://github.com/Flank/flank/actions/runs/123456\n**Build scan URL:** https://any.url\nNo new commits\n"
}
MacBook-Pro-jan-gogo:flank-jan-gogo jan-gogo$ java -jar ./flank-scripts/build/libs/flank-scripts.jar integration processResults --result success --url https://any.url --github-token $(echo $GITHUB_TOKEN) --run-id 123456
** Parameters:
result: SUCCESS
url: https://any.url
runID: 123456
** No workflow run found for full_suite_integration_tests.yml
** Issue found: https://github.com/jan-gogo/flank/issues/3
** Comment posted
{
"body": "### Full suite IT run :white_check_mark: SUCCEEDED :white_check_mark:\n**Timestamp:** 2020-12-11 14:04:48\n**Job run:** [123456](https://github.com/Flank/flank/actions/runs/123456\n**Build scan URL:** https://any.url\n**Closing issue**"
}
** Closing issue
MacBook-Pro-jan-gogo:flank-jan-gogo jan-gogo$ java -jar ./flank-scripts/build/libs/flank-scripts.jar integration processResults --result success --url https://any.url --github-token $(echo $GITHUB_TOKEN) --run-id 123456
** Parameters:
result: SUCCESS
url: https://any.url
runID: 123456
** No workflow run found for full_suite_integration_tests.yml
** No opened issue
MacBook-Pro-jan-gogo:flank-jan-gogo jan-gogo$
@Mergifyio rebase |
Command
|
73130da
to
a256556
Compare
Fixes #1351
What it actually does?
Basically, the workflow runs integration tests (IT) and reacts to results. If there are tests failed an issue is created with the
IT_Failed
label.and a comment is added with build scan URL + list of commits from the last run (and associated PRs)
If an issue with the
IT_Failed
label is already created only comment is added to the existing ticket. Once the IT run is succeeded issue is closed automatically.Workflow is implemented to listen to 2 triggers:
Workflow is divided into 3 main sections
More detailed workflow step-by-step
Run IT
integrationTests
taskProcess results
cancelled
andin_progress
(sets outputlast-run-date
)success
and no issue opened -- do nothingsuccess
and there is an issue opened -- add a comment and close the issuefailure
and there is no issue opened -- create an issue and add commentfailure
and there is issue opened -- add commentTest Plan
Note:
flank-scrips
hasFlank/flank
repo hardcoded (and some other variables). I will implement a feature to make life easier while testing scripts in the near future...For now, before the build, please replace:
flank/flank-scripts/src/main/kotlin/flank/scripts/github/GithubApi.kt
Line 35 in 9d1ba8d
flank/flank-scripts/src/main/kotlin/flank/scripts/integration/IssueList.kt
Line 10 in 8214ad6
github-actions[bot]
with your repo's username(PAT with full access needed)
./gradlew build
java -jar ./flank-scripts/build/libs/flank-scripts.jar integration processResults --result success --url https://any.url --github-token $(echo $GITHUB_TOKEN) --run-id 123456
java -jar ./flank-scripts/build/libs/flank-scripts.jar integration processResults --result failure --url https://any.url --github-token $(echo $GITHUB_TOKEN) --run-id 123456
java -jar ./flank-scripts/build/libs/flank-scripts.jar integration processResults --result success --url https://any.url --github-token $(echo $GITHUB_TOKEN) --run-id 123456
java -jar ./flank-scripts/build/libs/flank-scripts.jar integration processResults --result success --url https://any.url --github-token $(echo $GITHUB_TOKEN) --run-id 123456
Example
Example issue pawelpasterz#25
Contains all steps (create, add a comment, and close)
Checklist
Add comment
jobCreate issue
jobClose issue
jobflank-scripts