Skip to content

Commit

Permalink
More WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
adamyeats committed Oct 19, 2023
1 parent ba6e3a6 commit 0375d88
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 22 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Install Mage
uses: magefile/mage-action@v3
with:
install-only: true

- name: Install yarn dependencies
run: yarn install
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Build
run: go build -v ./...
run: mage -v

- name: Build Frontend
run: yarn build
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/k6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node.js
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Install Mage
uses: magefile/mage-action@v3
with:
install-only: true

- name: Install yarn dependencies
run: yarn install
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Build
run: go build -v ./...
run: mage -v

- name: Build Frontend
run: yarn build
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Install Mage
uses: magefile/mage-action@v3
with:
install-only: true

- name: Install yarn dependencies
run: yarn install
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Build
run: go build -v ./...
run: mage -v

- name: Build Frontend
run: yarn build
Expand All @@ -32,6 +37,9 @@ jobs:
- name: Start Grafana
run: docker run --rm -d -p 3000:3000 --name=grafana --env GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=grafana-azure-data-explorer-datasource --volume "$PWD/dist:/var/lib/grafana/plugins/grafana-azure-data-explorer-datasource" grafana/grafana; sleep 30

- name: Display plugin directory
run: ls -la dist

- name: Run Playwright tests
run: yarn playwright test
env:
Expand All @@ -46,3 +54,10 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 30

- uses: actions/upload-artifact@v3
if: always()
with:
name: screenshots
path: screenshots/
retention-days: 1
2 changes: 1 addition & 1 deletion e2e/k6/k6.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export async function addDatasource(page) {
// checks the page for the data source is working message
check(page, {
'add datasource successful':
(await page.locator('div[data-testid="data-testid Alert success"]').textContent()) === 'Success',
(await page.locator('[aria-label="Data source settings page Alert"]').textContent()) === 'Success',
});
} catch (e) {
fail(`add datasource failed: ${e}`);
Expand Down
22 changes: 12 additions & 10 deletions e2e/playwright/playwright.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ async function addDatasource(page: Page) {
const saveBtn = page.locator(`button[data-testid="data-testid ${selectors.pages.DataSource.saveAndTest}"]`);
await saveBtn.click();

await page.screenshot({ path: `screenshots/${DATASOURCE_NAME}.png` });

// checks the page for the data source is working message
await expect(page.locator(`[aria-label="Data source settings page Alert"]`)).toContainText(
'Success'
);
await expect(page.locator(`[aria-label="Data source settings page Alert"]`)).toContainText('Success');
}

async function addDashboard(page: Page) {
Expand Down Expand Up @@ -105,37 +105,39 @@ async function configurePanel(page: Page) {
await addPanelButton.click();

// select data source for panel
const dsPanel = page.locator('input[placeholder="Select data source"]')
const dsPanel = page.locator('input[placeholder="Search data source"]');
await dsPanel.fill(`${DATASOURCE_NAME}`);
await page.keyboard.down('Tab');
await page.keyboard.down('Enter');

// select database
const database = page.locator(`[aria-label="Database"]`);
await database.click();
await database.click({ force: true });
await database.fill('PerfTest');
await page.keyboard.down('Enter');

// select table
const table = page.locator(`[aria-label="Table"]`);
await table.click();
await table.click({ force: true });
await table.fill('PerfTest');
await page.keyboard.down('Enter');

// run query
const runQueryBtn = page.locator(`[data-testid="data-testid run-query"]`);
await runQueryBtn.click();
await runQueryBtn.click({ force: true });

// are there results?
const columns = page.locator(`[aria-label="Columns"]`);
await columns.click();
await columns.click({ force: true });

await page.waitForTimeout(6000);

const html = await page.locator('[aria-label="Select options menu"]').innerHTML();
await expect(html).toContain('_val1_');

// save panel
const savePanelBtn = page.locator(`button[title="Apply changes and save dashboard"]`);
await savePanelBtn.click();

// save dashboard
const saveDashButton = page.locator('button[aria-label="Save dashboard button"]');
await saveDashButton.click();
}
Expand Down
31 changes: 24 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5657,11 +5657,6 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
shebang-command "^2.0.0"
which "^2.0.1"

crypt@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==

crypto-random-string@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-4.0.0.tgz#5a3cc53d7dd86183df5da0312816ceeeb5bb1fc2"
Expand Down Expand Up @@ -7473,7 +7468,7 @@ form-data@~2.3.2:
combined-stream "^1.0.6"
mime-types "^2.1.12"

fs-extra@^10.0.0, fs-extra@^10.1.0:
fs-extra@^10.0.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
Expand Down Expand Up @@ -7502,11 +7497,16 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==

fsevents@2.3.2, fsevents@^2.3.2, fsevents@~2.3.2:
fsevents@2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==

fsevents@^2.3.2, fsevents@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==

function-bind@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
Expand Down Expand Up @@ -7714,6 +7714,16 @@ glob@^7.1.3, glob@^7.1.4:
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^9.2.0:
version "9.3.5"
resolved "https://registry.yarnpkg.com/glob/-/glob-9.3.5.tgz#ca2ed8ca452781a3009685607fdf025a899dfe21"
integrity sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==
dependencies:
fs.realpath "^1.0.0"
minimatch "^8.0.2"
minipass "^4.2.4"
path-scurry "^1.6.1"

global-dirs@^3.0.0, global-dirs@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.1.tgz#0c488971f066baceda21447aecb1a8b911d22485"
Expand Down Expand Up @@ -9504,6 +9514,13 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
dependencies:
brace-expansion "^1.1.7"

minimatch@^8.0.2:
version "8.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-8.0.4.tgz#847c1b25c014d4e9a7f68aaf63dedd668a626229"
integrity sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==
dependencies:
brace-expansion "^2.0.1"

minimatch@^9.0.1:
version "9.0.3"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825"
Expand Down

0 comments on commit 0375d88

Please sign in to comment.