-
Notifications
You must be signed in to change notification settings - Fork 12
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
test(openchallenges): improve organization service service unit test coverage #2507
test(openchallenges): improve organization service service unit test coverage #2507
Conversation
Sonar suggested I remove all public modifiers so I removed them. |
PR is ready for review. 2 Unit tests have been added for OrganizationService. Line 68 of the code has a public modifier which Sonar suggests I remove but that causes a formatting issue. @tschaffter Let me know which error/issue tracker takes priority here. I've prioritized the springBoot built in formatting. |
@tschaffter please review my PR |
...org/sagebionetworks/openchallenges/organization/service/service/OrganizationServiceTest.java
Outdated
Show resolved
Hide resolved
...org/sagebionetworks/openchallenges/organization/service/service/OrganizationServiceTest.java
Outdated
Show resolved
Hide resolved
Is this issue still relevant? It looks like you resolved the formating issue (with You are adding two unit tests to the organization service in this PR but the Sonar app does not report an increase in coverage. Do you know why? Do you see an increase in coverage using JaCoCo? |
@tschaffter Yes I have documented the increase in coverage seen in Jacoco, from 19% to 52%, in the Issue #1528 which is what this PR is addressing. I left the Sonar only information that is auto generated in this PR since I thought it might be overkill to add both. I did resolve the formatting issue after making the comment about it. |
@tschaffter I've made the requested changes to the comment lines character counts. |
Quality Gate passed for 'schematic-api'Issues Measures |
Quality Gate passed for 'openchallenges-app'Issues Measures |
Quality Gate passed for 'openchallenges-challenge-service'Issues Measures |
Quality Gate passed for 'openchallenges-image-service'Issues Measures |
PR marked as draft after noticing that there were new changes upstream that needed to be synced to current repo branch. This triggered a number of test failures related to schematic_api/...
|
Hey @andrewelamb, Maria bumped into the above Schematic test issues after updating her feature branch with |
@tschaffter There was a change to schematic that intorduced soem breaking changes the the API in the monorepo, involving both claled methods and the data model used for testing. These were fixed by this PR.. So if this commit isn't in the branch the schematic API tests will fail. |
@tschaffter Just curious, why are the schematic API tests beign run for this PR? |
That's an excellent question. I will document here my findings here as I explore this issue. TroubleshootingHere are the logs of the CI workflow that run for the last commit pushed by Maria to this PR. One of the first job of the workflow shows the "Base SHA" and "Head SHA" that Base SHA Head SHA
In comparison, here are the SHAs for the first commit pushed to this PR.
Update 2024-02-28It is likely that @mdsage1 first pushed the last commit mentioned above BEFORE she updated the Since then, Maria updated the ConclusionIn the current context, when opening a PR from a fork, the Base Sha should refers to 1) the last commit to the Point 1) is confirmed as we this in this PR that the Base SHA changed when Maria updated the Point 2) is derived from this Nx comment:
|
@tschaffter After further investigation in the current version of main, the schemati api tests are faling as well, this also has to do with the breaking changes made by the most recent version of schematic. This will be fixed by this PR. |
Quality Gate passed for 'openchallenges-organization-service'Issues Measures |
@andrewelamb I can now answer your question (see details). In a nutshell, Nx identifies the affected projects using two SHA: the Head and Base SHAs. The Head SHA refers to the commit ID of the last commit pushed to a feature branch/PR. Determining the Base SHA is a bit more tricky:
I will update the CI workflow so that the Base SHA refers to the |
@tschaffter Can you review this pr please? |
Description
Sonar unit organization service test coverage has been increased to 52%, from 19%, for service package by writing unit tests for a single class, OrganizationService.
Related Issue
#2389
#2063
#1528
#2348
#2388
Fixes #(issue)
Changelog
See
files Changed
sectionPreview