-
Notifications
You must be signed in to change notification settings - Fork 0
Adds NYQL-api-tests.yml #770
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
Merged
+9
−2
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
06548b7
add NYQL-api-tests.yml
chrismulholland bd9bab4
deleted file NYQL-api-tests.yml. added step to integration-tests.yml…
chrismulholland a5467e6
updated API testing section of readme
chrismulholland e94c11f
added env conditional to Run NYQL API tests step
chrismulholland 35acf64
updated API testing section of readme
chrismulholland aca96af
copy env logic from loadConfig into nyql helpers file
chrismulholland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrismulholland this env var is likely
qaon QA deploys andprodorproductionon prod deploys. You'll need to confirm the correct string. We can add some logic to decide which URL to pass in on line 47. You're already setting the url as an env var in the previously merged PR, so you'll just need to pass in the value on line 47 as a command line argument instead of in helpers.js. Lmk if this makes sense! Happy to help walk through it with you.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samanthaandrews I added env.NYQL_TEST_BASE_URL to the "Run NYQL API tests" step, set via a conditional expression: production branch gets https://platform.nypl.org/api/v0.1, everything else gets https://qa-platform.nypl.org/api/v0.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Did you by chance run these locally using the prod url to make sure the tests also run and pass on that env? I'm worried they may fail if the data is different but we'll see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! both of these pass when run locally:
npm run nyql-api-test
NYQL_TEST_BASE_URL=https://platform.nypl.org/api/v0.1 npm run nyql-api-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use the built in loadConfig method somewhere in the test set up instead https://github.com/NYPL/discovery-api/blob/main/lib/load-config.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@charmingduchess the latest push takes the ENV logic from loadConfig and adds it to the nyql api tests helper file. When I used loadConfig directly I was getting KMS errors locally. Copilot suggested the help file implementation as an equivalent replacement, as it provides the ENV info needed, while avoiding KMS errors that were seen locally when adding loadConfig directly.