From e482401223f51f7e7c15d50b600ebefecbabae97 Mon Sep 17 00:00:00 2001 From: Jaco Date: Mon, 7 Jun 2021 08:20:27 +0300 Subject: [PATCH] Log chain check outputs (#5473) * Log chain check outputs * readability line re-add --- .github/chain-types.md | 2 +- packages/apps-config/src/ciChainTypes.spec.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/chain-types.md b/.github/chain-types.md index 0ddb642102..005fb84680 100644 --- a/.github/chain-types.md +++ b/.github/chain-types.md @@ -7,4 +7,4 @@ cc @polkadot-js/notifications Some configured chains have outdated types and is determined to problematic as an available chain. -Check the nightly cron output (or via `yarn ci:chainTypes` locally) and disable the chains until the issue is resolved. The output as found from the test includes: +Check the nightly cron output (or via `yarn ci:chainTypes` locally) and disable the chains (either with `isDisabled` or `isUnreachable`) until the issue is resolved. The output as found from the test includes: diff --git a/packages/apps-config/src/ciChainTypes.spec.ts b/packages/apps-config/src/ciChainTypes.spec.ts index 79fff120d0..b52e40e79e 100644 --- a/packages/apps-config/src/ciChainTypes.spec.ts +++ b/packages/apps-config/src/ciChainTypes.spec.ts @@ -1,6 +1,8 @@ // Copyright 2017-2021 @polkadot/apps-config authors & contributors // SPDX-License-Identifier: Apache-2.0 +import fs from 'fs'; + import { ApiPromise, WsProvider } from '@polkadot/api'; import { assert, isError, isString } from '@polkadot/util'; import { fetch } from '@polkadot/x-fetch'; @@ -24,6 +26,8 @@ const FAILURES: string[] = [ 'Timeout connecting to' ]; +const TICK = '`'; + const endpoints = createWsEndpoints((k: string, v?: string) => v || k, true) .filter(({ isDisabled, isUnreachable, value }) => !isDisabled && !isUnreachable && value && isString(value) && !value.startsWith('ws://') @@ -71,6 +75,8 @@ describe('--SLOW--: check configured chain connections', (): void => { ]); } catch (error) { if (isError(error) && FAILURES.some((f) => (error as Error).message.includes(f))) { + process.env.CI_LOG && fs.appendFileSync('./.github/chain-types.md', `\n${TICK}${ws.padStart(52, ' ')}: ${error.message}${TICK}`); + throw error; } } finally {