uchicago-library / attachment-converter

Attachment Converter: tool for batch converting attachments in an email mailbox
GNU General Public License v2.0
8 stars 3 forks source link

Create private test suite #87

Closed bufordrat closed 10 months ago

bufordrat commented 10 months ago

As we begin kicking Attachment Converter testing into high gear, we will need a straightforward way to keep track of problem emails in connection with the bugs they cause.

To facilitate this, we will create a private Git repository specifically for storing data related to unit or cram test we want to run that contains sensitive information. The exact location of this repository is TBD (coming soon!), but even before it is ready, we need to set the Attachment Converter project up to be able to run tests using files from a clone of that repository.

Probably the best way to approach this would be to create a new executable for private tests specifically. This "private test" executable would expect the private repository to be cloned on the developer's machine in order to run. It would be separate from our ordinary test suite, which is totally open source and available to anyone on the internet to run if they wish.

bufordrat commented 10 months ago

Some experimentation has revealed that we will in fact not have to create a new testing executable. Awesome! All we will have to do is clone the new private repo down and symlink it into the project directory. I am therefore closing this issue, since it requires no change to any of the code here.

bufordrat commented 10 months ago

Here is some background info. In the private repo, I will start off with the following directory structure:

$ ls -1
dummy.t
dune
test_emails/

Then put the following in the dummy.t file:

Dummy cram test: demonstrate that we can run tests on real emails
  $ cat ../private-cram-tests/test_emails/dummy.eml > /dev/null

The dune file looks like this:

(cram
  (deps 
    ../private-cram-tests/test_emails/dummy.eml
    ))

Then in test_emails:

$ ls test_emails
dummy.eml
$ cat test_emails/dummy.eml 
From: Daffy Duck <daffy@uchicago.edu>
Date: Tue, 10 Aug 2004 14:17:45 -0500

This boilerplate can be a basis for:

bufordrat commented 10 months ago

What you can then do, once you've cloned the repository whose root is private-cram-tests, is:

$ cd /path/to/attachment-converter
$ ln -s /path/to/private-cram-tests ./private-cram-tests

Then when you next run dune test, the private cram tests will start running! Excellent! \<insert Bill and Ted guitar riff sound here>