From fff3bce14fec19232e27a2869f13e45d78b2e58a Mon Sep 17 00:00:00 2001
From: Henry Luetcke <hluetcke@ethz.ch>
Date: Thu, 8 Jul 2021 12:04:10 +0200
Subject: [PATCH] add break in teardown for manual emptying of trashcan

---
 obi_test.m | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/obi_test.m b/obi_test.m
index aac6e880c8a..4d61dc2ddf2 100644
--- a/obi_test.m
+++ b/obi_test.m
@@ -1,10 +1,9 @@
-function pass = obi_test(varargin)
+function obi_test(varargin)
 %obi_test Testing function for the Matlab openBIS Toolbox
 %   This function runs a few tests for the Matlab openBIS Toolbox. It
 %   returns true if all the tests pass successfully and fasle otherwise.
 %   Input argumtents (all optional):
 %   teardown ... delete everything at the end (true)
-pass = true;
 
 if nargin == 1
     teardown = varargin{1};
@@ -101,6 +100,11 @@ end
 
 
 %% 7. Tear-down (delete everything, optional)
+% Note: it is currently not possible to delete all openBIS automatically.
+% The reason is that pyBIS can only delete experiments / datasets by moving
+% them to the openBIS trashcan. Emptying the trashcan can only be done
+% manually. As long as the experiment is still in the trashscan, the
+% corresponding project and space cannot be deleted.
 if teardown
     fprintf('\n\n%s - Starting tear-down', datestr(clock,31))
     % delete the created local files
@@ -111,6 +115,9 @@ if teardown
     obi.delete_experiment(exp, 'created by Matlab-openBIS toolbox test function');
     fprintf('\n%s - Successfully deleted Experiment %s\n', datestr(clock,31), exp_name)
     
+    fprintf('\n\nPlease empty experiment %s manually from the openBIS trashcan, then press any key to continue.\n', exp_name)
+    pause()
+    
     % delete openBIS project
     obi.delete_project(project_name, 'created by Matlab-openBIS toolbox test function');
     fprintf('\n%s - Successfully deleted Project %s\n', datestr(clock,31), project_name)
-- 
GitLab