-
Notifications
You must be signed in to change notification settings - Fork 7
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 #15 from NSLS2/update-github-actions
Update GitHub actions
- Loading branch information
Showing
19 changed files
with
269 additions
and
91 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,42 @@ | ||
name: Integration Tests for Deployed API | ||
|
||
on: | ||
schedule: | ||
- cron: '*/5 * * * *' | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
integration_tests: | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- name: Print hostname | ||
run: echo "The hostname is $(hostname)" | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: '17' | ||
|
||
- name: Download ijhttp.zip | ||
run: curl -f -L -o ijhttp.zip "https://jb.gg/ijhttp/latest" | ||
|
||
- name: Unzip ijhttp.zip | ||
run: unzip -q ijhttp.zip | ||
|
||
- name: Beamline endpoint tests | ||
run: | | ||
./ijhttp/ijhttp --env-file ./integration-tests/http-client.env.json \ | ||
--env production \ | ||
./integration-tests/check_all_beamlines.http | ||
- name: Check API Service | ||
run: | | ||
./ijhttp/ijhttp --env-file ./integration-tests/http-client.env.json \ | ||
--env production \ | ||
./integration-tests/check_service_health.http |
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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
# Project exclude paths | ||
/venv/ | ||
|
||
# Hatch managed version file | ||
src/nsls2api/_version.py | ||
|
||
|
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,20 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: FastAPI", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "uvicorn", | ||
"args": [ | ||
"nsls2api.main:app", | ||
"--reload" | ||
], | ||
"jinja": true, | ||
"justMyCode": true | ||
} | ||
] | ||
} |
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,36 @@ | ||
### Check About Details | ||
# @name api-about-details | ||
GET http://{{host}}/v1/about | ||
Accept: application/json | ||
|
||
> {% | ||
client.test("Request executed successfully", function () { | ||
client.assert(response.status === 200, "Response status is not 200"); | ||
}); | ||
%} | ||
|
||
### Check API Stats | ||
# @name api-stats | ||
GET http://{{host}}/v1/stats | ||
Accept: application/json | ||
|
||
> {% | ||
client.test("Request executed successfully", function () { | ||
client.assert(response.status === 200, "Response status is not 200"); | ||
}); | ||
|
||
client.test("Response content-type is json", function() { | ||
var type = response.contentType.mimeType; | ||
client.assert(type === "application/json", "Expected 'application/json' but received '" + type + "'"); | ||
}); | ||
|
||
client.test("Returns sensible numbers", function() { | ||
var data = response.body; | ||
client.assert(data.hasOwnProperty("facility_count"), "Response body does not contain 'facility_count' property"); | ||
client.assert(data.facility_count === 3, "Expected 'facility_count' to be 3 but received '" + data.facility_count + "'"); | ||
client.assert(data.proposal_count > 0, "Expected 'proposal_count' to be greater than 0 but received '" + data.proposal_count + "'"); | ||
client.assert(data.commissioning_proposal_count > 0, "Expected 'commissioning_proposal_count' to be greater than 0 but received '" + data.proposal_count + "'"); | ||
client.assert(data.beamline_count > 0, "Expected 'beamline_count' to be greater than 0 but received '" + data.proposal_count + "'"); | ||
}); | ||
|
||
%} |
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
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 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
Oops, something went wrong.