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

chore(compass-e2e-tests): add generative query ai e2e tests with mock server COMPASS-6978 #4728

Merged
merged 8 commits into from
Aug 15, 2023

Conversation

Anemy
Copy link
Member

@Anemy Anemy commented Aug 14, 2023

COMPASS-6978

Starts a mock server, opens the ai input, enters a prompt, runs it, ensures that the query populates and is runnable. These tests use environment variables to skip the Atlas login. We might want to actually sign into Atlas as part of the end to end test, at least in evergreen. I can make a follow up ticket or do it here depending on how folks feel.

@Anemy Anemy changed the title chore(compass-e2e-tests): add generative ai e2e tests mock server chore(compass-e2e-tests): add generative query ai e2e tests with mock server COMPASS-6978 Aug 14, 2023
Copy link
Collaborator

@gribnoysup gribnoysup left a comment

Choose a reason for hiding this comment

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

Looks good, left one comment, but feel free to ignore it if it doesn't make sense to you

Comment on lines +115 to +121
// Check that the request was made with the correct parameters.
const requests = getRequests();
expect(requests.length).to.equal(1);
expect(requests[0].content.userInput).to.equal(testUserInput);
expect(requests[0].content.collectionName).to.equal('numbers');
expect(requests[0].content.databaseName).to.equal('test');
expect(requests[0].content.schema).to.exist;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Feel free to keep it, but this is something we already cover with functional tests and I don't think redundancy is needed here. From our e2e tests I would mostly expect testing that the UI is correctly handling user interactions

I know that we do a similar thing for analytics, but this is not something we usually cover with unit / functional, so there it makes more sense to check specifically what got pushed to the backend

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, I'll remove those extra checks in another pr to avoid another test ci run.

@Anemy Anemy merged commit 3b4592e into main Aug 15, 2023
5 checks passed
@Anemy Anemy deleted the COMPASS-6978-add-generative-ai-e2e-tests-mock-server branch August 15, 2023 16:14
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