Skip to content

Commit

Permalink
feat: improve flashing speed (#88)
Browse files Browse the repository at this point in the history
* feat: no DFU wait

* fix: checkout before running preview-web

* fix: e2e tests
  • Loading branch information
raphaelcoeffic authored Aug 25, 2024
1 parent 21b749c commit ff0859b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 5 additions & 3 deletions e2e/pages/firmware-wizard/firmware-selection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
}
});
9 changes: 6 additions & 3 deletions src/shared/dfu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ff0859b

Please sign in to comment.