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

Plugin E2E: Use api client when creating new datasources #1201

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sunker
Copy link
Contributor

@sunker sunker commented Oct 10, 2024

What this PR does / why we need it:

The createDataSourceConfigPage fixture uses the grafana api to create a new data source. Currently it's calling the grafana api on behalf of the logged in user, which may not have permissions to create data sources.

This PR changes this so that creating data sources in now made on behalf of the grafanaAPICredentials provided in the playwright config. If no credentials have been provided, it will use the default admin:admin so this should not break tests for those who have not specified grafanaAPICredentials.

Which issue(s) this PR fixes:

Fixes #1202

Special notes for your reviewer:

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @grafana/[email protected]
npm install @grafana/[email protected]
# or 
yarn add @grafana/[email protected]
yarn add @grafana/[email protected]

@sunker sunker added patch Increment the patch version when merged release Create a release when this pr is merged labels Oct 10, 2024
Copy link

github-actions bot commented Oct 10, 2024

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged and will trigger a new patch release.
NOTE: When merging a PR with the release label please avoid merging another PR. For further information see here.

await page.goto('/datasources', { waitUntil: 'networkidle' });
expect(await page.title()).toEqual(homePageTitle);
expect(page.url()).not.toContain('datasources');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This and the next test started failing as a consequence of scenes powered dashboards. This is a simple change to cater for that.

@sunker sunker marked this pull request as ready for review October 11, 2024 10:20
@sunker sunker requested a review from a team as a code owner October 11, 2024 10:20
@sunker sunker requested review from academo and mckn and removed request for a team October 11, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged release Create a release when this pr is merged
Projects
Status: 🧑‍💻 In development
Development

Successfully merging this pull request may close these issues.

Bug: New datasources not created on behalf of grafana API Credentials
1 participant