Skip to content

Commit

Permalink
Fix expected string in test
Browse files Browse the repository at this point in the history
Add documentation on testing and rename test env var for slurm partition
  • Loading branch information
PeterC-DLS committed Jan 29, 2024
1 parent b271520 commit e7ee00e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,17 @@ setup(
```

which will look for a module called `blah1_wrapper` in `whatever_package1` package.


## Testing

Tests can be run with
```
$ pytest tests
```
To test interactions with Slurm, set the following environment variables:
```
SLURM_REST_URL # URL for server and port where the REST endpoints are hosted
SLURM_PARTITION # Slurm cluster parition
SLURM_JWT # JSON web token for access to REST endpoints
```
2 changes: 1 addition & 1 deletion tests/test_job_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_create_job_submission(self) -> None:
)

expected_command = (
f"#!/bin/bash\n{runner_script} {job_script} --memory 4000 --cores 5"
f"#!/bin/bash\n{runner_script} {job_script} --memory 4000M --cores 5"
f" --output {cluster_output_dir}/out_0 --images 0::2"
f" --input-path {input_path}"
)
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from os import path
from pathlib import Path

PARTITION = os.getenv("DEFAULT_SLURM_PARTITION")
PARTITION = os.getenv("SLURM_PARTITION")


def get_slurm_rest_url() -> str | None:
Expand Down

0 comments on commit e7ee00e

Please sign in to comment.