Skip to content

Part Test refactor#9928

Draft
SchrodingersGat wants to merge 14 commits intoinventree:masterfrom
SchrodingersGat:test-refactor
Draft

Part Test refactor#9928
SchrodingersGat wants to merge 14 commits intoinventree:masterfrom
SchrodingersGat:test-refactor

Conversation

@SchrodingersGat
Copy link
Member

@SchrodingersGat SchrodingersGat commented Jul 1, 2025

This PR represents a major overhaul of the testing framework in preparation for the 1.0.0 release.

Prior to this change, the PartTestTemplate model was linked to a specific part. So if the user wanted to assign the "same" test to another part (say in a different category) then the template had to be duplicated.

The major change here is to decouple the PartTestTemplate model from the Part model - templates are now generic and can be reused. We then add the PartTest model which links a template to either a Part or PartCategory instance.

Link to Part

If a template is linked to a given part, then test results can be generated for any stock item of that part (or any variants of that part).

Link to Category

If a template is linked to a given category then test results can be generated for any part which lives under that category.

TODO

  • Schema and data migrations
  • Add migration testing
  • Specific migration testing for consolidating duplicate templates
  • Fix reverse migration issues
  • Add API endpoints for new PartTest model
  • Add data tables for viewing / editing / deleting the PartTest instances against a part
  • Update UI logic for viewing available tests against a given part
  • Update UI logic for viewing available tests against a build order
  • Update UI logic for viewing available tests against a stock item
  • Fix "copy_tests_from" function on a Part instance
  • Fix "copy test_results_from" function on a StockItem instance.
  • Ensure test results are copied when serializing a stock item
  • Fix existing unit tests
  • Add new playwright tests
  • Add new API unit tests
  • Update CHANGELOG.md
  • Update documentation around testing procedures
  • Update demo dataset (data migration)

@SchrodingersGat SchrodingersGat added part Related to Part models stock Related to Stock models api Relates to the API breaking Indicates a major update or change which breaks compatibility migration Data or schema migrations User Interface Related to the frontend / User Interface full-run Always do a full QC CI run labels Jul 1, 2025
@netlify
Copy link

netlify bot commented Jul 1, 2025

Deploy Preview for inventree-web-pui-preview failed.

Name Link
🔨 Latest commit 69142ca
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/699eeb5b3701670008377eba

@SchrodingersGat SchrodingersGat marked this pull request as draft July 1, 2025 14:17
@SchrodingersGat SchrodingersGat added this to the 1.0.0 milestone Jul 1, 2025
@SchrodingersGat SchrodingersGat modified the milestones: 1.0.0, 1.1.0 Jul 23, 2025
@SchrodingersGat
Copy link
Member Author

Bumping to the next release target, a lot to think about here which I don't have time for

@SchrodingersGat SchrodingersGat modified the milestones: 1.1.0, 2.0.0 Oct 20, 2025
@SchrodingersGat SchrodingersGat modified the milestones: 2.0.0, 1.3.0 Feb 12, 2026
Copy link
Member Author

Choose a reason for hiding this comment

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

This file need to be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Relates to the API breaking Indicates a major update or change which breaks compatibility full-run Always do a full QC CI run migration Data or schema migrations part Related to Part models stock Related to Stock models User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant