ZipStream-PHP icon indicating copy to clipboard operation
ZipStream-PHP copied to clipboard

Fix MacOs Tests

Open maennchen opened this issue 4 years ago • 11 comments

Description of the problem

Currently the MacOS tests hang forever in the CI. THis has to be solved to be able to run the CI.

  • [ ] Fix Test
  • [ ] Re-Enable Test in Workflow
  • [ ] Require test to pass before merging in the repository settings

maennchen avatar Nov 03 '20 23:11 maennchen

I do not have a MacOS device. Therefore I can't fix this one. If anyone is interested to make sure this lib is MacOS compatible, please have a look at this issue.

maennchen avatar Nov 04 '20 00:11 maennchen

i want to help out, what is needed here? make the unit tests work on osx?

pieterdt avatar Mar 04 '21 14:03 pieterdt

@pieterdt that would be awesome 🙂

maennchen avatar Mar 04 '21 14:03 maennchen

See: https://github.com/maennchen/ZipStream-PHP/blob/master/.github/workflows/php.yml#L30-L33

NicolasCARPi avatar Mar 04 '21 14:03 NicolasCARPi

is it the intention to run the test with the archive utility? because the command line can zip/unzip as well with the regular commands. Of course, chances are very high that a mac user will (unknowingly) trigger the archive utility, but if they have configured another tool as the default, that will be used.

Has the test worked in the past? because the archive utility is not scriptable, so not suited to be called on the command line.

pieterdt avatar Mar 04 '21 15:03 pieterdt

@pieterdt The idea was to use the archive utility. The reason for that is that it is the standard tool people use.

I think I was able to use the archive utility via cli at some point. No idea is that still works.

It should probably be possible to use the open cmd on OSX to trigger it and just sleep for a bit in PHP before checking if it did it properly.

maennchen avatar Mar 04 '21 16:03 maennchen

Yes, problem there is that the location of the unzipped files is unknown. You need to check the preferences of the utility to find it.

I have been searching quite a bit to find the plist file for the archive utility in order to read the settings, but no luck so far.

On Thu, Mar 4, 2021, 17:49 Jonatan Männchen [email protected] wrote:

@pieterdt https://github.com/pieterdt The idea was to use the archive utility. The reason for that is that it is the standard tool people use.

I think I was able to use the archive utility via cli at some point. No idea is that still works.

It should probably be possible to use the open cmd on OSX to trigger it and just sleep for a bit in PHP before checking if it did it properly.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/maennchen/ZipStream-PHP/issues/170#issuecomment-790760573, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFYV5BDYWQODFXSP5Y7CC3TB62ZFANCNFSM4TJL47HA .

pieterdt avatar Mar 04 '21 17:03 pieterdt

@pieterdt Apparently the Archive Utility use a tool called ditto internally. One could try if ditto also produces problems with known broken zips to verify that.

maennchen avatar Mar 04 '21 17:03 maennchen

Yes Found that as well, but had no luck unzipping with dito on a file that worked with the archive utility :^)

On Thu, Mar 4, 2021, 18:17 Jonatan Männchen [email protected] wrote:

@pieterdt https://github.com/pieterdt Apparently the Archive Utility use a tool called ditto internally. One could try if ditto also produces problems with known broken zips to verify that.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/maennchen/ZipStream-PHP/issues/170#issuecomment-790783120, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFYV5EYGQF3AKOFGDGYAEDTB66DPANCNFSM4TJL47HA .

pieterdt avatar Mar 04 '21 17:03 pieterdt

Can ditto open the file mentioned here? https://github.com/maennchen/ZipStream-PHP/issues/49#issuecomment-310385534

maennchen avatar Mar 04 '21 17:03 maennchen

ditto could open zip files I created with Archive utility, but it failed on a bunch of zipfiles I created with Zipstream. In that case the error is ditto: Couldn't read pkzip signature. ditto: Not a central directory signature

The file from isue 49 resulted also in an error: ditto: file1.txt: No such file or directory ditto: Couldn't read pkzip signature.

But it could be opened by the Archive utility.

Opening test.zip with vi also resulted in a bit of error reporting when navigating to file1.txt. So I think it is corrupt, but Archive utility could recover it. Ditto not.

pieterdt avatar Mar 04 '21 19:03 pieterdt

Test was removed in #203

maennchen avatar Nov 25 '22 04:11 maennchen

Extracted into #230

maennchen avatar Nov 28 '22 12:11 maennchen