dididy commented on code in PR #5128: URL: https://github.com/apache/zeppelin/pull/5128#discussion_r2604632560
########## zeppelin-web-angular/e2e/cleanup-util.ts: ########## @@ -0,0 +1,83 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BASE_URL, E2E_TEST_FOLDER } from './utils'; + +export const cleanupTestNotebooks = async () => { + try { + console.log('Cleaning up test folder via API...'); + + // Get all notebooks and folders + const response = await fetch(`${BASE_URL}/api/notebook`); + const data = await response.json(); + if (!data.body || !Array.isArray(data.body)) { + console.log('No notebooks found or invalid response format'); + return; + } + + // Find the test folder + const testFolders = data.body.filter( + (item: { path: string }) => + item.path && item.path.split(E2E_TEST_FOLDER)[0] === '/' && !item.path.includes(`~Trash`) Review Comment: e6033e8 I’ve updated it according to the conditions you mentioned. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
