From 0319d9c7f0a4aef48a3f6a555aeaa0152a111ee2 Mon Sep 17 00:00:00 2001 From: yivlad Date: Fri, 25 Aug 2023 15:58:30 +0200 Subject: [PATCH] Revert "Debug CI" --- .github/workflows/CI.yml | 159 +++++++++--------- packages/core/src/hooks/useCall.test.tsx | 9 +- .../blockNumber/common/subscribeToNewBlock.ts | 5 +- 3 files changed, 82 insertions(+), 91 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5e3d29bc7..32b142298 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,85 +19,84 @@ jobs: node-version: ${{ matrix.node }} - run: npm i -g pnpm@7.1.9 - run: pnpm install --frozen-lockfile --strict-peer-dependencies - # - run: pnpm run lint + - run: pnpm run lint - run: pnpm run build - run: pnpm run test - working-directory: packages/core - # test-example: - # runs-on: ubuntu-latest - # timeout-minutes: 25 - # steps: - # - uses: actions/checkout@v2 - # - name: Use Node.js - # uses: actions/setup-node@v1 - # with: - # node-version: '16.x' - # - run: npm i -g pnpm@7.1.9 - # - run: pnpm install --frozen-lockfile --strict-peer-dependencies - # - name: Build dependencies - # run: | - # set -e - # pnpm run build - # working-directory: packages - # - name: Run playwright example - # run: | - # set -e - # LOCALHOST_URL='http://localhost:8545' pnpm start & - # xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm test:playwright - # env: - # MAINNET_URL: ${{ secrets.MAINNET_PROVIDER_URL }} - # DEBUG: usedapp* - # working-directory: packages/example - # - name: Run playwright example-next - # run: | - # set -e - # echo "NEXT_PUBLIC_LOCALHOST_URL=http://localhost:8545" > .env.local - # echo "NEXT_PUBLIC_MAINNET_URL=${MAINNET_URL}" >> .env.local - # pnpm dev & - # xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm test:playwright - # env: - # MAINNET_URL: ${{ secrets.MAINNET_PROVIDER_URL }} - # DEBUG: usedapp* - # working-directory: packages/example-next - # - name: Cleanup - # if: always() - # run: | - # rm -rf .env.local - # working-directory: packages/example-next - # test-docs: - # runs-on: ubuntu-latest - # timeout-minutes: 25 - # steps: - # - uses: actions/checkout@v2 - # - name: Use Node.js - # uses: actions/setup-node@v1 - # with: - # node-version: '16.x' - # - run: npm i -g pnpm@7.1.9 - # - run: pnpm install --frozen-lockfile --strict-peer-dependencies - # - name: Build dependencies - # run: pnpm run build - # working-directory: packages - # - name: Run playwright - # run: | - # set -e - # pnpm run generate - # pnpm start & - # sleep 15 - # xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm test:playwright - # env: - # MAINNET_URL: ${{ secrets.MAINNET_PROVIDER_URL }} - # DEBUG: usedapp* - # working-directory: packages/docs - # check-mixed-changesets: - # timeout-minutes: 5 - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - name: Use Node.js - # uses: actions/setup-node@v1 - # with: - # node-version: '16.x' - # - run: npm i -g pnpm@7.1.9 - # - run: pnpm install --frozen-lockfile --filter="usedapp" - # - run: pnpm changeset version + test-example: + runs-on: ubuntu-latest + timeout-minutes: 25 + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '16.x' + - run: npm i -g pnpm@7.1.9 + - run: pnpm install --frozen-lockfile --strict-peer-dependencies + - name: Build dependencies + run: | + set -e + pnpm run build + working-directory: packages + - name: Run playwright example + run: | + set -e + LOCALHOST_URL='http://localhost:8545' pnpm start & + xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm test:playwright + env: + MAINNET_URL: ${{ secrets.MAINNET_PROVIDER_URL }} + DEBUG: usedapp* + working-directory: packages/example + - name: Run playwright example-next + run: | + set -e + echo "NEXT_PUBLIC_LOCALHOST_URL=http://localhost:8545" > .env.local + echo "NEXT_PUBLIC_MAINNET_URL=${MAINNET_URL}" >> .env.local + pnpm dev & + xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm test:playwright + env: + MAINNET_URL: ${{ secrets.MAINNET_PROVIDER_URL }} + DEBUG: usedapp* + working-directory: packages/example-next + - name: Cleanup + if: always() + run: | + rm -rf .env.local + working-directory: packages/example-next + test-docs: + runs-on: ubuntu-latest + timeout-minutes: 25 + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '16.x' + - run: npm i -g pnpm@7.1.9 + - run: pnpm install --frozen-lockfile --strict-peer-dependencies + - name: Build dependencies + run: pnpm run build + working-directory: packages + - name: Run playwright + run: | + set -e + pnpm run generate + pnpm start & + sleep 15 + xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm test:playwright + env: + MAINNET_URL: ${{ secrets.MAINNET_PROVIDER_URL }} + DEBUG: usedapp* + working-directory: packages/docs + check-mixed-changesets: + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '16.x' + - run: npm i -g pnpm@7.1.9 + - run: pnpm install --frozen-lockfile --filter="usedapp" + - run: pnpm changeset version diff --git a/packages/core/src/hooks/useCall.test.tsx b/packages/core/src/hooks/useCall.test.tsx index c457203e2..62fc58b63 100644 --- a/packages/core/src/hooks/useCall.test.tsx +++ b/packages/core/src/hooks/useCall.test.tsx @@ -282,7 +282,7 @@ describe('useCall', () => { }) }) - it.only('Properly handles refresh per block', async () => { + it('Properly handles refresh per block', async () => { const { config, network1 } = await setupTestingConfig({ multicallVersion }) const blockNumberContract = await deployContract(network1.deployer, BlockNumberContract) const secondBlockNumberContract = await deployContract(network1.deployer, BlockNumberContract) @@ -306,10 +306,6 @@ describe('useCall', () => { } ) - console.log({ - block1, - block2, - }) return { block1, block2 } }, { @@ -341,13 +337,12 @@ describe('useCall', () => { await network1.provider.mine() } - await waitForExpect(async () => { + await waitForExpect(() => { expect(getResultProperty(result, 'block1')).to.eq(blockNumber + 5) const block2 = Number(getResultProperty(result, 'block2')) // we don't actually know when the update is gonna happen - both possibilities are possible expect(block2 === blockNumber + 4 || block2 === blockNumber + 5).to.be.true }) - console.log('357') }) it('Refreshes static call on parameter change', async () => { diff --git a/packages/core/src/providers/blockNumber/common/subscribeToNewBlock.ts b/packages/core/src/providers/blockNumber/common/subscribeToNewBlock.ts index 5cb04bbf8..d0dd227a2 100644 --- a/packages/core/src/providers/blockNumber/common/subscribeToNewBlock.ts +++ b/packages/core/src/providers/blockNumber/common/subscribeToNewBlock.ts @@ -14,10 +14,7 @@ export async function subscribeToNewBlock( await provider.on('block', update) provider.getBlockNumber().then( - (blockNumber) => { - console.log('new block', blockNumber) - update(blockNumber) - }, + (blockNumber) => update(blockNumber), (err) => { console.error(err) }