-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add end to end test suite to test NextJS app in Edge runtime w/TS client #304
Open
aulorbe
wants to merge
15
commits into
main
Choose a base branch
from
Audrey/e2e
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8b10b2c
Try #1, new e2e workflow
aulorbe bf020b2
Remove mkdir command
aulorbe 36a0799
#3
aulorbe 6f83553
Try to clean up indexes afterwards
aulorbe ac6aedd
Add deletion step
aulorbe 378ce62
Change success code in deletion
aulorbe a1ab1f8
Change branch of app to main
aulorbe 70d8612
lint, format
aulorbe 1adf0a9
Finalize details
aulorbe c6f1c18
Oops, add checkout step in testing.yml
aulorbe 7966e6d
Missing dash before `uses`
aulorbe 49938dd
One more
aulorbe a3c8f7a
Final edits
aulorbe 4d168a0
Remove unnecessary parts of deletion process
aulorbe d2841b5
Add back in `exit 1` in deletion part
aulorbe 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,10 @@ name: Spin up Vercel App | |
inputs: | ||
vercel-token: | ||
required: true | ||
description: 'Vercel token to deploy the app' | ||
PINECONE_API_KEY: | ||
required: true | ||
description: 'Pinecone API key to send requests to the Vercel app' | ||
|
||
runs: | ||
using: 'composite' | ||
|
@@ -27,27 +31,47 @@ runs: | |
uses: GuillaumeFalourd/clone-github-repo-action@main | ||
with: | ||
owner: 'pinecone-io' | ||
repository: 'pinecone-rag-demo' | ||
branch: 'main' | ||
repository: 'ts-client-e2e-tests' | ||
branch: 'Audrey/add-app' | ||
aulorbe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Move package to pinecone-rag-demo | ||
run: cd pinecone-rag-demo && mv ../pinecone-database-pinecone-*.tgz . | ||
- name: Move package to ts-client-e2e-tests | ||
run: mkdir ts-client-e2e-tests && cd ts-client-e2e-tests && mv ../pinecone-database-pinecone-*.tgz . | ||
shell: bash | ||
|
||
- name: Install rag-demo deps | ||
run: cd pinecone-rag-demo && npm install | ||
- name: Install e2e tests dependencies | ||
run: cd ts-client-e2e-tests && npm install | ||
shell: bash | ||
|
||
- name: Install pinecone-ts-client "main" branch code into the Vercel app | ||
run: cd pinecone-rag-demo && npm install pinecone-database-pinecone-*.tgz | ||
run: cd ts-client-e2e-tests && npm install pinecone-database-pinecone-*.tgz | ||
shell: bash | ||
|
||
- name: Install Vercel CLI | ||
run: cd pinecone-rag-demo && npm install vercel | ||
run: cd ts-client-e2e-tests && npm install vercel | ||
shell: bash | ||
|
||
- name: Deploy Project Artifacts to Vercel | ||
- name: Deploy app to Vercel | ||
run: | | ||
cd pinecone-rag-demo | ||
cd ts-client-e2e-tests | ||
vercel --scope=pinecone-io --token=${{ inputs.vercel-token }} --yes | ||
shell: bash | ||
|
||
- name: Send POST request to endpoint Vercel app endpoint api/createSeedQuery | ||
run: | | ||
API_URL="https://ts-client-e2e-tests.vercel.app/api/createSeedQuery" | ||
API_KEY=${{ inputs.PINECONE_API_KEY }} | ||
response=$(curl --silent --location --request POST "$API_URL" --header "PINECONE_API_KEY: $API_KEY") | ||
|
||
match_count=$(echo "$response" | jq '.queryResult.matches | length') | ||
if [ $? -ne 0 ]; then | ||
echo "Error: Request failed." | ||
exit 1 | ||
fi | ||
|
||
if [ "$match_count" -lt 1 ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is where we assert on the response in CI |
||
echo "Error: Expected at least one result in queryResult.matches, but found none." | ||
exit 1 | ||
else | ||
echo "Success: Found $match_count result(s) in queryResult.matches." | ||
fi | ||
shell: bash |
This file contains 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.
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.
Just a note for the previous step:
npm pack
packages up the existing code on the existing branch, so it'll run the code devs are proposing to merge in their PR, rather than whatever code is onnpm
etc. This removes the need for us to merge things before testing them end to end.