artefactual / archivematica-sampledata

Archivematica sample data
http://www.archivematica.org
17 stars 15 forks source link

Add create-zip-packages function to createtransfers.py #38

Closed ross-spencer closed 6 years ago

ross-spencer commented 6 years ago

This pull request consists of two commits.

1) We add sample packages to test inside Archivematica that should always trigger a failure in the workflow when 'Extract Packages' is enabled.

2) We add a new command to createtransfers.py to output zipped versions of the sampledata it is already capable of outputting. If the command: python createtransfers.py create-zip-packages runs correctly, then the output will look like as follows.

sample-zip-packages/
├── deep-transfer
│   └── deep_zip_transfer
│       └── deep_zip_transfer.zip
├── large-transfer
│   └── large_zip_transfer
│       └── large_zip_transfer.zip
├── variously-encoded-dirs
│   ├── big5
│   │   └── big5.zip
│   ├── cp437
│   │   └── cp437.zip
│   ├── emoji
│   │   └── emoji.zip
│   ├── shift_jis
│   │   └── shift_jis.zip
│   └── windows_1252
│       └── windows_1252.zip
└── variously-encoded-files
    ├── big5
    │   └── big5.zip
    ├── cp437
    │   └── cp437.zip
    ├── emoji
    │   └── emoji.zip
    ├── shift_jis
    │   └── shift_jis.zip
    └── windows_1252
        └── windows_1252.zip

16 directories, 12 files

Many folders are used to enable selection of Transfers at different levels of granularity. Among other issues, some of these configurations will help us to test:

This PR resolves #33 .

sevein commented 6 years ago

I'm hoping that we can address https://github.com/artefactual/archivematica-sampledata/pull/41 first.

ross-spencer commented 6 years ago

after I run the new create-zip-packages sub-command and not the one you list in the description of the PR. This suggests to me that the create_zip_dance func is overwriting some of its zip files when they are below a certain depth in the directory hierarchy:

Hi @jrwdunham I am wondering if you would double-check that again for me? If I delete that folder, and then run the command, then for me, it is creating the directories I describe. I wonder if we are seeing another issue? Perhaps a zip encoding error that is silently failing for one of the encoding types? (Are you testing on a mac?)

ross-spencer commented 6 years ago

HI @jrwdunham depending on what you see when you run the script again (you can use the MakeFile if you like) then the last commit should address the CR changes you requested (most of the optional changes were added too, thanks for the guidance).