Ticket #10304 (closed: fixed)
Don't load workspaces from disk when unit testing new Refl UI
Reported by: | Harry Jeffery | Owned by: | Harry Jeffery |
---|---|---|---|
Priority: | major | Milestone: | Release 3.3 |
Component: | Reflectometry | Keywords: | |
Cc: | Blocked By: | #10364 | |
Blocking: | Tester: | Owen Arnold |
Description
Currently the new Refl UI unit tests hit the disk to load the following workspaces:
- INTER00013460
- INTER00013462
- INTER00013463
- INTER00013464
This is a bad thing. Instead we should be testing with simple in-memory workspaces using a simple instrument. Doing so will greatly speed up the tests.
To create the workspaces we should be using create2DWorkspaceWithReflectometryInstrument, as seen here: https://github.com/mantidproject/mantid/blob/master/Code/Mantid/Framework/Algorithms/test/ReflectometryReductionOneTest.h#L39
Once this is working, the tests should be refactored to be more cohesive and granular.
Change History
comment:2 Changed 6 years ago by Harry Jeffery
- Blocked By 10364 added
Blocked by #10364, which is merging the two sets of unit tests.
comment:4 Changed 6 years ago by Harry Jeffery
Refs #10304 Remove autofill test
It won't play nicely with the coming changes. Autofill will probably need to be moved to its own action for better testing in future.
Changeset: 185b87e2c4e377b57208a74318d60ba1914ab609
comment:5 Changed 6 years ago by Harry Jeffery
Refs #10304 Add createTOFWorkspace helper
This new helper function can created fake workspaces to use for processing in the tests, instead of loading runs like INTER1346{0,2,3,4} from disk.
Changeset: dec7573834dd9336424175f0249089be05967757
comment:6 Changed 6 years ago by Harry Jeffery
Refs #10304 Use fake TOF workspaces in tests
Changeset: e121c225afbc02f2bf2f97ae835334377bd1f428
comment:7 Changed 6 years ago by Harry Jeffery
Refs #10304 Clean up ReflMainViewPresenterTest
- Rename fake workspaces to fake run numbers
- Get rid of superfluous assertions
Changeset: 57e3cdd9013fd69b5cee4c1336b92bee44d2e26c
comment:8 Changed 6 years ago by Harry Jeffery
Refs #10304 Simplify ReflMainView mock
There are some methods we just don't care about, so let's not bother setting expectations and just provide stub implementations.
Changeset: 097c8775dda893c87021efd0d9721ae6d127d061
comment:9 Changed 6 years ago by Harry Jeffery
Refs #10304 Tidy Save/SaveAs tests
Changeset: 108b03912f24a9cf08a88c7dc5fd6b860119e155
comment:10 Changed 6 years ago by Harry Jeffery
Refs #10304 Fix build and tidy ReflView mock
Changeset: 7a071b26d76b38a466901c56ced4b50cafb38262
comment:11 Changed 6 years ago by Harry Jeffery
Refs #10304 Fix Win7 build
Changeset: 97ea594df1d6f40611b9cec29ff3eec9716e5957
comment:12 Changed 6 years ago by Harry Jeffery
- Status changed from inprogress to verify
- Resolution set to fixed
Testing
- Verify the unit tests pass
- Verify that the unit tests are running faster than before (see develop_incremental #2370 or older)
- Inspect changes
Branch: https://github.com/mantidproject/mantid/compare/feature/10304_improve_refl_ui_tests
Note If #10440 has been merged/closed and master has not been merged back into this ticket, then this ticket will break the build.
comment:13 Changed 6 years ago by Owen Arnold
- Status changed from verify to verifying
- Tester set to Owen Arnold
comment:14 Changed 6 years ago by Owen Arnold
- Status changed from verifying to closed
Merge remote-tracking branch 'origin/feature/10304_improve_refl_ui_tests'
Full changeset: a74fde9af3efc6a89bfa8e036f6c37568551fa06
comment:15 Changed 6 years ago by Owen Arnold
Code looks fine. Good that you've been able to delete so much of it infact. I'm seeing an order of magnitude speed up. Well done.
comment:16 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 11146