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 669b8de
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 38 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,27 @@ 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 ./...
- name: Build binaries
run: mage -v

- name: Build Frontend
- name: Build frontend
run: yarn build
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- 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:/var/lib/grafana/plugins" grafana/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: Run E2E tests
run: yarn run e2e
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/k6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ 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 ./...
- name: Build binaries
run: mage -v

- name: Build Frontend
- name: Build frontend
run: yarn build
env:
NODE_OPTIONS: '--max_old_space_size=4096'
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@ 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 ./...
- name: Build binaries
run: mage -v

- name: Build Frontend
- name: Build frontend
run: yarn build
env:
NODE_OPTIONS: '--max_old_space_size=4096'
Expand All @@ -46,3 +51,4 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 30

15 changes: 8 additions & 7 deletions cspell.config.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"ignorePaths": [
".github/**",
"node_modules/**",
"dist/**",
"cypress/**",
"provisioning/**",
"src/dashboards/**",
"yarn.lock",
"dist/**",
"e2e/**",
"go.sum",
"mage_output_file.go",
"src/libs/**",
"node_modules/**",
"pkg/azuredx/models/testdata/**",
"pkg/azuredx/testdata/**",
"pkg/azuredx/models/testdata/**"
"provisioning/**",
"src/dashboards/**",
"src/libs/**",
"yarn.lock"
],
"words": [
"adxauth",
Expand Down
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
26 changes: 14 additions & 12 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,39 +105,41 @@ 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();
await savePanelBtn.click({ force: true });

// save dashboard
const saveDashButton = page.locator('button[aria-label="Save dashboard button"]');
await saveDashButton.click();
await saveDashButton.click({ force: true });
}

export async function removeDashboard(page: Page) {
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 669b8de

Please sign in to comment.