E2E: Run playwright cloud plugins tests as part of github actions (#109055)

* add github workflow scaffolding

* update comments

* Add image and resource commands

* Add secrets paths

* Block workflow run for forks

* ignore via package.json, update CODEOWNERS

* fix workflow path

* remove old azure monitor test

* pull docker image first

* add permissions for docker pull step

* checkout first

* keep creds file

* try all in one job

* with creds...

* add cloud: 'azure'

* pass CLOUD to docker

* add -playwright

* actually use the env vars

* don't need to pass CLOUD env var

* remove commented out code and tidy up

* kick CI

* Update container names and set PLAYWRIGHT_CI

* Update path

* fix zizmor violation

* use bigger runner, add double quoting

* add separate command and increase timeout

* remove timeout

* parameterise the e2e command in CI

* move cloud-plugins-e2e-tests into normal e2e test workflow

* fix detect changes

* pass creds into dagger

* try remove quotes

* add a debug log

* exec playwright command after mounting file

* reassign e2eContainer, add change to check the tests fail correctly

* fix test

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
This commit is contained in:
Ashley Harrison
2025-08-19 09:25:16 +01:00
committed by GitHub
parent 1e6719f571
commit 0687017595
8 changed files with 125 additions and 376 deletions
@@ -4,12 +4,12 @@ import { Page } from 'playwright-core';
import { v4 as uuidv4 } from 'uuid';
import {
test,
expect,
CreateDataSourcePageArgs,
DashboardPage,
DataSourceConfigPage,
E2ESelectorGroups,
DashboardPage,
expect,
test,
} from '@grafana/plugin-e2e';
import { AzureQueryType } from '../../public/app/plugins/datasource/azuremonitor/dataquery.gen';
@@ -71,8 +71,7 @@ async function provisionAzureMonitorDatasources(
await configPage.saveAndTest();
}
// TODO unskip when we've figured out how to populate the credentials in CI
test.describe.skip(
test.describe(
'Azure Monitor datasource',
{
tag: ['@cloud-plugins'],
@@ -84,7 +83,7 @@ test.describe.skip(
// Check if we're running in CI
const CI = process.env.CI;
if (CI) {
const outputs = JSON.parse(readFileSync('outputs.json', 'utf8'));
const outputs = JSON.parse(readFileSync('/tmp/outputs.json', 'utf8'));
datasourceConfig = {
jsonData: {
cloudName: 'Azure',
@@ -134,6 +133,7 @@ test.describe.skip(
await expect(page.getByText(rootSubscription)).toBeVisible({ timeout: 30000 });
const resourceSearchInput = page.getByTestId(azMonSelectors.components.queryEditor.resourcePicker.search.input);
await resourceSearchInput.fill(storageAcctName);
await resourceSearchInput.press('Enter');
await expect(page.getByText(storageAcctName)).toBeVisible({ timeout: 30000 });
await page.getByText(storageAcctName).click();
const applyButton = page.getByTestId(azMonSelectors.components.queryEditor.resourcePicker.apply.button);
@@ -164,6 +164,7 @@ test.describe.skip(
await resourcePickerButton.click();
await expect(page.getByText(rootSubscription)).toBeVisible({ timeout: 30000 });
await resourceSearchInput.fill(logAnalyticsName);
await resourceSearchInput.press('Enter');
await expect(page.getByText(logAnalyticsName)).toBeVisible({ timeout: 30000 });
await page.getByText(logAnalyticsName).click();
await applyButton.click();
@@ -220,6 +221,7 @@ test.describe.skip(
await resourcePickerButton.click();
await expect(page.getByText(rootSubscription)).toBeVisible({ timeout: 30000 });
await resourceSearchInput.fill(applicationInsightsName);
await resourceSearchInput.press('Enter');
await expect(page.getByText(applicationInsightsName)).toBeVisible({ timeout: 30000 });
await page.getByText(applicationInsightsName).click();
await applyButton.click();