-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from smart-on-fhir/mikix/ci
Separate test files from main module and add CI
- Loading branch information
Showing
759 changed files
with
117,216 additions
and
1,358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
omit = fhirclient/models/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
# The goal here is to cancel older workflows when a PR is updated (because it's pointless work) | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
unittest: | ||
name: unit tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: pip | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pytest pytest-cov | ||
- name: Test with pytest | ||
run: | | ||
python -m pytest --cov=fhirclient --cov-report=xml | ||
- name: Log missing coverage | ||
run: | | ||
coverage report -m --skip-covered | ||
- name: Check coverage report | ||
if: github.ref != 'refs/heads/main' | ||
uses: orgoro/[email protected] | ||
with: | ||
coverageFile: coverage.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
thresholdAll: .35 | ||
thresholdNew: 1 | ||
thresholdModified: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
*.pyc | ||
__pycache__ | ||
session_data | ||
/build/ | ||
/dist/ | ||
/*.egg-info/ | ||
|
||
# docs | ||
/docs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ def find_version(*file_paths): | |
license="APACHE2", | ||
author="SMART Platforms Team", | ||
author_email='[email protected]', | ||
packages=find_packages(exclude=['test*', '*_tests.py']), | ||
packages=find_packages(exclude=['tests*']), | ||
install_requires=['requests', 'isodate'], | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
This folder holds test code and data. | ||
|
||
To re-generate the test models, run `./generate_models.sh` from the project root. | ||
|
||
To re-generate the example test data, after re-generating the models, | ||
run: | ||
- `git rm tests/data/examples/*` | ||
- `cp fhir-parser/downloads/*example*.json tests/data/examples/` | ||
- `git add tests/data/examples/*` |
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"resourceType": "Account", | ||
"id": "ewg", | ||
"text": { | ||
"status": "generated", | ||
"div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003eInpatient Admission for Peter James Chalmers Account\u003c/div\u003e" | ||
}, | ||
"identifier": [ | ||
{ | ||
"system": "urn:oid:0.1.2.3.4.5.6.7", | ||
"value": "654321" | ||
} | ||
], | ||
"status": "active", | ||
"type": { | ||
"coding": [ | ||
{ | ||
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", | ||
"code": "PBILLACCT", | ||
"display": "patient billing account" | ||
} | ||
], | ||
"text": "patient" | ||
}, | ||
"name": "Inpatient: Peter James Chalmers", | ||
"subject": [ | ||
{ | ||
"reference": "Patient/example", | ||
"display": "Peter James Chalmers" | ||
} | ||
], | ||
"servicePeriod": { | ||
"start": "2016-01-01", | ||
"end": "2016-06-30" | ||
}, | ||
"coverage": [ | ||
{ | ||
"coverage": { | ||
"reference": "Coverage/9876B1" | ||
}, | ||
"priority": 1 | ||
}, | ||
{ | ||
"coverage": { | ||
"reference": "Coverage/7546D" | ||
}, | ||
"priority": 2 | ||
} | ||
], | ||
"owner": { | ||
"reference": "Organization/f001", | ||
"display": "Burgers University Medical Center" | ||
}, | ||
"description": "Hospital charges", | ||
"guarantor": [ | ||
{ | ||
"party": { | ||
"reference": "RelatedPerson/benedicte", | ||
"display": "Bénédicte du Marché" | ||
}, | ||
"onHold": false, | ||
"period": { | ||
"start": "2016-01-01" | ||
} | ||
} | ||
], | ||
"meta": { | ||
"tag": [ | ||
{ | ||
"system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", | ||
"code": "HTEST", | ||
"display": "test health data" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"resourceType": "Account", | ||
"id": "example", | ||
"text": { | ||
"status": "generated", | ||
"div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003eHACC Funded Billing for Peter James Chalmers\u003c/div\u003e" | ||
}, | ||
"identifier": [ | ||
{ | ||
"system": "urn:oid:0.1.2.3.4.5.6.7", | ||
"value": "654321" | ||
} | ||
], | ||
"status": "active", | ||
"type": { | ||
"coding": [ | ||
{ | ||
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", | ||
"code": "PBILLACCT", | ||
"display": "patient billing account" | ||
} | ||
], | ||
"text": "patient" | ||
}, | ||
"name": "HACC Funded Billing for Peter James Chalmers", | ||
"subject": [ | ||
{ | ||
"reference": "Patient/example", | ||
"display": "Peter James Chalmers" | ||
} | ||
], | ||
"servicePeriod": { | ||
"start": "2016-01-01", | ||
"end": "2016-06-30" | ||
}, | ||
"coverage": [ | ||
{ | ||
"coverage": { | ||
"reference": "Coverage/7546D" | ||
}, | ||
"priority": 1 | ||
} | ||
], | ||
"owner": { | ||
"reference": "Organization/hl7" | ||
}, | ||
"description": "Hospital charges", | ||
"meta": { | ||
"tag": [ | ||
{ | ||
"system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", | ||
"code": "HTEST", | ||
"display": "test health data" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.