mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
adapt tests after switch to parallel runs (#547)
Some browser tests are now run in parallel. A few tests have become unreliable, and need a little love. Also, create and save mocha webdriver logs.
This commit is contained in:
parent
71bff10566
commit
01069a69b0
18
.github/workflows/main.yml
vendored
18
.github/workflows/main.yml
vendored
@ -98,10 +98,28 @@ jobs:
|
|||||||
- name: Run main tests without minio and redis
|
- name: Run main tests without minio and redis
|
||||||
if: contains(matrix.tests, ':nbrowser-')
|
if: contains(matrix.tests, ':nbrowser-')
|
||||||
run: |
|
run: |
|
||||||
|
mkdir -p $MOCHA_WEBDRIVER_LOGDIR
|
||||||
export GREP_TESTS=$(echo $TESTS | sed "s/.*:nbrowser-\([^:]*\).*/\1/")
|
export GREP_TESTS=$(echo $TESTS | sed "s/.*:nbrowser-\([^:]*\).*/\1/")
|
||||||
MOCHA_WEBDRIVER_SKIP_CLEANUP=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:nbrowser --parallel --jobs 3
|
MOCHA_WEBDRIVER_SKIP_CLEANUP=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:nbrowser --parallel --jobs 3
|
||||||
env:
|
env:
|
||||||
TESTS: ${{ matrix.tests }}
|
TESTS: ${{ matrix.tests }}
|
||||||
|
MOCHA_WEBDRIVER_LOGDIR: ${{ runner.temp }}/mocha-webdriver-logs
|
||||||
|
|
||||||
|
- name: Prepare a safe artifact name
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
ARTIFACT_NAME=logs-$(echo $TESTS | sed 's/[^-a-zA-Z0-9]/_/g')
|
||||||
|
echo "Artifact name is '$ARTIFACT_NAME'"
|
||||||
|
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
|
||||||
|
env:
|
||||||
|
TESTS: ${{ matrix.tests }}
|
||||||
|
|
||||||
|
- name: Save artifacts on failure
|
||||||
|
if: failure()
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.ARTIFACT_NAME }}
|
||||||
|
path: ${{ runner.temp }}/mocha-webdriver-logs # only exists for webdriver tests
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# https://github.com/bitnami/bitnami-docker-minio/issues/16
|
# https://github.com/bitnami/bitnami-docker-minio/issues/16
|
||||||
|
@ -7,7 +7,6 @@ describe('ColumnOps.ntest', function() {
|
|||||||
const cleanup = test.setupTestSuite(this);
|
const cleanup = test.setupTestSuite(this);
|
||||||
|
|
||||||
before(async function() {
|
before(async function() {
|
||||||
this.timeout(Math.max(this.timeout(), 30000)); // Long-running test, unfortunately
|
|
||||||
await gu.supportOldTimeyTestCode();
|
await gu.supportOldTimeyTestCode();
|
||||||
await gu.useFixtureDoc(cleanup, "World.grist", true);
|
await gu.useFixtureDoc(cleanup, "World.grist", true);
|
||||||
await gu.toggleSidePanel('left', 'close');
|
await gu.toggleSidePanel('left', 'close');
|
||||||
|
@ -223,10 +223,10 @@ describe('CustomWidgetsConfig', function () {
|
|||||||
constructor(public frameSelector = 'iframe') {}
|
constructor(public frameSelector = 'iframe') {}
|
||||||
// Wait for a frame.
|
// Wait for a frame.
|
||||||
public async waitForFrame() {
|
public async waitForFrame() {
|
||||||
await driver.wait(() => driver.find(this.frameSelector).isPresent(), 1000);
|
await driver.wait(() => driver.find(this.frameSelector).isPresent(), 3000);
|
||||||
const iframe = driver.find(this.frameSelector);
|
const iframe = driver.find(this.frameSelector);
|
||||||
await driver.switchTo().frame(iframe);
|
await driver.switchTo().frame(iframe);
|
||||||
await driver.wait(async () => (await driver.find('#ready').getText()) === 'ready', 1000);
|
await driver.wait(async () => (await driver.find('#ready').getText()) === 'ready', 3000);
|
||||||
await driver.switchTo().defaultContent();
|
await driver.switchTo().defaultContent();
|
||||||
}
|
}
|
||||||
public async content() {
|
public async content() {
|
||||||
@ -254,7 +254,7 @@ describe('CustomWidgetsConfig', function () {
|
|||||||
}
|
}
|
||||||
// Wait for frame to close.
|
// Wait for frame to close.
|
||||||
public async waitForClose() {
|
public async waitForClose() {
|
||||||
await driver.wait(async () => !(await driver.find(this.frameSelector).isPresent()), 1000);
|
await driver.wait(async () => !(await driver.find(this.frameSelector).isPresent()), 3000);
|
||||||
}
|
}
|
||||||
// Wait for the onOptions event, and return its value.
|
// Wait for the onOptions event, and return its value.
|
||||||
public async onOptions() {
|
public async onOptions() {
|
||||||
@ -262,7 +262,7 @@ describe('CustomWidgetsConfig', function () {
|
|||||||
await driver.switchTo().frame(iframe);
|
await driver.switchTo().frame(iframe);
|
||||||
// Wait for options to get filled, initially this div is empty,
|
// Wait for options to get filled, initially this div is empty,
|
||||||
// as first message it should get at least null as an options.
|
// as first message it should get at least null as an options.
|
||||||
await driver.wait(async () => await driver.find('#onOptions').getText(), 1000);
|
await driver.wait(async () => await driver.find('#onOptions').getText(), 3000);
|
||||||
const text = await driver.find('#onOptions').getText();
|
const text = await driver.find('#onOptions').getText();
|
||||||
await driver.switchTo().defaultContent();
|
await driver.switchTo().defaultContent();
|
||||||
return JSON.parse(text);
|
return JSON.parse(text);
|
||||||
|
@ -53,7 +53,7 @@ async function applyPatchesToJquerylikeObject($) {
|
|||||||
// Adapt common old setup.
|
// Adapt common old setup.
|
||||||
const test = {
|
const test = {
|
||||||
setupTestSuite(self, ...args) {
|
setupTestSuite(self, ...args) {
|
||||||
self.timeout(20000);
|
self.timeout(40000);
|
||||||
return setupTestSuite(...args);
|
return setupTestSuite(...args);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user