You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "vishesh92 (via GitHub)" <gi...@apache.org> on 2023/09/25 09:23:13 UTC
[GitHub] [cloudstack] vishesh92 opened a new pull request, #7997: Fixup CheckedReservationTest
vishesh92 opened a new pull request, #7997:
URL: https://github.com/apache/cloudstack/pull/7997
### Description
This PR...
<!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
<!-- For new features, provide link to FS, dev ML discussion etc. -->
<!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
<!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
<!-- Fixes: # -->
<!--- ********************************************************************************* -->
<!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
<!--- ********************************************************************************* -->
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to -->
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] codecov[bot] commented on pull request #7997: Fixup CheckedReservationTest
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #7997:
URL: https://github.com/apache/cloudstack/pull/7997#issuecomment-1733312814
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/7997?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#7997](https://app.codecov.io/gh/apache/cloudstack/pull/7997?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (ccd3739) into [main](https://app.codecov.io/gh/apache/cloudstack/commit/f539c4b81ad7f132dc27e6713d345eedb2fdd7f0?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (f539c4b) will **decrease** coverage by `23.96%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## main #7997 +/- ##
============================================
- Coverage 28.82% 4.87% -23.96%
============================================
Files 5100 342 -4758
Lines 358326 25650 -332676
Branches 52308 4414 -47894
============================================
- Hits 103288 1250 -102038
+ Misses 240788 24267 -216521
+ Partials 14250 133 -14117
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/7997/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [simulator-marvin-tests](https://app.codecov.io/gh/apache/cloudstack/pull/7997/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/7997/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.87% <ø> (ø)` | |
| [unit-tests](https://app.codecov.io/gh/apache/cloudstack/pull/7997/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
[see 4758 files with indirect coverage changes](https://app.codecov.io/gh/apache/cloudstack/pull/7997/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] harikrishna-patnala commented on pull request #7997: Fixup CheckedReservationTest
Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala commented on PR #7997:
URL: https://github.com/apache/cloudstack/pull/7997#issuecomment-1733319456
@vishesh92 not sure how this is calculating but report looks wrong to me

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] vishesh92 commented on pull request #7997: Fixup CheckedReservationTest
Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on PR #7997:
URL: https://github.com/apache/cloudstack/pull/7997#issuecomment-1733325646
@harikrishna-patnala all the coverage tests haven't completed that is why it's wrong. Check the flags for specific details.

> @vishesh92 not sure how this is calculating but report looks wrong to me
>
> 
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] rohityadavcloud merged pull request #7997: Fixup CheckedReservationTest
Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud merged PR #7997:
URL: https://github.com/apache/cloudstack/pull/7997
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] vishesh92 commented on a diff in pull request #7997: Fixup CheckedReservationTest
Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on code in PR #7997:
URL: https://github.com/apache/cloudstack/pull/7997#discussion_r1335628515
##########
server/src/test/java/com/cloud/resourcelimit/CheckedReservationTest.java:
##########
@@ -70,14 +72,16 @@ public void tearDown() throws Exception {
@Test
public void getId() {
when(account.getDomainId()).thenReturn(4l);
- boolean fail = false;
- try (CheckedReservation cr = new CheckedReservation(account, Resource.ResourceType.user_vm,1l, reservationDao, resourceLimitService); ) {
+ // Some weird behaviour depending on whether the database is up or not.
+ lenient().when(reservationDao.persist(Mockito.any())).thenReturn(reservation);
Review Comment:
Added lenient because if the database is up, this show up as unused stubs.
##########
server/src/test/java/com/cloud/resourcelimit/CheckedReservationTest.java:
##########
@@ -70,14 +72,16 @@ public void tearDown() throws Exception {
@Test
public void getId() {
when(account.getDomainId()).thenReturn(4l);
- boolean fail = false;
- try (CheckedReservation cr = new CheckedReservation(account, Resource.ResourceType.user_vm,1l, reservationDao, resourceLimitService); ) {
+ // Some weird behaviour depending on whether the database is up or not.
+ lenient().when(reservationDao.persist(Mockito.any())).thenReturn(reservation);
Review Comment:
Added lenient because if the database is not up, this show up as unused stubs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] harikrishna-patnala commented on pull request #7997: Fixup CheckedReservationTest
Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala commented on PR #7997:
URL: https://github.com/apache/cloudstack/pull/7997#issuecomment-1733354283
> @harikrishna-patnala all the coverage tests haven't completed that is why it's wrong. Check the flags for specific details.
>
> 
>
> > @vishesh92 not sure how this is calculating but report looks wrong to me
> > 
got it, thanks @vishesh92
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org