| name | test-hfs |
| description | Plan, run, or debug tests in the Helios HFS Rust workspace. Use for cargo test selection, FHIRPath tests, SQL-on-FHIR tests, persistence integration tests, testcontainers, tenant isolation, Elasticsearch test tuning, and test data locations. |
Testing HFS
Use this for test strategy, test setup, and test commands across this workspace.
General Commands
cargo test
cargo test --features R4,R4B,R5,R6
cargo test -p helios-sof
cargo test -p helios-fhirpath
cargo test -p helios-persistence
cargo test test_name_pattern
cargo test --test test_file_name
cargo test -- --nocapture
Patterns
FHIRPath
- Test cases live in
crates/fhirpath/tests/.
- Official FHIR test cases come from the
fhir-test-cases repository.
SQL-on-FHIR
- Unit tests live in
src/ files.
- Integration tests live in
tests/.
Persistence
- Integration tests use testcontainers for PostgreSQL and Elasticsearch, so Docker is required.
- Use
tokio::sync::OnceCell for shared containers across tests: one container per test binary.
- Isolate test data with unique UUID-based prefixes or tenant IDs instead of separate containers.
- Cap Elasticsearch JVM heap with
ES_JAVA_OPTS=-Xms256m -Xmx256m.
pysof
cd crates/pysof
uv run pytest python-tests/ -v
cargo test
Test Data
- FHIR examples live in
crates/fhir/tests/data/.
- Search parameter definitions live in
data/search-parameters-{r4,r4b,r5,r6}.json.
- ViewDefinition examples are embedded in test files.