Enforce Quality Gates for Java and Python sub projects on CI#1543
Enforce Quality Gates for Java and Python sub projects on CI#1543ndegwamartin wants to merge 15 commits intogoogle:masterfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1543 +/- ##
============================================
+ Coverage 46.61% 46.75% +0.13%
- Complexity 678 683 +5
============================================
Files 90 90
Lines 5886 5893 +7
Branches 834 834
============================================
+ Hits 2744 2755 +11
+ Misses 2827 2822 -5
- Partials 315 316 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bashir2
left a comment
There was a problem hiding this comment.
Thanks @ndegwamartin for the changes; just a few minor suggestions/questions.
bunsen/bunsen-avro/src/main/java/com/cerner/bunsen/avro/converters/DefinitionToAvroVisitor.java
Show resolved
Hide resolved
bunsen/bunsen-avro/src/test/java/com/cerner/bunsen/avro/R4AvroConverterUsCoreTest.java
Show resolved
Hide resolved
pipelines/batch/src/main/java/com/google/fhir/analytics/HapiRowDescriptor.java
Show resolved
Hide resolved
pipelines/controller/src/main/java/com/google/fhir/analytics/PipelineManager.java
Outdated
Show resolved
Hide resolved
bashir2
left a comment
There was a problem hiding this comment.
Thanks @ndegwamartin please feel free to merge after addressing the remaining comments below.
bunsen/bunsen-avro/src/main/java/com/cerner/bunsen/avro/converters/DefinitionToAvroVisitor.java
Show resolved
Hide resolved
pipelines/controller/src/main/java/com/google/fhir/analytics/PipelineManager.java
Outdated
Show resolved
Hide resolved
- Reverts lazy logging for main.py - Disables lazy logging check in pylint configuration - Refactors get current time to use static helper method - Adds unit tests for PipelineManager class
716b7e9 to
5991c60
Compare
-Fix pylint warning
pipelines/controller/src/main/java/com/google/fhir/analytics/DwhFilesManager.java
Outdated
Show resolved
Hide resolved
pipelines/controller/src/test/java/com/google/fhir/analytics/PipelineManagerTest.java
Outdated
Show resolved
Hide resolved
|
/gcbrun |
bashir2
left a comment
There was a problem hiding this comment.
Just some minor unit-test/architecture related suggestion.
| MeterRegistry meterRegistry = mock(MeterRegistry.class); | ||
| pipelineManager = new PipelineManager(); | ||
| setField("dataProperties", dataProperties); | ||
| setField("dwhFilesManager", dwhFilesManager); |
There was a problem hiding this comment.
I am guessing that you are forced to use reflection for these fields because we use @Autowired on fields, correct? So I think a better solution is to avoid that pattern and instead use constructor injection instead, i.e., we will have a constructor on which we have an @Autowired annotation. Then we can use the constructor directly here with mock objects. If you do that pattern then great, if you feel that is too much work, please add a TODO to switch to that pattern at some point.
| public void testIncrementalModeTriggeredAtRightTime() throws Exception { | ||
| // Mock current time to be after next scheduled time | ||
| LocalDateTime currentTime = lastRunEndTimestamp.plusMinutes(2); // 2 minutes after lastRunEnd | ||
| try (MockedStatic<DwhFilesManager> mockedDwh = mockStatic(DwhFilesManager.class)) { |
There was a problem hiding this comment.
If we inject DwhFilesManager as well then we can change getCurrentTime to be non-static making it easier to mock, but again this is just a suggestion.
Description of what I changed
Resolves #1541
E2E test
TESTED:
Please replace this with a description of how you tested your PR beyond the
automated e2e/unit tests.
Checklist: I completed these to help reviewers :)
I have read and will follow the
review process.
I am familiar with Google Style Guides for the language I have coded in.
No? Please take some time and review
Java and
Python style guides.
My IDE is configured to follow the Google
code styles.
No? Unsure? ->
configure your IDE.
I have added tests to cover my changes. (If you refactored existing
code that was well tested you do not have to add tests)
I ran
mvn clean packageright before creating this pull request andadded all formatting changes to my commit.
If I made any Python code changes, I ran
black .,pylint .andpyright. right before creating this pull request and added allformatting changes to my commit.
All new and existing tests passed.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master