From ff0859b01fb477e965b61203a313a5e266834d09 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sun, 25 Aug 2024 05:48:55 +0200 Subject: [PATCH] feat: improve flashing speed (#88) * feat: no DFU wait * fix: checkout before running preview-web * fix: e2e tests --- .github/workflows/pipeline.yml | 2 ++ e2e/pages/firmware-wizard/firmware-selection.spec.ts | 8 +++++--- src/shared/dfu/index.ts | 9 ++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 0186728..41f3ed5 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -325,6 +325,8 @@ jobs: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Fetch compiled source uses: actions/download-artifact@v4 with: diff --git a/e2e/pages/firmware-wizard/firmware-selection.spec.ts b/e2e/pages/firmware-wizard/firmware-selection.spec.ts index 07ae3b4..6f54b39 100644 --- a/e2e/pages/firmware-wizard/firmware-selection.spec.ts +++ b/e2e/pages/firmware-wizard/firmware-selection.spec.ts @@ -160,7 +160,9 @@ test("Copy URL button copies a link to the selected firmware", async ({ test.skip(browserName !== "chromium"); await (await queries.findByLabelText("Firmware version")).press("Enter"); await page - .locator(".ant-select-item-option[title='EdgeTX \"Santa\" v2.6.0']") + .locator( + ".ant-select-item-option[title='EdgeTX \"Flying Dutchman\" v2.8.5']" + ) .click(); const radioSelector = await queries.findByLabelText("Radio model"); @@ -181,9 +183,9 @@ test("Copy URL button copies a link to the selected firmware", async ({ if (isElectron) { expect(copiedUrl).toBe( - "buddy.edgetx.org/#/flash?version=v2.6.0&target=x10" + "buddy.edgetx.org/#/flash?version=v2.8.5&target=x10" ); } else { - expect(copiedUrl).toBe("localhost:8081/#/flash?version=v2.6.0&target=x10"); + expect(copiedUrl).toBe("localhost:8081/#/flash?version=v2.8.5&target=x10"); } }); diff --git a/src/shared/dfu/index.ts b/src/shared/dfu/index.ts index 364c378..a6a938b 100644 --- a/src/shared/dfu/index.ts +++ b/src/shared/dfu/index.ts @@ -635,9 +635,12 @@ export class WebDFU { (ignoreErrors || dfuStatus.state !== dfuCommands.dfuERROR) ) { // eslint-disable-next-line no-await-in-loop - await asyncSleep(dfuStatus.pollTimeout); - // eslint-disable-next-line no-await-in-loop - dfuStatus = await this.getStatus(); + await asyncSleep(0); + try { + // eslint-disable-next-line no-await-in-loop + dfuStatus = await this.getStatus(); + // eslint-disable-next-line no-empty + } catch (error) {} } return dfuStatus;