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

ndc-test #10

Merged
merged 51 commits into from
Apr 1, 2024
Merged

ndc-test #10

merged 51 commits into from
Apr 1, 2024

Conversation

pranshi06
Copy link
Collaborator

@pranshi06 pranshi06 commented Mar 15, 2024

Fix errors while running ndc-test

How to test:

  1. Run the Azure Cosmos emulator or Cosmos cloud URL
  2. If using an emulator, run /script/app.js using node app.js - This will create a database, a container and add data to the emulator.
  3. Start the connector - with connector_config_emulator.json file as configuration for emulator and connector_config.json file for cloud.
  4. Run cargo run --bin ndc-test -- test --endpoint http://localhost:8080 in ndc-spec repo

or follow the Readme.md for pre-existing snapshot tests

Comment on lines 77 to 78
if (Object.keys(fieldsToSelect).length === 0) {
return `*`
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not correct. In this case we can just return VALUE {}.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My bad. I missed it when removing extra code. Fixed it.

src/execution.ts Outdated
Comment on lines 173 to 175
if (sqlGenCtx.selectFields == null || sqlGenCtx.selectFields == undefined || Object.keys(sqlGenCtx.selectFields).length === 0) {
queryResponse = [];
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You won't need to do this if you are run SELECT VALUE {} when fields is an empty array.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is returning 500 internal error saying incorrect syntax near '{

@codingkarthik
Copy link
Collaborator

Add data to it

I think there should be a script to do this. Then we can call this script as part of the CI pipeline too.

@pranshi06 pranshi06 marked this pull request as ready for review March 19, 2024 12:58
@codingkarthik codingkarthik merged commit 7a9ffe9 into main Apr 1, 2024
1 check passed
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.

2 participants