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

Added test statistics #7164

Merged
merged 15 commits into from
Jul 31, 2024

Conversation

martonmiklos
Copy link
Contributor

Fixed #5995

This PR adds test statistics views to the part and build pages which provides overview about the accumulated count of the passed/failed tests.

Copy link

netlify bot commented May 5, 2024

Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit 375ad66
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/66a9d0ad3daad60008d3872c
😎 Deploy Preview https://deploy-preview-7164--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 86 (no change from production)
Best Practices: 92 (no change from production)
SEO: 70 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented May 5, 2024

Codecov Report

Attention: Patch coverage is 28.09917% with 87 lines in your changes missing coverage. Please review.

Project coverage is 83.46%. Comparing base (fdd9b7c) to head (375ad66).
Report is 319 commits behind head on master.

Files with missing lines Patch % Lines
src/backend/InvenTree/stock/models.py 11.62% 38 Missing ⚠️
.../frontend/src/tables/stock/TestStatisticsTable.tsx 5.55% 34 Missing ⚠️
src/backend/InvenTree/stock/api.py 61.53% 10 Missing ⚠️
src/backend/InvenTree/stock/serializers.py 54.54% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7164      +/-   ##
==========================================
- Coverage   83.51%   83.46%   -0.05%     
==========================================
  Files        1114     1119       +5     
  Lines       49376    49741     +365     
  Branches     1568     1629      +61     
==========================================
+ Hits        41234    41517     +283     
- Misses       7746     7797      +51     
- Partials      396      427      +31     
Flag Coverage Δ
backend 85.24% <35.36%> (-0.10%) ⬇️
pui 64.36% <12.82%> (+1.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SchrodingersGat
Copy link
Member

@martonmiklos can you please merge in the latest changes from master, and then I can review :)

@martonmiklos
Copy link
Contributor Author

martonmiklos commented May 8, 2024

@martonmiklos can you please merge in the latest changes from master, and then I can review :)

@SchrodingersGat Done. There are two things what might need to be looked into:

  • As far as I saw filtering for datetime fields is not implemented in the PUI yet, so the date filtering is only available in the old UI.

  • I have not managed to hide the pagination (it does not makes any sense as we will always have 3 rows).
    I saw the enablePagination property, but it does not hide the pagination bar.
    Maybe I will report it to upstream if there is no trick to do that.

@SchrodingersGat
Copy link
Member

@martonmiklos where are you at with this one? :)

@martonmiklos martonmiklos force-pushed the add_test_statistics branch 2 times, most recently from 523f30b to 2988e1a Compare May 24, 2024 18:08
@martonmiklos
Copy link
Contributor Author

martonmiklos commented May 24, 2024

@martonmiklos where are you at with this one? :)

@SchrodingersGat could you please help how to properly specify links with two parameters here:
https://github.com/martonmiklos/InvenTree/blob/a7cafc792e46c0e09441431126b4d3200328c983/src/backend/InvenTree/build/templates/build/build_base.html#L304
It works, but tests are failing, and I have not found any examples in the existing code.

@SchrodingersGat
Copy link
Member

I would suggest that you make a "generic" test statistics endpoint, and rather than pinning it against specific database instances, pass those as query parameters you can filter by.

Then you can have a single API endpoint and you can filter by:

  • Stock Item
  • Part
  • Build Order
  • etc

@matmair
Copy link
Member

matmair commented Jul 3, 2024

Hi there @martonmiklos!

  1. Is this done / ready for final review?
  2. Please stop force pushing/rebasing, this makes reviewing useless

@martonmiklos
Copy link
Contributor Author

Hi there @martonmiklos!

1. Is this done / ready for final review?

2. Please stop force pushing/rebasing, this makes reviewing useless

Hi @matmair
I tried to get the CI passing, but now I have no idea why (or is it related to my changes) the SQlite failed.

@SchrodingersGat
Copy link
Member

@martonmiklos the sqlite test is currently broken for python 3.12, we are still struggling to understand this one. Are you happy with the PR otherwise?

@SchrodingersGat
Copy link
Member

Please fix the conflicts here and if you're satisfied with this I'm happy to merge it in

@SchrodingersGat
Copy link
Member

@martonmiklos apologies but it looks like there are still some conflicts. If you can address this in the next couple of days, I'll hold off merging anything else so that we can get this one done :)

@martonmiklos
Copy link
Contributor Author

@martonmiklos apologies but it looks like there are still some conflicts. If you can address this in the next couple of days, I'll hold off merging anything else so that we can get this one done :)

Done!

@SchrodingersGat
Copy link
Member

@martonmiklos a number of the frontend tests (playwright) are failing here - are they OK locally for you?

@martonmiklos
Copy link
Contributor Author

@martonmiklos a number of the frontend tests (playwright) are failing here - are they OK locally for you?

I managed to get the PUI locally and discovered (together with an another issue in the old UI) that I messed up the API urls for PUI. Now it works locally.

@SchrodingersGat
Copy link
Member

Ok, something is going on with the PUI tests, other PRs are failing too, when they should not be. I will have to look into this tomorrow

@SchrodingersGat
Copy link
Member

@martonmiklos thanks for the hard work here :) I Have fixed the other PUI tests so this is good to go now. Thanks for the ongoing contributions!

@SchrodingersGat SchrodingersGat merged commit 3cbfcc1 into inventree:master Jul 31, 2024
26 checks passed
@SchrodingersGat SchrodingersGat added enhancement This is an suggested enhancement or new feature user interface User interface api Relates to the API feature Platform UI Related to the React based User Interface labels Jul 31, 2024
@SchrodingersGat
Copy link
Member

@martonmiklos when testing this on the "build order" page (for a part with only a small number of tests / results), there are a large number of queries running:

image

image

I'll open a new issue to address this, I would appreciate it if you could look into optimizing the API / database queries.

matmair added a commit to matmair/InvenTree that referenced this pull request Jul 31, 2024
* fix style issue (inventree#7768)

* Pin OAS action (inventree#7767)

* [PUI] Bug fix for API forms (inventree#7758)

* [PUI] Bug fix for API forms

- Ensure that "blank" data does not get overriden with previous fields
- Better logic for form data fetching

* Playwright test fixes

* Add extra fields to BOM export (inventree#7775)

* Add extra fields to BOM export

* Bump API version

* Fix permissions for importing data (inventree#7776)

* Added test statistics (inventree#7164)

* Added test statistics

Fixed inventree#5995

* Bump API version

* Fix javascript varible scopes

* Fix javascript exports

* Remove duplicated import

* Add files modified by the pre-commit scripts

* Move test statistics API urls to a separate endpoint

* Merge test-statistics urls

* Undo unrelated changes

* Formatting fix

* Fix API urls for test statistics in PUI

* Fix prefixing in test statistic functions

---------

Co-authored-by: Oliver <[email protected]>

* Add more names

* split build and publish

* add attestation and SBOM

* format file

* Add toplevel permissions

---------

Co-authored-by: Oliver <[email protected]>
Co-authored-by: Miklós Márton <[email protected]>
matmair added a commit to matmair/InvenTree that referenced this pull request Sep 1, 2024
matmair added a commit to matmair/InvenTree that referenced this pull request Sep 2, 2024
SchrodingersGat pushed a commit that referenced this pull request Sep 30, 2024
* add more admin testing

* fix assertations

* add test for importer admin

* Add tests for #7164

* add common/attachment test

* fix test

* add tests

* remove unused definition - the view is read only

* Revert "remove unused definition - the view is read only"

This reverts commit 4cad8d1.

* more tests in report

* Update tests.py

* make lookup dynamic

* make report assertation dynamic

* add migration test

* extend validation plugin tests

* disable flaky test

* Add test for barcode/uid transition

* test reverse migration

* cleanup new test

* remove empty action

* split and refactor API tests

* refactor test

* Add test for error conditions

* fix double entry

* more migration tests

* also test no history

* fix assertation

* add another migration test

* fix typo

* fix manufacturer filter

* test more filters

* even more filter tests

* move top level test to right place

* add todos for tests that could be more expressive

* add test for checking duplicate serials

* ignore cautious catches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Relates to the API enhancement This is an suggested enhancement or new feature feature Platform UI Related to the React based User Interface user interface User interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Test statistics
3 participants