Skip to content

Conversation

@MichaelStritt
Copy link
Contributor

Linked issue

Check out issue #583

How to test

  • Create a testConfig.json in your ExploreASL/Testing directory
  • Run: [TestResults, CheckResults] = xASL_test_IntegrationTesting;

Comments

I know this probably doesn't fulfill all requirements yet, but I thought I could show you my initial implementation and how I want to extract the errors/warning in the future. The x struct includes a logging field now (implemented in #588). This includes both errors from the import and from the processing workflow. Those should be written into a log.xlsx file. It doesn't catch the various warnings and stuff right now, but the major things are nicely captured.

@MichaelStritt MichaelStritt added import Related to data import module bids Moving ExploreASL to BIDS compatibility labels May 27, 2021
@MichaelStritt MichaelStritt requested a review from jan-petr May 27, 2021 21:01
@MichaelStritt MichaelStritt linked an issue May 27, 2021 that may be closed by this pull request
Copy link
Contributor

@jan-petr jan-petr left a comment

Choose a reason for hiding this comment

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

I think we are nearly there. I agree with your edits. Those weird calls of ExploreASL, we have tested previously. The main thing that was missing is that during the Flavors testing, we were calling directly the ExloreASL submodules and functions like xASL_module_Import or xASL_bids_BIDS2Legacy. This did the job, but wasn't testing if the master script is working. I now replaced all the calls with calls to the master script ExploreASL. All should work and should be better for testing.

One small thing is missing - it now initializes everything again upon each call of ExploreASL - can we do something about it? Probably not and we have to live with it, right? This would be also OK - more initializations are called because we want every call to be an independent call of ExploreASL, so that's the price we pay for this.

Once we solve this minor thing and once you check if all works (I have tested 1 flavor), then I will approve and I will merge. Note that I did some small restructuring of function names etc.

@MichaelStritt
Copy link
Contributor Author

One small thing is missing - it now initializes everything again upon each call of ExploreASL - can we do something about it? Probably not and we have to live with it, right? This would be also OK - more initializations are called because we want every call to be an independent call of ExploreASL, so that's the price we pay for this.

If we want the tests to be more independent, we can add a small script to remove the Matlab paths in between. Similar to the call in Henks old test script:

% Remove ExploreASL paths
warning('off','MATLAB:rmpath:DirNotFound');
rmpath(genpath(x.MyPath));
warning('on','MATLAB:rmpath:DirNotFound');

Once we solve this minor thing and once you check if all works (I have tested 1 flavor), then I will approve and I will merge. Note that I did some small restructuring of function names etc.

@jan-petr
Copy link
Contributor

One small thing is missing - it now initializes everything again upon each call of ExploreASL - can we do something about it? Probably not and we have to live with it, right? This would be also OK - more initializations are called because we want every call to be an independent call of ExploreASL, so that's the price we pay for this.

If we want the tests to be more independent, we can add a small script to remove the Matlab paths in between. Similar to the call in Henks old test script:

% Remove ExploreASL paths
warning('off','MATLAB:rmpath:DirNotFound');
rmpath(genpath(x.MyPath));
warning('on','MATLAB:rmpath:DirNotFound');

Once we solve this minor thing and once you check if all works (I have tested 1 flavor), then I will approve and I will merge. Note that I did some small restructuring of function names etc.

Yes - good idea. Can you please add that?

@MichaelStritt MichaelStritt requested a review from jan-petr June 1, 2021 09:06
@MichaelStritt
Copy link
Contributor Author

One small thing is missing - it now initializes everything again upon each call of ExploreASL - can we do something about it? Probably not and we have to live with it, right? This would be also OK - more initializations are called because we want every call to be an independent call of ExploreASL, so that's the price we pay for this.

If we want the tests to be more independent, we can add a small script to remove the Matlab paths in between. Similar to the call in Henks old test script:

% Remove ExploreASL paths
warning('off','MATLAB:rmpath:DirNotFound');
rmpath(genpath(x.MyPath));
warning('on','MATLAB:rmpath:DirNotFound');

Once we solve this minor thing and once you check if all works (I have tested 1 flavor), then I will approve and I will merge. Note that I did some small restructuring of function names etc.

Yes - good idea. Can you please add that?

It's a bit difficult, since we have to make sure that we run it in the correct code section and we're still able to reinitialize etc.

The script to remove the paths (920fc28) is pretty simple and I found two code sections where we can easily add this (7ac0165).

@HenkMutsaerts
Copy link
Member

Looks good, just don't store these in an XLSX but rather TSV (also according to BIDS). You can use xASL_tsvWrite.

Copy link
Member

@HenkMutsaerts HenkMutsaerts left a comment

Choose a reason for hiding this comment

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

Very nice work! Though I wonder if not many of the things that are now stated explicitly in the testing scripts should be stated inside the actual ExploreASL scripts, and the testing iterates them, so simplification. E.g., the logging should be part of ExploreASL as well right, why only logging when testing and not when a user runs the scripts?

I would make the actual running and testing as equal as possible, so debugging becomes the same if a report comes from our internal testing or from the user.

@MichaelStritt
Copy link
Contributor Author

[...] logging should be part of ExploreASL as well right, why only logging when testing and not when a user runs the scripts?

Logging is part of ExploreASL already. It can be still improved though. Check out xASL_Iteration lines 399-400:

% Catch error in logging field
[x] = xASL_qc_AddLoggingInfo(x, ME);

The only thing that the integration testing script does now, is to combine all of the logs from the different flavors into an xlsx and a tsv file. IMHO we don't need this every time somebody runs ExploreASL in general.

Copy link
Contributor

@jan-petr jan-petr left a comment

Choose a reason for hiding this comment

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

OK.

@HenkMutsaerts
Copy link
Member

[...] logging should be part of ExploreASL as well right, why only logging when testing and not when a user runs the scripts?

Logging is part of ExploreASL already. It can be still improved though. Check out xASL_Iteration lines 399-400:

% Catch error in logging field
[x] = xASL_qc_AddLoggingInfo(x, ME);

The only thing that the integration testing script does now, is to combine all of the logs from the different flavors into an xlsx and a tsv file. IMHO we don't need this every time somebody runs ExploreASL in general.

OK nice!

Copy link
Member

@HenkMutsaerts HenkMutsaerts left a comment

Choose a reason for hiding this comment

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

Few minor issues but otherwise happy :)

@jan-petr jan-petr force-pushed the test-#583_IntegrationTesting branch from f668525 to 43f5305 Compare June 3, 2021 16:47
@jan-petr jan-petr requested a review from HenkMutsaerts June 3, 2021 16:48
@jan-petr jan-petr force-pushed the test-#583_IntegrationTesting branch from 43f5305 to 99c4720 Compare June 4, 2021 14:29
@jan-petr jan-petr merged commit 99c4720 into develop Jun 4, 2021
@jan-petr jan-petr deleted the test-#583_IntegrationTesting branch June 4, 2021 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bids Moving ExploreASL to BIDS compatibility import Related to data import module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run TestFlavors using ExploreASL_Master

4 participants