Skip to content

working prototype for NYQL api tests#737

Open
chrismulholland wants to merge 1 commit into
mainfrom
SCC-5389/NYQL-api-tests
Open

working prototype for NYQL api tests#737
chrismulholland wants to merge 1 commit into
mainfrom
SCC-5389/NYQL-api-tests

Conversation

@chrismulholland
Copy link
Copy Markdown

@chrismulholland chrismulholland commented May 20, 2026

Adds api tests for NYQL. Please note that this is an initial prototype and contains a lot of console.log statements for debugging. These will eventually be removed.

Copy link
Copy Markdown
Contributor

@danamansana danamansana left a comment

Choose a reason for hiding this comment

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

This looks like a great start!

Copy link
Copy Markdown

@samanthaandrews samanthaandrews left a comment

Choose a reason for hiding this comment

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

Agree with Daniel that this is good to merge as is, just a few general comments and questions from me


testCases.forEach(({ name, nyql, advanced }) => {
it(`should match results for ${name}`, async () => {
const baseUrl = "https://qa-platform.nypl.org/api/v0.1";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In the future, we will probably want to pull this out into an environment variable, e.g., process.env.API_BASE_URL, so that we can switch it out with the locally running version more easily

Comment thread package-lock.json
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We spoke about this in our 1:1, but since there are a lot of changes to this file, it's probably a good idea to run it by the team and get the endpoint running locally just to make sure we didn't accidentally introduce any other breaking changes

Comment thread package.json
"deploy-production": "git checkout production && git pull origin qa && eb deploy discovery-api-production --profile nypl-digital-dev",
"rebuild-annotated-marc-rules": "./scripts/update-annotated-marc-rules.js --refetch"
"rebuild-annotated-marc-rules": "./scripts/update-annotated-marc-rules.js --refetch",
"api-test": "npx mocha test/integration/nyql-api.test.js --exit"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice!!

];

describe("Discovery API - NYQL vs Advanced Search equivalence", function () {
this.timeout(30000);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

curious to know about this timeout vs the two that are happening within each request. i'm guessing this one is a timeout for the full describe block but the other two are timeouts for those requests explicitly. my question is what happens if we don't add any timeouts at all? not sure what the best practice is here tbh so i'm looking for your thoughts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants