Skip to content

CLI Usage

Standalone executable for running FHIR tests without build tools.

Perfect for DevOps and CI/CD

The CLI is designed to make DevOps teams happy. Run FHIR tests in any CI/CD pipeline without Java build tool dependencies. Simple, fast, and automation-friendly.

Installation

Download the JAR:

wget https://gitlab.com/aehrc/fhir-frog/-/releases/latest/downloads/fhir-frog-cli.jar

Or build from source:

mvn clean package -pl fhir-frog-cli

Basic Usage

Execute TestScript

java -jar fhir-frog-cli.jar \
  --test-script patient-crud.json \
  --server http://localhost:8080/fhir

Execute TestPlan

java -jar fhir-frog-cli.jar \
  --test-plan TestPlan/au-core-suite \
  --server http://localhost:8080/fhir

Options

Server URL

--server <url>              FHIR server base URL
-s <url>                    Short form

TestScript

--test-script <path>        Path to TestScript (JSON/XML/TSH)
-t <path>                   Short form

TestPlan

--test-plan <reference>     TestPlan reference
-p <reference>              Short form

Report Output

--report-dir <path>         Report output directory
-r <path>                   Short form

--report-format <format>    Format: json, xml, both
-f <format>                 Short form

Verbosity

--verbose                   Verbose output
-v                          Short form

--quiet                     Minimal output
-q                          Short form

Examples

Simple Test

java -jar fhir-frog-cli.jar \
  -t patient-crud.json \
  -s http://localhost:8080/fhir

With Reports

java -jar fhir-frog-cli.jar \
  -t patient-crud.json \
  -s http://localhost:8080/fhir \
  -r ./reports \
  -f json

TestPlan Suite

java -jar fhir-frog-cli.jar \
  -p TestPlan/au-core-complete \
  -s http://localhost:8080/fhir \
  -r ./reports \
  -f both \
  -v

TSH File

java -jar fhir-frog-cli.jar \
  -t patient-crud.tsh \
  -s http://localhost:8080/fhir

Exit Codes

  • 0 - All tests passed
  • 1 - Test failures
  • 2 - Configuration error
  • 3 - Server connection error

CI/CD Integration

GitLab CI

test:fhir:
  stage: test
  image: openjdk:17
  services:
    - name: hapiproject/hapi:latest
      alias: fhir-server
  script:
    - wget https://gitlab.com/aehrc/fhir-frog/-/releases/latest/downloads/fhir-frog-cli.jar
    - java -jar fhir-frog-cli.jar -p TestPlan/suite -s http://fhir-server:8080/fhir -r reports
  artifacts:
    reports:
      junit: reports/*.xml

GitHub Actions

- name: Run FHIR Tests
  run: |
    wget https://gitlab.com/aehrc/fhir-frog/-/releases/latest/downloads/fhir-frog-cli.jar
    java -jar fhir-frog-cli.jar \
      -p TestPlan/suite \
      -s http://localhost:8080/fhir \
      -r reports

Docker

FROM openjdk:17-slim
COPY fhir-frog-cli.jar /app/
COPY tests/ /app/tests/
WORKDIR /app
ENTRYPOINT ["java", "-jar", "fhir-frog-cli.jar"]

Run:

docker run fhir-frog-cli \
  -t tests/patient-crud.json \
  -s http://fhir-server:8080/fhir

Configuration File

Create fhir-frog.properties:

fhir.server.url=http://localhost:8080/fhir
report.dir=./reports
report.format=json
verbose=true

Use:

java -jar fhir-frog-cli.jar \
  --config fhir-frog.properties \
  -t patient-crud.json

Next Steps