521 Commits

Author SHA1 Message Date
Lipu Fei
d346dd4090 Fix TestDefinitionContainer 2019-11-06 15:43:43 +01:00
Ghostkeeper
c7c6389897
Report on all faulty keys at once instead of crashing on first
This makes it a lot easier to communicate back to users what is going wrong.
2019-11-04 11:50:57 +01:00
Ghostkeeper
1f4c863683
Also assert that the extruder_nr setting matches 2019-11-01 15:08:09 +01:00
Ghostkeeper
069dc6e65d
Add test to see if definition's extruder number matches up
...with its machine definition's metadata.
2019-11-01 14:52:41 +01:00
Ghostkeeper
6e6c510dcd
Test extruders for correctness but not for validity
The validity can't be tested using the built-in validator since that one checks if there are no settings that 'override' non-existing settings. And some of the settings overridden in an extruder are not in the inheritance stack since fdmextruder doesn't inherit from fdmprinter.

We'll check though that all settings that are overridden don't override a default_value while there is a value, and whether they don't have IDs.
2019-11-01 14:34:07 +01:00
Ghostkeeper
174b326f57
Also test validity and correctness of extruder definitions
This makes a few things slightly simpler as well since it now parameterises the tests with the entire path of the definition file so we don't have to reconstruct that in every test.
2019-11-01 14:18:35 +01:00
Ghostkeeper
852da51f65
Fix tests for exact matching on preferred material
I don't know why the CI system was only complaining about it several commits later. Could be troublesome.

Fixes a bug introduced by 1284d9fe8d726e46b556caa8f2f390dc7d65220c.
2019-11-01 13:56:29 +01:00
Nino van Hooff
e5c9bca3d0 Fix TestBuildVolume
CURA-6522
2019-11-01 09:57:51 +01:00
ninovanhooff
b9b086a8c0
Merge pull request #6542 from Ultimaker/CURA-6793_performance
Performance improvements
2019-10-23 16:50:04 +02:00
ninovanhooff
9beea85482
Merge pull request #6566 from Ultimaker/CURA-6858_increase_sdk_ver_7_0
Change SDK version to 7.0.0
2019-10-23 11:54:49 +02:00
Ghostkeeper
94eb76a844
Merge branch 'master' into CURA-6793_performance
Conflicts:
	cura/Machines/MaterialManager.py -> File was deleted in Master but I changed things for the lazy loading.
	cura/Machines/Models/BaseMaterialsModel.py -> I clarified documentation on a line above a place where a timer was added in between.

Contributes to issue CURA-6793.
2019-10-23 09:58:08 +02:00
Lipu Fei
f2c66f8d3a Fix TestVariantNode
CURA-6921
2019-10-22 15:31:17 +02:00
Lipu Fei
38ee4bf208 Remove deprecated functions in MachineManager
CURA-6858
2019-10-22 14:11:40 +02:00
Ghostkeeper
985aac9e60
Assert that there is no ID metadata entry in definition containers 2019-10-22 11:01:16 +02:00
Ghostkeeper
51c3acc654
Document helper functions 2019-10-22 09:56:50 +02:00
Ghostkeeper
15ea29924a
Sort definition files before testing them
When going through the list of tests for many printers to fix them, it's then easier to go through the failed list. They will appear in the same order as in my IDE. Just a bit of an ease of life thing without any real cost.

Done during Turbo Testing & Tooling.
2019-10-18 17:02:40 +02:00
Ghostkeeper
1d7ad38db2
Also name which setting has the dysfunctional override
So that it's easier to remove it.

Done during Turbo Testing & Tooling.
2019-10-18 17:00:47 +02:00
Ghostkeeper
76b5f9d37b
Fix testing if JSON elements are mappings
Turns out that the JSON objects extend from dict, so this works.
Also turns out that strings have a __getitem__. Who knew?

Done during Turbo Testing & Tooling.
2019-10-18 16:57:57 +02:00
Ghostkeeper
9316df72b3
Add test for overriding default_value while there is a value
This should not be done anywhere since the default_value won't have any effect then. We disregard CuraEngine's command line method here but that's infeasible with those profiles anyway.

Done during Turbo Testing & Tooling.
2019-10-18 16:45:15 +02:00
Ghostkeeper
c12817170c
Merge branch 'master' into CURA-6793_performance 2019-10-16 15:47:41 +02:00
Ghostkeeper
8179dfc412
Make cache of machines a protected field
We don't want to use it outside of the mapping. This mapping should be transparent.
We are still using it from our tests though but that's fine. Tests are allowed to touch private fields.

Contributes to issue CURA-6793.
2019-10-16 15:04:07 +02:00
Ghostkeeper
5624f0a8ae
Fix tests with new lazy-loading technique
The new lazy loading requests different functions from the registry so we need to mock that out.
Also fix the manual insertion of things into the lazy-loaded mapping.

Contributes to issue CURA-6793.
2019-10-16 14:59:46 +02:00
Ghostkeeper
9b836d95d9
Remove quality, variant and material manager
We don't use them any more and they are deprecated.

Removing them removes a lot of maintenance.

Contributes to issue CURA-6801.
2019-10-16 13:00:38 +02:00
Lipu Fei
84080b675b Fix tests 2019-10-15 08:29:53 +02:00
Ghostkeeper
b5c6a0a1e3
Merge branch 'master' into CURA-6793_performance 2019-10-14 17:17:10 +02:00
Ghostkeeper
22d874d932
Code style
Found during work on CURA-6973.
2019-10-10 16:02:47 +02:00
Lipu Fei
fb368a4788 Remove MachineManager.activeVariantNames
CURA-6865
2019-10-08 15:16:27 +02:00
Lipu Fei
c42feae11c Make intents work on quality management page
CURA-6706
2019-10-07 09:22:47 +02:00
Ghostkeeper
862504f603
Add test for preferring a material diameter over the preferred from metadata
Done during Turbo Testing and Tooling.
2019-10-04 17:32:42 +02:00
Ghostkeeper
9b6443c2d3
Add test for preferred material diameter mismatch
Done during Turbo Testing and Tooling.
2019-10-04 17:28:27 +02:00
Ghostkeeper
93e397a0cc
Move creation of empty variant nodes to fixture
Done during Turbo Testing and Tooling.
2019-10-04 17:23:14 +02:00
Ghostkeeper
30e268e975
Add test for preferred material's diameter check
Done during Turbo Testing and Tooling.
2019-10-04 17:16:59 +02:00
Ghostkeeper
54fcb38fe6
Add test for preferred material matching on submaterials
Done during Turbo Testing and Tooling.
2019-10-04 17:11:32 +02:00
Ghostkeeper
a117e937b9
Add test for preferred material with the happy flow
The exact preferred material is available. Pick that.
2019-10-04 17:07:45 +02:00
Ghostkeeper
2671f12c21
Add test for is_available on resulting quality groups
Done during Turbo Testing and Tooling.
2019-10-04 15:35:33 +02:00
Ghostkeeper
5ae248341b
Add test for getting quality groups from the container tree
Finally it works.

Done during turbo testing and tooling.
2019-10-04 15:35:33 +02:00
Lipu Fei
e5c59b1308 Fix TestVariantNode 2019-10-04 11:00:01 +02:00
Lipu Fei
7233bdb255 Fix TestMachineNode: remove invalid property has_machine_materials 2019-10-04 10:37:45 +02:00
Ghostkeeper
b245be6970
Remove has_machine_materials metadata
It's not behaving as expected here. For instance, Ultimaker 3 wasn't specifying has_machine_materials and thus only the base materials would get loaded, but clearly the Ultimaker 3 has materials specialised for it.
Whether or not a printer has materials specialised for it is now determined by whether the specialisations exist in the material files. So we don't need the metadata entry any more. It seemed to have not been in use anyway, except by one printer which specified that has_machine_materials is true. I've now made it behave as if it's always true.

Contributes to issue CURA-6831.
2019-10-02 08:55:04 +02:00
Lipu Fei
f867f3485e Fix TestIntentManager 2019-10-01 11:30:54 +02:00
Ghostkeeper
45f3b6eeb2
Simplify quality node intents list test
Not a whole lot of mocking.
I also added a lot of extra instance containers that should NOT match.

Added during testing & tooling.
2019-09-27 16:04:49 +02:00
Ghostkeeper
4e8929a072
Fix structure of mock container tree
Found during testing and tooling.
2019-09-27 15:26:14 +02:00
Ghostkeeper
97eaeab3bd
Fix missing intent in mock and missing quality_type
These are used by the code. Otherwise there would be an AttributeError of 'intent' not existing, and the quality type in the quality node wouldn't match because it's a magic mock.
2019-09-27 15:13:23 +02:00
Lipu Fei
94e89ad4ac Fix merge conflicts with master 2019-09-24 14:26:43 +02:00
Jaime van Kessel
4dc918c647
Fix unit test 2019-09-23 17:09:54 +02:00
Ghostkeeper
557746a832
Partial fix for intent manager not finding correct profile in test
Only in test.
2019-09-23 15:17:15 +02:00
Ghostkeeper
7d40d962e8
Mock ContainerTree instead of ContainerRegistry to test intent manager
Because now it relies on the container tree instead of querying the registry anew every time.
2019-09-23 15:03:24 +02:00
Jaime van Kessel
3a2c5b2473
Fix test for stack builder 2019-09-23 13:26:21 +02:00
Ghostkeeper
61527e082e
Mock ContainerTree instead of ContainerRegistry
The intent models are now using the ContainerTree to build themselves rather than the registry.
2019-09-23 09:59:57 +02:00
Jaime van Kessel
c0db1a17be
Fix the false positive failure in the unit test 2019-09-16 11:40:08 +02:00