Utilities for creating, verifying, and managing test artifact directories and manifests.
Project description
jps-test-artifact-python-utils
Utilities for creating, verifying, and managing test artifact directories used to support functional testing of command-line executables. Includes CLI tools for setting up test directories, generating MD5 manifests, and validating test data integrity.
🧩 Installation
pip install jps-test-artifact-python-utils
or install in editable mode for local development:
git clone git@github.com:jai-python3/jps-test-artifact-python-utils.git
cd jps-test-artifact-python-utils
pip install -e .
🧩 setup-test-artifacts
Sets up a new test artifact instance directory by copying representative input, output, and script files into a new workspace.
Usage
setup-test-artifacts --indir <test-case-dir> [--script-dir <scripts-dir>]
Example
setup-test-artifacts --indir synthentic-genomics-pipeline/v1.2.0/comp_analysis/test-case-001/
This generates a fully configured test workspace with expected structure and a runnable shell script.
🧩 create-md5-manifest
Generates an md5_manifest.txt file listing all files under a given directory with their MD5 checksums, sizes, and timestamps.
Usage
create-md5-manifest --test-case-dir <path> --manifest-file <path>
Example Output
## method-created: /scripts/create_md5_manifest.py
## date-created: 2025-10-28 13:22:01
## created-by: jsundaram
## Columns:
## 1: relative file path
## 2: md5sum
## 3: number of bytes
## 4: date/time md5sum was derived
inputs/sample_input.vcf 3d883acf1a3db79c3390b8a96570a2ec 2145 2025-10-28-13:22:03
outputs/expected_output.tsv 53754d366f5676075a00e4c979f85cae 907 2025-10-28-13:22:04
🧩 verify-md5-manifest
Compares the current MD5 checksums of files in a test artifact directory with a saved manifest, reporting any mismatches or missing files.
Usage
verify-md5-manifest --test-case-dir <path> --manifest-file <path>
Example Output
✔ inputs/sample_input.vcf
✔ outputs/expected_output.tsv
✘ outputs/altered_output.tsv
2 of 3 files passed
Files with mismatched MD5 sums:
File: outputs/altered_output.tsv
Current MD5: 25a89f...
Previous MD5: 53754d...
🗂 Example Test Artifact Directory Layout
synthentic-genomics-pipeline/v1.2.0/comp_analysis/test-case-001/
├── inputs/
│ ├── sample_input.bam
│ ├── sample_input.vcf
│ └── genes.fasta
├── outputs/
│ └── expected_output.tsv
└── scripts/
├── requirements.txt
└── run_test_case.sh.tmpl
🧾 Logging
Logs follow this format:
LOG_FORMAT = "%(levelname)s : %(asctime)s : %(pathname)s : %(lineno)d : %(message)s"
- Only WARNING and above are printed to STDERR.
- INFO, WARNING, ERROR, and FATAL are all written to the log file.
🧪 Development and Testing
Install dependencies for linting, formatting, and testing:
pip install -e '.[dev]'
Run all lint and test checks:
make lint
make test
🧾 License
MIT License
© 2025 Jaideep Sundaram
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jps_test_artifact_python_utils-0.1.0.tar.gz.
File metadata
- Download URL: jps_test_artifact_python_utils-0.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fc03e64a968e43573ad2026fdfa20d0e9a4cbc3c92018b1c4d880e04abe6271
|
|
| MD5 |
71e9b3f3e6835e73619749b5a263d423
|
|
| BLAKE2b-256 |
a7ca162f327f122c22b810ea751271dfb59e75886c91fd0e04893a9566be43fb
|
File details
Details for the file jps_test_artifact_python_utils-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jps_test_artifact_python_utils-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc8f82310953f34ea9118900f15c49c03166fa5a91cd0189cf8a8bdc0bba4f65
|
|
| MD5 |
759eb226169b3e4b7a35d7e714c6a1fd
|
|
| BLAKE2b-256 |
1911b701be8bcaf7ce266a615a8006952cd13ad26f69988cd916318e4edfda0e
|