-
-
Notifications
You must be signed in to change notification settings - Fork 88
[plugin-lighthouse] Add ablity to assert lighthouse audit scores #4095
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
Conversation
vividus-plugin-lighthouse/src/main/java/org/vividus/lighthouse/LighthouseSteps.java
Outdated
Show resolved
Hide resolved
when(lighthouseResultV5.getCategories()).thenReturn(categories); | ||
LighthouseCategoryV5 category = mock(); | ||
when(categories.getPerformance()).thenReturn(category); | ||
when(category.getScore()).thenReturn(new BigDecimal(99)); |
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.
where is it asserted/verified?
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.
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.
where is a check of number like 99
?
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.
expected metric value is passed to validateMetric method and validated there
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
Codecov Report
@@ Coverage Diff @@
## master #4095 +/- ##
=========================================
Coverage 97.20% 97.20%
- Complexity 6432 6436 +4
=========================================
Files 897 897
Lines 18516 18526 +10
Branches 1216 1217 +1
=========================================
+ Hits 17998 18008 +10
Misses 411 411
Partials 107 107
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
{ | ||
List<ArrayMap<String, BigDecimal>> items = (List<ArrayMap<String, BigDecimal>>) result.getAudits() | ||
.get("metrics").getDetails().get("items"); | ||
ArrayMap<String, BigDecimal> metrics = ArrayMap.create(); |
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.
is ArrayMap
required?
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.
why not? its memory-efficient and used by this API
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.
it's a kind of internals of Liighthouse SDK, it's better to use Java Collections:
- internals are not exposed
- easier maintenance since Java API is changed rarely
Kudos, SonarCloud Quality Gate passed! |
No description provided.