From ac353a47ba3dad8d457540373a67704cbe131889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Wed, 18 Oct 2023 13:48:14 +0200 Subject: [PATCH] chore: re-enable flaky tests (#2591) * chore: re-enable flaky tests * chore: re-enable vault tests in ci * chore: add missing dep * chore: fix building web on PR * chore: add sleep to allow deleting account to propagate --- .github/workflows/publish.yml | 36 ++++++++++---------- .github/workflows/snjs.pr.yml | 36 ++++++++++---------- packages/clipper/package.json | 3 +- packages/snjs/mocha/vaults/surviving.test.js | 4 ++- yarn.lock | 3 +- 5 files changed, 43 insertions(+), 39 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 63a777f6933..dcf0c993d60 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -84,24 +84,24 @@ jobs: trigger_workflow: true wait_workflow: true - # e2e-vaults: - # name: E2E Vaults Test Suite - # needs: build-docker - # runs-on: ubuntu-latest - # steps: - # - name: Run E2E vaults test suite - # if: "${{ contains(github.event.head_commit.message, 'skip e2e') == false }}" - # uses: convictional/trigger-workflow-and-wait@master - # with: - # owner: standardnotes - # repo: server - # github_token: ${{ secrets.CI_PAT_TOKEN }} - # workflow_file_name: e2e-test-suite.yml - # wait_interval: 30 - # client_payload: '{"snjs_image_tag": "${{ github.sha }}", "suite": "vaults", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}' - # propagate_failure: true - # trigger_workflow: true - # wait_workflow: true + e2e-vaults: + name: E2E Vaults Test Suite + needs: build-docker + runs-on: ubuntu-latest + steps: + - name: Run E2E vaults test suite + if: "${{ contains(github.event.head_commit.message, 'skip e2e') == false }}" + uses: convictional/trigger-workflow-and-wait@master + with: + owner: standardnotes + repo: server + github_token: ${{ secrets.CI_PAT_TOKEN }} + workflow_file_name: e2e-test-suite.yml + wait_interval: 30 + client_payload: '{"snjs_image_tag": "${{ github.sha }}", "suite": "vaults", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}' + propagate_failure: true + trigger_workflow: true + wait_workflow: true publish: name: Publish to NPM diff --git a/.github/workflows/snjs.pr.yml b/.github/workflows/snjs.pr.yml index fe22650050b..86072bd3118 100644 --- a/.github/workflows/snjs.pr.yml +++ b/.github/workflows/snjs.pr.yml @@ -37,7 +37,7 @@ jobs: - name: Install dependencies run: yarn install --immutable - name: Build - run: yarn build:snjs + run: yarn build:web - name: ESLint run: yarn lint - name: Test @@ -91,20 +91,20 @@ jobs: trigger_workflow: true wait_workflow: true - # e2e-vaults: - # name: E2E Vaults Test Suite - # needs: build-docker - # runs-on: ubuntu-latest - # steps: - # - name: Run E2E vaults test suite - # uses: convictional/trigger-workflow-and-wait@master - # with: - # owner: standardnotes - # repo: server - # github_token: ${{ secrets.CI_PAT_TOKEN }} - # workflow_file_name: e2e-test-suite.yml - # wait_interval: 30 - # client_payload: '{"snjs_image_tag": "${{ github.sha }}", "suite": "vaults", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}' - # propagate_failure: true - # trigger_workflow: true - # wait_workflow: true + e2e-vaults: + name: E2E Vaults Test Suite + needs: build-docker + runs-on: ubuntu-latest + steps: + - name: Run E2E vaults test suite + uses: convictional/trigger-workflow-and-wait@master + with: + owner: standardnotes + repo: server + github_token: ${{ secrets.CI_PAT_TOKEN }} + workflow_file_name: e2e-test-suite.yml + wait_interval: 30 + client_payload: '{"snjs_image_tag": "${{ github.sha }}", "suite": "vaults", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}' + propagate_failure: true + trigger_workflow: true + wait_workflow: true diff --git a/packages/clipper/package.json b/packages/clipper/package.json index 1829ef9feff..f6dc25795d7 100644 --- a/packages/clipper/package.json +++ b/packages/clipper/package.json @@ -32,6 +32,7 @@ "webpack": "*" }, "dependencies": { - "@mozilla/readability": "^0.4.2" + "@mozilla/readability": "^0.4.2", + "@standardnotes/snjs": "workspace:^" } } diff --git a/packages/snjs/mocha/vaults/surviving.test.js b/packages/snjs/mocha/vaults/surviving.test.js index 31be7ee00e3..1061f616c51 100644 --- a/packages/snjs/mocha/vaults/surviving.test.js +++ b/packages/snjs/mocha/vaults/surviving.test.js @@ -5,7 +5,7 @@ import * as Collaboration from '../lib/Collaboration.js' chai.use(chaiAsPromised) const expect = chai.expect -describe.skip('designated survival', function () { +describe('designated survival', function () { this.timeout(Factory.ThirtySecondTimeout) let context @@ -337,6 +337,8 @@ describe.skip('designated survival', function () { Factory.handlePasswordChallenges(context.application, context.password) await context.application.user.deleteAccount() + await Factory.sleep(2) + await secondContext.syncAndAwaitNotificationsProcessing() await thirdContext.syncAndAwaitNotificationsProcessing() diff --git a/yarn.lock b/yarn.lock index 5f3c20e984b..bba213df39a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4232,6 +4232,7 @@ __metadata: resolution: "@standardnotes/clipper@workspace:packages/clipper" dependencies: "@mozilla/readability": ^0.4.2 + "@standardnotes/snjs": "workspace:^" "@standardnotes/web": "workspace:*" "@types/webextension-polyfill": ^0.10.0 babel-loader: ^9.1.0 @@ -4823,7 +4824,7 @@ __metadata: languageName: unknown linkType: soft -"@standardnotes/snjs@^2.41.1, @standardnotes/snjs@workspace:*, @standardnotes/snjs@workspace:packages/snjs": +"@standardnotes/snjs@^2.41.1, @standardnotes/snjs@workspace:*, @standardnotes/snjs@workspace:^, @standardnotes/snjs@workspace:packages/snjs": version: 0.0.0-use.local resolution: "@standardnotes/snjs@workspace:packages/snjs" dependencies: