Skip to content
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

Fix unit test warnings #5172

Merged
merged 1 commit into from
Nov 25, 2024
Merged

Fix unit test warnings #5172

merged 1 commit into from
Nov 25, 2024

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Nov 18, 2024

Fixes

Related to #5171 by @obulat

Description

This PR introduces multiple improvements to the unit tests to eliminate warnings and produce cleaner output.

  • Removed the custom render-suspended function we used to override nuxt/test-utils. Since we now consistently use script setup instead of defineComponent, the default render-suspended function works seamlessly.

  • Updated component props. Several components' props have changed, so I updated them in tests.

  • Added ESLint Rule for props with defaults: "vue/no-required-prop-with-default" ESLint rule marks a prop optional if this prop has a default value. This helped fix a couple of warnings and components ( for example,VHomeLink, VLogoloader).

  • Updated issue Link: Corrected the issue link to point to the tracker for unit test fixes following the migration to Nuxt 3.

  • Addressed prop fall-through in complex components:
    When a component is complex, such as a VTag that :is="VButton" that :is="VLink" (3 levels of nestedness), the prop does not always fall through, at least in the unit tests, so I added manual binding of the href to VButton if the component in VButton is a VLink.

Testing Instructions

Run the unit tests using ov just frontend/run test:unit.
You should see much fewer warnings.

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (ov just catalog/generate-docs for catalog
    PRs) or the media properties generator (ov just catalog/generate-docs media-props
    for the catalog or ov just api/generate-docs for the API) where applicable.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@obulat obulat requested a review from a team as a code owner November 18, 2024 12:31
@obulat obulat requested review from krysal and dhruvkb November 18, 2024 12:31
@openverse-bot openverse-bot added 🧱 stack: frontend Related to the Nuxt frontend 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Nov 18, 2024
@obulat obulat added 🟨 priority: medium Not blocking but should be addressed soon 💻 aspect: code Concerns the software code in the repository 🧰 goal: internal improvement Improvement that benefits maintainers, not users and removed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Nov 18, 2024
Copy link

Latest k6 run output1

     ✓ status was 200

     checks.........................: 100.00% ✓ 6400      ✗ 0   
     data_received..................: 1.5 GB  8.2 MB/s
     data_sent......................: 837 kB  4.6 kB/s
     http_req_blocked...............: avg=26.03µs  min=2.1µs    med=4.4µs    max=9.35ms p(90)=5.92µs   p(95)=6.41µs  
     http_req_connecting............: avg=21.23µs  min=0s       med=0s       max=9.28ms p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=636.4ms  min=50.66ms  med=553.54ms max=2.6s   p(90)=1.14s    p(95)=1.26s   
       { expected_response:true }...: avg=636.4ms  min=50.66ms  med=553.54ms max=2.6s   p(90)=1.14s    p(95)=1.26s   
   ✓ http_req_failed................: 0.00%   ✓ 0         ✗ 6400
     http_req_receiving.............: avg=167.75µs min=42.71µs  med=130.04µs max=21.1ms p(90)=204.29µs p(95)=246.66µs
     http_req_sending...............: avg=25.47µs  min=6.82µs   med=20.79µs  max=5.67ms p(90)=26.99µs  p(95)=29.62µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s     p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=636.21ms min=50.27ms  med=553.37ms max=2.6s   p(90)=1.14s    p(95)=1.26s   
     http_reqs......................: 6400    34.944581/s
     iteration_duration.............: avg=3.4s     min=837.93ms med=2.93s    max=9.98s  p(90)=6.62s    p(95)=6.93s   
     iterations.....................: 1200    6.552109/s
     vus............................: 2       min=2       max=30
     vus_max........................: 30      min=30      max=30

Footnotes

  1. This comment will automatically update with new output each time k6 runs for this PR

Copy link
Member

@krysal krysal left a comment

Choose a reason for hiding this comment

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

I confirm I see far fewer warnings. Great!

Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

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

Nice to have fewer warnings.

@obulat obulat merged commit 380eb31 into main Nov 25, 2024
81 of 85 checks passed
@obulat obulat deleted the fix/unit-tests branch November 25, 2024 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants