8000 [plugin-lighthouse] Add ablity to assert lighthouse audit scores by uarlouski · Pull Request #4095 · vividus-framework/vividus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[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

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

uarlouski
Copy link
Member

No description provided.

@uarlouski uarlouski requested a review from a team as a code owner June 27, 2023 09:29
@uarlouski uarlouski requested review from valfirst and ikalinin1 June 27, 2023 09:29
when(lighthouseResultV5.getCategories()).thenReturn(categories);
LighthouseCategoryV5 category = mock();
when(categories.getPerformance()).thenReturn(category);
when(category.getScore()).thenReturn(new BigDecimal(99));
Copy link
Collaborator

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

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?

Copy link
Member Author

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

@github-actions
Copy link
github-actions bot commented Jun 27, 2023

Qodana Community for JVM

It 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
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@codecov
Copy link
codecov bot commented Jun 27, 2023

Codecov Report

Merging #4095 (6493af7) into master (bce863a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@            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           
Impacted Files Coverage Δ
...n/java/org/vividus/lighthouse/LighthouseSteps.java 100.00% <100.00%> (ø)
.../java/org/vividus/lighthouse/model/MetricRule.java 100.00% <100.00%> (ø)

📣 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();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is ArrayMap required?

Copy link
Member Author

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

Copy link
Collaborator

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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@valfirst valfirst merged commit dc90d7b into master Jun 28, 2023
@valfirst valfirst deleted the lh-scores branch June 28, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0