From fa34b34a75ad65ce1e2277c87b7c6d5703db3a28 Mon Sep 17 00:00:00 2001 From: Romeo Kienzler Date: Wed, 20 May 2026 16:19:44 +0200 Subject: [PATCH] Add instructions for running unit and integration tests in README Signed-off-by: Romeo Kienzler --- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/README.md b/README.md index 8109bfd..bf08fb4 100644 --- a/README.md +++ b/README.md @@ -233,3 +233,63 @@ gridfm_graphkit --help ``` --- + +## Running Tests + +### Unit and Integration Tests + +Install the test dependencies first (if not already done): + +```bash +pip install -e .[dev,test] +``` + +Run the full unit test suite: + +```bash +pytest ./tests +``` + +Run the base set integration tests: + +```bash +pytest ./integrationtests/test_base_set.py +``` + +### Running Base Set Tests on an LSF Cluster (GPU) + +To submit the base set integration tests as an interactive LSF job with GPU access, use `bsub`. Adjust the paths to match your environment: + +```bash +bsub -gpu "num=1" \ + -n 16 \ + -R "rusage[mem=32GB] span[hosts=1]" \ + -Is \ + -J gridfm_base_set_tests \ + /bin/bash -c " + cd /path/to/gridfm-graphkit && \ + export PATH=/path/to/cuda/bin:\$PATH \ + CUDA_HOME=/path/to/cuda \ + LD_LIBRARY_PATH=/path/to/cuda/lib64:\$LD_LIBRARY_PATH && \ + source /path/to/venv/bin/activate && \ + pytest ./integrationtests/test_base_set.py + " +``` + +Key `bsub` options used above: + +| Option | Description | +| ------ | ----------- | +| `-gpu "num=1"` | Request 1 GPU | +| `-n 16` | Request 16 CPU slots | +| `-R "rusage[mem=32GB] span[hosts=1]"` | Reserve 32 GB of memory on a single host | +| `-Is` | Run as an interactive shell session | +| `-J ` | Assign a name to the job | + +**Concrete example** (adapt paths to your cluster setup): + +```bash +bsub -gpu "num=1" -n 16 -R "rusage[mem=32GB] span[hosts=1]" -Is -J hpo_trial_190 /bin/bash -c "cd /dccstor/terratorch/users/rkie/gitco/gridfm-graphkit && export PATH=/opt/share/cuda-12.8.1/bin:\$PATH CUDA_HOME=/opt/share/cuda-12.8.1 LD_LIBRARY_PATH=/opt/share/cuda-12.8.1/lib64:\$LD_LIBRARY_PATH && source /u/rkie/venvs/venv_gridfm-graphkit/bin/activate && pytest ./integrationtests/test_base_set.py" +``` + +---