Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial set of CI tests together with a ephemeral MongoDB container #117

Merged
merged 46 commits into from
Nov 1, 2024

Conversation

stuartcampbell
Copy link
Collaborator

@stuartcampbell stuartcampbell commented Oct 10, 2024

This is to add some CI testing - it is not an exhaustive list, just submitting the PR before it gets really long!

The last run of the CI pipeline against this branch can be found here : https://github.com/stuartcampbell/nsls2api/actions/runs/11523289207

or in the test list below 😄

@stuartcampbell stuartcampbell self-assigned this Oct 25, 2024
@stuartcampbell stuartcampbell added the enhancement New feature or request label Oct 25, 2024
Copy link
Collaborator

@padraic-shafer padraic-shafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding these unit tests!!!

None of my comments are blocking. I leave to you whether to defer suggestions to a future PR or not. OK to merge.

Comment on lines +32 to +33
# This is to make sure that the client is using the same event loop as the rest of the application
client.get_io_loop = asyncio.get_event_loop
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think this was defeating me in some rounds of debugging earlier.

) as ac:
response = await ac.get("/v1/beamline/does-not-exist")
assert response.status_code == 404
assert response.json() == {"detail": "Beamline 'does-not-exist' does not exist"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on how strictly this response will be relied upon downstream--i.e., is this part of the API ?--consider a partial match here. E.g., 'does-not-exist' in response.text

Suggested change
assert response.json() == {"detail": "Beamline 'does-not-exist' does not exist"}
assert response.json() == {"detail": "Beamline 'does-not-exist' does not exist"}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume that you meant to enter a suggestion here and not the same code again 😄

@danielballan danielballan merged commit 52be099 into NSLS2:main Nov 1, 2024
4 checks passed
@stuartcampbell stuartcampbell deleted the add-more-tests branch November 6, 2024 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants