Plugin E2E: Fix - skip creating user if it's the default server admin #941
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.
What this PR does / why we need it:
This PR fixes an issue related to creating user that was introduced in plugin-e2e@1.3.0 (this PR).
In that PR,
user
became a Playwright option with a default value ofadmin:admin
. Since the default user is always provided, plugin-e2e would try to create if. Normally this should be fine - if the user already exist, server will return a 412 which will be logged and swallowed by plugin-e2e. However, that doesn't seem to be the case when it's trying to create the server admin account. Then we're getting the following error:The solution is to not create user if its username and pass matches the default users.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Some of the scaffolding tests in CI were failing because they were using the broken 1.3.0 version of plugin-e2e which this PR aims to fix. So I have to pin the plugin-e2e version to 1.2.0 to get those tests to work. Will open a follow up PR that changes version to ^1.3.1 as soon as it's released.
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via:
npm install @grafana/create-plugin@4.11.2-canary.941.a7ef49a.0 npm install @grafana/plugin-e2e@1.3.1-canary.941.a7ef49a.0 # or yarn add @grafana/create-plugin@4.11.2-canary.941.a7ef49a.0 yarn add @grafana/plugin-e2e@1.3.1-canary.941.a7ef49a.0