Ticket #7674 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Illegal dependency in PeaksWorkspaceTest

Reported by: Russell Taylor Owned by: Karl Palmen
Priority: major Milestone: Release 3.0
Component: Framework Keywords: Maintenance
Cc: Blocked By:
Blocking: Tester: Russell Taylor

Description

PeaksWorkspaceTest, in the DataObjects package, implicitly depends on the 'higher' DataHandling package because it uses LoadEmptyInstrument, LoadNexus & SaveNexus. See http://www.mantidproject.org/Mantid_Package_Diagram for the package levels (the arrows are not quite accurate but the package levels are).

The test_Save_Unmodified_PeaksWorkspace_Nexus() method should move to the SaveNexus algorithm's test or should just operate on the PeaksWorkspace::saveNexus() method.

The test_createDetectorTable_With_Many_Peaks_And_Multiple_Dets() method should use an in-memory instrument instead.

Change History

comment:1 Changed 7 years ago by Nick Draper

  • Owner set to Karl Palmen

comment:2 Changed 7 years ago by Karl Palmen

I see it would be a good idea to move createSaveTestPeaksWorkspace() to WorkspaceCreationHelper to make to available to the moved test_Save_Unmodified_PeaksWorkspace_Nexus() and any other test that may use a peaks workspace. It loads its instrument from an IDF file rather than use an in mememory instrument.

comment:3 Changed 7 years ago by Russell Taylor

No, that wouldn't be OK because WorkspaceCreationHelper may not use any package above DataObjects (i.e. no algorithms). I think the 'createDetectorTable' test ought to be able to use one of the existing WorkspaceCreationHelper methods and I've given 2 possible solutions for the other affected test (& I think I prefer the latter: test PeaksWorkspace::saveNexus directly)

comment:4 Changed 7 years ago by Karl Palmen

  • Status changed from new to inprogress

comment:5 Changed 7 years ago by Karl Palmen

Non working first step re #7674

Do not git checkbuild.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 236cda02a12240eb29cf2dd5f54ff0da675d1f18

comment:6 Changed 7 years ago by Karl Palmen

Eliminate call of SaveNexus and LoadNexus algorithms re #7674

Now just tests saved file has 'peak_workspace' entry. Other tests for its contents to follow.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 17e951ace5010d9f55dc0cfb4d8c638b2c222b4b

comment:7 Changed 7 years ago by Karl Palmen

Add check of detector IDs re #7674

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: a65d9e0bd61addff08d8527cc9f834d7db7a7e82

comment:8 Changed 7 years ago by Karl Palmen

Add check of wavelengths re #7674

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 9c5c595d6c49149f00452c58ffee771634cf13d9

comment:9 Changed 7 years ago by Karl Palmen

Tidy code for PeaksWorkspaceTest.h re #7674

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 7f3178dece45ca7a4e32b91729b06783802e4317

comment:10 Changed 7 years ago by Karl Palmen

Get createSaveTestPeaksWorkspace to use buildPW re #7674

I found out that workspace and instrument created by buildPW was adequate for my testing requirements.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 3910f9e194702b0f977d981e5b5f3bfee86abe25

comment:11 Changed 7 years ago by Karl Palmen

Improve comment of BuildPW re #7674

The comment now indicates that the workspace has one peak. This peak delayed work till I was aware of it.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 9390880ea0176a5c6976f24337d77db3e0961c43

comment:12 Changed 7 years ago by Karl Palmen

  • Status changed from inprogress to verify
  • Resolution set to fixed

To test, review the code check that it no longer has the illegal dependencies, but still performs the tests.

comment:13 Changed 7 years ago by Russell Taylor

  • Status changed from verify to verifying
  • Tester set to Russell Taylor

comment:14 Changed 7 years ago by Russell Taylor

  • Status changed from verifying to closed

Good - it's now possible to build only up to DataObjects and for the DataObjects unit test package to run successfully.

comment:15 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8519

Note: See TracTickets for help on using tickets.