-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix(ui): broken playwright authentication for cleanup #1016
Merged
Conversation
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
✅ Deploy Preview for leapfrogai-docs canceled.
|
andrewrisse
changed the title
fix(ui): broken playwright authentication for cleanup
bug(ui): broken playwright authentication for cleanup
Sep 10, 2024
andrewrisse
changed the title
bug(ui): broken playwright authentication for cleanup
fix(ui): broken playwright authentication for cleanup
Sep 10, 2024
2 tasks
justinthelaw
approved these changes
Sep 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Our workflow currently does not run all the Playwright tests and there is a separate issue to enable all of them. After deleting and re-deploying Supabase on leapfrog-04, it was discovered then when running all the playwright tests with a locally running frontend against the backend on leapfrog-04, the cleanup steps that utilize playwright fixtures no longer worked.
The root cause of the issue was that the fakekeycloak user in leapforg-04 Supabase had previously had their keycloak password manually applied to their account in Supabase. Normally, when creating a user with Keycloak, Keycloak stores the password, and it is not stored in Supabase. Our playwright cleanup functions were trying to get an access token for a user using the service role key and the user's username/password, but the password no longer existed in Supabase.
CHANGES
This PR refactors the way we get an access token for playwright cleanup functions by using cookies instead. It works when keycloak is turned on or off. Additionally, it removes the need for the SERVICE_KEY_ROLE env variable.
The tests at test/chat.test.ts have also been added to the workflow to ensure these fixtures are utilized in the pipeline and this issue doesn't is caught if it ever happens again.
IMPORTANT
These changes allow e2e tests under the /tests folder that utilize the getOpenAI client or supabase clients to run. I attempted to run the chat.test.ts tests in the workflow, but only the 'it can chat with an assistant that doesnt have files' test would pass. The other tests can now run (which is what this PR fixes) but they could not get chat responses successfully from the backend. The chat.test.ts tests were removed from the workflow (as they were before) and this issue will need be addressed separately with #894. A comment was added to that issue to explain this problem.
Checklist before merging