Skip to main content

Utilities for creating, verifying, and managing test artifact directories and manifests.

Project description

jps-test-artifact-python-utils

Test Publish to PyPI codecov

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

jps_test_artifact_python_utils-0.1.2.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file jps_test_artifact_python_utils-0.1.2.tar.gz.

File metadata

File hashes

Hashes for jps_test_artifact_python_utils-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8f8025e66fd1c37f0d42b77fbc6751d4dadbfa9253fddf64ee03aac6c1d89cde
MD5 ad5b8e9b9b7cf2f1cae545edd6dd74f4
BLAKE2b-256 de0f47b42bbcc5d8888ddc90afac1aa0c90c7856dfa55d84ef5ba7fb5d3ef365

See more details on using hashes here.

File details

Details for the file jps_test_artifact_python_utils-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jps_test_artifact_python_utils-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b2d35778d76c7689baf4a02baceb004033f8ec6bccf371693ae2b5cfca1dd4dc
MD5 cd235bab31d2c6e4e67ea59a8c7428d1
BLAKE2b-256 434beab5dedf8f7be15107a14ac53724bc3ba19fb00123dce41c47965e1ad2c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page