@@ -261,198 +261,6 @@ public function testAbsReadFilesOverwrite(): void
261261 );
262262 }
263263
264- public function testReadAbsFilesTagsFilterRunId (): void
265- {
266- $ clientWrapper = $ this ->getClientWrapper (null );
267- $ temp = new Temp ('input-mapping ' );
268- $ root = $ temp ->getTmpFolder ();
269- file_put_contents ($ root . '/upload ' , 'test ' );
270- $ reader = new Reader ($ this ->getStagingFactory ($ clientWrapper ));
271- $ fo = new FileUploadOptions ();
272- $ fo ->setTags (['download-files-test ' ]);
273-
274- $ clientWrapper ->getTableAndFileStorageClient ()->setRunId ('xyz ' );
275- $ id1 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
276- $ id2 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
277- $ clientWrapper ->getTableAndFileStorageClient ()->setRunId ('1234567 ' );
278- $ id3 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
279- $ id4 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
280- $ clientWrapper ->getTableAndFileStorageClient ()->setRunId ('1234567.8901234 ' );
281- $ id5 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
282- $ id6 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
283- sleep (5 );
284- $ configuration = [
285- [
286- 'tags ' => ['download-files-test ' ],
287- 'filter_by_run_id ' => true ,
288- 'overwrite ' => true ,
289- ],
290- ];
291-
292- $ reader ->downloadFiles (
293- $ configuration ,
294- 'download ' ,
295- AbstractStrategyFactory::WORKSPACE_ABS ,
296- new InputFileStateList ([]),
297- );
298-
299- try {
300- $ this ->blobClient ->getBlob (
301- $ this ->workspaceCredentials ['container ' ],
302- 'download/upload/ ' . $ id1 ,
303- );
304- self ::fail ('should have thrown 404 ' );
305- } catch (ServiceException $ exception ) {
306- self ::assertEquals (404 , $ exception ->getCode ());
307- }
308- try {
309- $ this ->blobClient ->getBlob (
310- $ this ->workspaceCredentials ['container ' ],
311- 'download/upload/ ' . $ id1 . '.manifest ' ,
312- );
313- self ::fail ('should have thrown 404 ' );
314- } catch (ServiceException $ exception ) {
315- self ::assertEquals (404 , $ exception ->getCode ());
316- }
317- try {
318- $ this ->blobClient ->getBlob (
319- $ this ->workspaceCredentials ['container ' ],
320- 'download/upload/ ' . $ id2 ,
321- );
322- self ::fail ('should have thrown 404 ' );
323- } catch (ServiceException $ exception ) {
324- self ::assertEquals (404 , $ exception ->getCode ());
325- }
326- try {
327- $ this ->blobClient ->getBlob (
328- $ this ->workspaceCredentials ['container ' ],
329- 'download/upload/ ' . $ id2 . '.manifest ' ,
330- );
331- self ::fail ('should have thrown 404 ' );
332- } catch (ServiceException $ exception ) {
333- self ::assertEquals (404 , $ exception ->getCode ());
334- }
335- $ this ->assertBlobNotEmpty (
336- 'download/upload/ ' . $ id3 ,
337- );
338- $ this ->assertBlobNotEmpty (
339- 'download/upload/ ' . $ id3 . '.manifest ' ,
340- );
341- $ this ->assertBlobNotEmpty (
342- 'download/upload/ ' . $ id4 ,
343- );
344- $ this ->assertBlobNotEmpty (
345- 'download/upload/ ' . $ id4 . '.manifest ' ,
346- );
347- $ this ->assertBlobNotEmpty (
348- 'download/upload/ ' . $ id5 ,
349- );
350- $ this ->assertBlobNotEmpty (
351- 'download/upload/ ' . $ id5 . '.manifest ' ,
352- );
353- $ this ->assertBlobNotEmpty (
354- 'download/upload/ ' . $ id6 ,
355- );
356- $ this ->assertBlobNotEmpty (
357- 'download/upload/ ' . $ id6 . '.manifest ' ,
358- );
359- }
360-
361- public function testReadFilesEsQueryFilterRunId (): void
362- {
363- $ clientWrapper = $ this ->getClientWrapper (null );
364- $ temp = new Temp ('input-mapping ' );
365- $ root = $ temp ->getTmpFolder ();
366- file_put_contents ($ root . '/upload ' , 'test ' );
367- $ reader = new Reader ($ this ->getStagingFactory ($ clientWrapper ));
368- $ fo = new FileUploadOptions ();
369- $ fo ->setTags (['download-files-test ' ]);
370-
371- $ clientWrapper ->getTableAndFileStorageClient ()->setRunId ('xyz ' );
372- $ id1 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
373- $ id2 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
374- $ clientWrapper ->getTableAndFileStorageClient ()->setRunId ('1234567 ' );
375- $ id3 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
376- $ id4 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
377- $ clientWrapper ->getTableAndFileStorageClient ()->setRunId ('1234567.8901234 ' );
378- $ id5 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
379- $ id6 = $ clientWrapper ->getTableAndFileStorageClient ()->uploadFile ($ root . '/upload ' , $ fo );
380- sleep (5 );
381- $ configuration = [
382- [
383- 'query ' => 'tags: download-files-test ' ,
384- 'filter_by_run_id ' => true ,
385- 'overwrite ' => true ,
386- ],
387- ];
388- $ reader ->downloadFiles (
389- $ configuration ,
390- 'download ' ,
391- AbstractStrategyFactory::WORKSPACE_ABS ,
392- new InputFileStateList ([]),
393- );
394- try {
395- $ this ->blobClient ->getBlob (
396- $ this ->workspaceCredentials ['container ' ],
397- 'download/upload/ ' . $ id1 ,
398- );
399- self ::fail ('should have thrown 404 ' );
400- } catch (ServiceException $ exception ) {
401- self ::assertEquals (404 , $ exception ->getCode ());
402- }
403- try {
404- $ this ->blobClient ->getBlob (
405- $ this ->workspaceCredentials ['container ' ],
406- 'download/upload/ ' . $ id1 . '.manifest ' ,
407- );
408- self ::fail ('should have thrown 404 ' );
409- } catch (ServiceException $ exception ) {
410- self ::assertEquals (404 , $ exception ->getCode ());
411- }
412- try {
413- $ this ->blobClient ->getBlob (
414- $ this ->workspaceCredentials ['container ' ],
415- $ root . 'download/upload/ ' . $ id2 ,
416- );
417- self ::fail ('should have thrown 404 ' );
418- } catch (ServiceException $ exception ) {
419- self ::assertEquals (404 , $ exception ->getCode ());
420- }
421- try {
422- $ this ->blobClient ->getBlob (
423- $ this ->workspaceCredentials ['container ' ],
424- 'download/uppload/ ' . $ id2 . '.manifest ' ,
425- );
426- self ::fail ('should have thrown 404 ' );
427- } catch (ServiceException $ exception ) {
428- self ::assertEquals (404 , $ exception ->getCode ());
429- }
430- $ this ->assertBlobNotEmpty (
431- 'download/upload/ ' . $ id3 ,
432- );
433- $ this ->assertBlobNotEmpty (
434- 'download/upload/ ' . $ id3 . '.manifest ' ,
435- );
436- $ this ->assertBlobNotEmpty (
437- 'download/upload/ ' . $ id4 ,
438- );
439- $ this ->assertBlobNotEmpty (
440- 'download/upload/ ' . $ id4 . '.manifest ' ,
441- );
442- $ this ->assertBlobNotEmpty (
443- 'download/upload/ ' . $ id5 ,
444- );
445- $ this ->assertBlobNotEmpty (
446- 'download/upload/ ' . $ id5 . '.manifest ' ,
447- );
448- $ this ->assertBlobNotEmpty (
449- 'download/upload/ ' . $ id6 ,
450- );
451- $ this ->assertBlobNotEmpty (
452- 'download/upload/ ' . $ id6 . '.manifest ' ,
453- );
454- }
455-
456264 public function testAbsWorkspaceAdaptiveInput (): void
457265 {
458266 $ clientWrapper = $ this ->getClientWrapper (null );
0 commit comments