Log chain check outputs (#5473)

* Log chain check outputs

* readability line re-add
This commit is contained in:
Jaco 2021-06-07 08:20:27 +03:00 committed by GitHub
parent 308965bce7
commit e482401223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -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:

View File

@ -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 {