From c931102d122592d052f481ef300606efc522c26e Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Mon, 31 Jan 2022 14:01:34 -0800 Subject: [PATCH] First storage service test --- .github/workflows/benchmark.yml | 14 ++-- .github/workflows/ci.yml | 77 +++++++++++++++++++ ts/components/ConversationList.tsx | 1 + .../conversationList/ConversationListItem.tsx | 1 + 4 files changed, 86 insertions(+), 7 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index e70fd5e919..764265dc05 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -38,7 +38,7 @@ jobs: with: node-version: '16.9.1' - name: Install global dependencies - run: npm install -g yarn@1.22.10 typescript@4.4.2 ts-node@10.2.1 + run: npm install -g yarn@1.22.10 - name: Install xvfb run: sudo apt-get install xvfb @@ -78,7 +78,7 @@ jobs: run: | set -o pipefail rm -rf /tmp/mock - xvfb-run --auto-servernum ts-node Mock-Server/scripts/load-test.ts \ + xvfb-run --auto-servernum node Mock-Server/scripts/load-test.js \ ./node_modules/.bin/electron . | tee benchmark-startup.log || \ (cat /tmp/mock/logs/{app,main}.log && exit 1) timeout-minutes: 10 @@ -91,7 +91,7 @@ jobs: run: | set -o pipefail rm -rf /tmp/mock - xvfb-run --auto-servernum ts-node Mock-Server/scripts/send-test.ts \ + xvfb-run --auto-servernum node Mock-Server/scripts/send-test.js \ ./node_modules/.bin/electron . | tee benchmark-send.log || \ (cat /tmp/mock/logs/{app,main}.log && exit 1) timeout-minutes: 10 @@ -104,8 +104,8 @@ jobs: run: | set -o pipefail rm -rf /tmp/mock - xvfb-run --auto-servernum ts-node \ - Mock-Server/scripts/group-send-test.ts \ + xvfb-run --auto-servernum node \ + Mock-Server/scripts/group-send-test.js \ ./node_modules/.bin/electron . | tee benchmark-group-send.log || \ (cat /tmp/mock/logs/{app,main}.log && exit 1) timeout-minutes: 10 @@ -118,8 +118,8 @@ jobs: run: | set -o pipefail rm -rf /tmp/mock - xvfb-run --auto-servernum ts-node \ - Mock-Server/scripts/convo-open-test.ts \ + xvfb-run --auto-servernum node \ + Mock-Server/scripts/convo-open-test.js \ ./node_modules/.bin/electron . | tee benchmark-convo-open.log || \ (cat /tmp/mock/logs/{app,main}.log && exit 1) timeout-minutes: 10 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54367770c6..5033738dd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,3 +149,80 @@ jobs: - run: yarn test-release env: SIGNAL_ENV: production + + storage-service: + needs: lint + runs-on: ubuntu-latest + if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' }} + + steps: + - name: Get system specs + run: lsb_release -a + - name: Get other system specs + run: uname -a + + - name: Configure git to use HTTPS + run: git config --global url."https://${{ secrets.AUTOMATED_GITHUB_PAT }}:x-oauth-basic@github.com".insteadOf ssh://git@github.com + + - name: Clone Desktop repo + uses: actions/checkout@v2 + - name: Clone Mock-Server repo + uses: actions/checkout@v2 + with: + repository: 'signalapp/Mock-Signal-Server-Private' + path: 'Mock-Server' + ref: 'gamma' + token: ${{ secrets.AUTOMATED_GITHUB_PAT }} + + - name: Setup node.js + uses: actions/setup-node@v2 + with: + node-version: '16.9.1' + - name: Install global dependencies + run: npm install -g yarn@1.22.10 + + - name: Install xvfb + run: sudo apt-get install xvfb + + - name: Cache Desktop node_modules + id: cache-desktop-modules + uses: actions/cache@v2 + with: + path: node_modules + key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }} + + - name: Install Desktop node_modules + if: steps.cache-desktop-modules.outputs.cache-hit != 'true' + run: yarn install --frozen-lockfile + + - name: Install Mock-Server node_modules + run: yarn install --frozen-lockfile + working-directory: Mock-Server + env: + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 + + - name: Build typescript + run: yarn generate + - name: Bundle + run: yarn build:webpack + + - name: Copy CI configuration + run: | + cp -rf ./Mock-Server/config/local-development.json \ + ./config/local-development.json + cp -rf ./config/local-development.json ./config/local-production.json + + - name: Setup hosts + run: sudo echo "127.0.0.1 mock.signal.org" | sudo tee -a /etc/hosts + + - name: Run storage service tests + run: | + set -o pipefail + rm -rf /tmp/mock + xvfb-run --auto-servernum node Mock-Server/scripts/storage-service-test.js \ + ./node_modules/.bin/electron . || \ + (cat /tmp/mock/logs/{app,main}.log && exit 1) + timeout-minutes: 10 + env: + NODE_ENV: production + DEBUG: mock:scripts:* diff --git a/ts/components/ConversationList.tsx b/ts/components/ConversationList.tsx index a85d87ddce..f98aa29fae 100644 --- a/ts/components/ConversationList.tsx +++ b/ts/components/ConversationList.tsx @@ -261,6 +261,7 @@ export const ConversationList: React.FC = ({ 'id', 'isMe', 'isSelected', + 'isPinned', 'lastMessage', 'lastUpdated', 'markedUnread', diff --git a/ts/components/conversationList/ConversationListItem.tsx b/ts/components/conversationList/ConversationListItem.tsx index 464d63e29e..5d8f2560cf 100644 --- a/ts/components/conversationList/ConversationListItem.tsx +++ b/ts/components/conversationList/ConversationListItem.tsx @@ -42,6 +42,7 @@ export type PropsData = Pick< | 'draftPreview' | 'id' | 'isMe' + // NOTE: Passed for CI, not used for rendering | 'isPinned' | 'isSelected' | 'lastMessage'