-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update PR action to include test coverage #1704
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Coverage report❌ An unexpected error occurred. For more details, check console
Test suite run failedFailed tests: 34/270. Failed suites: 28/70.
Report generated by 🧪jest coverage report action from bc157ae |
stwiname
force-pushed
the
ci-test-coverage
branch
from
October 31, 2023 02:59
935258d
to
7b5dc3d
Compare
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🔴 | Statements | 46.74% | 10929/23385 |
🟡 | Branches | 77.45% | 1051/1357 |
🔴 | Functions | 38.95% | 416/1068 |
🔴 | Lines | 46.74% | 10929/23385 |
Test suite run failed
Failed tests: 26/276. Failed suites: 25/70.
● CLI codegen:generate › Construct correct datasources
TypeError: (0 , common_ethereum_1.parseContractPath) is not a function
186 |
187 | export function constructDatasourcesYaml(userInput: UserInput): EthereumDs {
> 188 | const abiName = parseContractPath(userInput.abiPath).name;
| ^
189 | const formattedHandlers = generateFormattedHandlers(userInput, abiName, (kind) => {
190 | if (kind === 'EthereumHandlerKind.Call') return EthereumHandlerKind.Call;
191 | return EthereumHandlerKind.Event;
at constructDatasourcesYaml (packages/cli/src/controller/generate-controller.ts:188:36)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.spec.ts:136:51)
● CLI codegen:generate › filter out existing methods, input address === undefined && ds address === "", should filter
TypeError: Cannot read properties of undefined (reading 'Runtime')
52 | const mockDsFn = (): EthereumDs[] => [
53 | {
> 54 | kind: EthereumDatasourceKind.Runtime,
| ^
55 | startBlock: 1,
56 | options: {
57 | abi: 'Erc721',
at mockDsFn (packages/cli/src/controller/generate-controller.spec.ts:54:34)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.spec.ts:289:16)
● CLI codegen:generate › filter out existing methods, only on matching address
TypeError: Cannot read properties of undefined (reading 'Runtime')
52 | const mockDsFn = (): EthereumDs[] => [
53 | {
> 54 | kind: EthereumDatasourceKind.Runtime,
| ^
55 | startBlock: 1,
56 | options: {
57 | abi: 'Erc721',
at mockDsFn (packages/cli/src/controller/generate-controller.spec.ts:54:34)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.spec.ts:308:16)
● CLI codegen:generate › filter out existing methods, inputAddress === undefined || "" should filter all ds that contains no address
TypeError: Cannot read properties of undefined (reading 'Runtime')
52 | const mockDsFn = (): EthereumDs[] => [
53 | {
> 54 | kind: EthereumDatasourceKind.Runtime,
| ^
55 | startBlock: 1,
56 | options: {
57 | abi: 'Erc721',
at mockDsFn (packages/cli/src/controller/generate-controller.spec.ts:54:34)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.spec.ts:325:16)
● CLI codegen:generate › filter out different formatted filters
TypeError: Cannot read properties of undefined (reading 'Runtime')
52 | const mockDsFn = (): EthereumDs[] => [
53 | {
> 54 | kind: EthereumDatasourceKind.Runtime,
| ^
55 | startBlock: 1,
56 | options: {
57 | abi: 'Erc721',
at mockDsFn (packages/cli/src/controller/generate-controller.spec.ts:54:34)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.spec.ts:343:16)
● CLI codegen:generate › Correct constructedDataSourcesTs
TypeError: (0 , common_ethereum_1.parseContractPath) is not a function
166 |
167 | export function constructDatasourcesTs(userInput: UserInput): string {
> 168 | const abiName = parseContractPath(userInput.abiPath).name;
| ^
169 | const formattedHandlers = generateFormattedHandlers(userInput, abiName, (kind) => kind);
170 | const handlersString = tsStringify(formattedHandlers);
171 |
at constructDatasourcesTs (packages/cli/src/controller/generate-controller.ts:168:36)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.spec.ts:512:34)
● CLI codegen:generate › Construct correct ds for yaml
TypeError: (0 , common_ethereum_1.parseContractPath) is not a function
186 |
187 | export function constructDatasourcesYaml(userInput: UserInput): EthereumDs {
> 188 | const abiName = parseContractPath(userInput.abiPath).name;
| ^
189 | const formattedHandlers = generateFormattedHandlers(userInput, abiName, (kind) => {
190 | if (kind === 'EthereumHandlerKind.Call') return EthereumHandlerKind.Call;
191 | return EthereumHandlerKind.Event;
at constructDatasourcesYaml (packages/cli/src/controller/generate-controller.ts:188:36)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.spec.ts:553:36)
● CLI codegen:generate › extract from TS manifest
expect(received).toMatch(expected)
Expected substring: "approve(address spender, uint256 rawAmount)"
Received string: "0x095ea7b3"
684 | );
685 | // TODO expected to fail, due to unable to skip comments
> 686 | expect(v.function).toMatch('approve(address spender, uint256 rawAmount)');
| ^
687 | expect(v.topics[0]).toMatch('Transfer(address indexed from, address indexed to, uint256 amount)');
688 | expect(v.endpoint[0]).toMatch('https://eth.api.onfinality.io/public');
689 | });
at Object.<anonymous> (packages/cli/src/controller/generate-controller.spec.ts:686:24)
● CLI codegen:generate › Correct output on tsStringify
TypeError: Cannot read properties of undefined (reading 'Runtime')
52 | const mockDsFn = (): EthereumDs[] => [
53 | {
> 54 | kind: EthereumDatasourceKind.Runtime,
| ^
55 | startBlock: 1,
56 | options: {
57 | abi: 'Erc721',
at mockDsFn (packages/cli/src/controller/generate-controller.spec.ts:54:34)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.spec.ts:700:20)
● CLI codegen:generate, Can write to file › generateManifest from ts-manifest
TypeError: (0 , common_ethereum_1.parseContractPath) is not a function
166 |
167 | export function constructDatasourcesTs(userInput: UserInput): string {
> 168 | const abiName = parseContractPath(userInput.abiPath).name;
| ^
169 | const formattedHandlers = generateFormattedHandlers(userInput, abiName, (kind) => kind);
170 | const handlersString = tsStringify(formattedHandlers);
171 |
at constructDatasourcesTs (packages/cli/src/controller/generate-controller.ts:168:36)
at generateManifestTs (packages/cli/src/controller/generate-controller.ts:354:19)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.test.ts:207:29)
● CLI codegen:generate, Can write to file › Can generate manifest
TypeError: (0 , common_ethereum_1.parseContractPath) is not a function
186 |
187 | export function constructDatasourcesYaml(userInput: UserInput): EthereumDs {
> 188 | const abiName = parseContractPath(userInput.abiPath).name;
| ^
189 | const formattedHandlers = generateFormattedHandlers(userInput, abiName, (kind) => {
190 | if (kind === 'EthereumHandlerKind.Call') return EthereumHandlerKind.Call;
191 | return EthereumHandlerKind.Event;
at constructDatasourcesYaml (packages/cli/src/controller/generate-controller.ts:188:36)
at generateManifestYaml (packages/cli/src/controller/generate-controller.ts:367:19)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.test.ts:327:31)
● CLI codegen:generate, Can write to file › if handler filter already exist with matching address, should not add
TypeError: (0 , common_ethereum_1.parseContractPath) is not a function
186 |
187 | export function constructDatasourcesYaml(userInput: UserInput): EthereumDs {
> 188 | const abiName = parseContractPath(userInput.abiPath).name;
| ^
189 | const formattedHandlers = generateFormattedHandlers(userInput, abiName, (kind) => {
190 | if (kind === 'EthereumHandlerKind.Call') return EthereumHandlerKind.Call;
191 | return EthereumHandlerKind.Event;
at constructDatasourcesYaml (packages/cli/src/controller/generate-controller.ts:188:36)
at generateManifestYaml (packages/cli/src/controller/generate-controller.ts:367:19)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.test.ts:390:31)
● CLI codegen:generate, Can write to file › should preserve any comments in existing datasources
TypeError: The "warning" argument must be of type string or an instance of Error. Received an instance of ModuleLoadError
422 | await fs.promises.writeFile(path.join(PROJECT_PATH, 'src/index.ts'), 'export * from "./mappings/mappingHandlers"');
423 |
> 424 | await Generate.run([
| ^
425 | '-f',
426 | path.join(PROJECT_PATH, './generate-project-2.yaml'),
427 | '--events',
at Plugin.warn (node_modules/@oclif/core/lib/config/plugin.js:276:17)
at node_modules/@oclif/core/lib/config/plugin.js:256:30
at async Promise.all (index 1)
at Plugin._manifest (node_modules/@oclif/core/lib/config/plugin.js:249:24)
at Plugin.load (node_modules/@oclif/core/lib/config/plugin.js:135:25)
at PluginLoader.loadRoot (node_modules/@oclif/core/lib/config/plugin-loader.js:29:13)
at Config.load (node_modules/@oclif/core/lib/config/config.js:108:27)
at Function.load (node_modules/@oclif/core/lib/config/config.js:101:9)
at Function.run (node_modules/@oclif/core/lib/command.js:74:24)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.test.ts:424:5)
● CLI codegen:generate, Can write to file › should throw, if handler file exists
expect(received).rejects.toThrow(expected)
Expected substring: "file: Erc721Handlers.ts already exists"
Received message: "The \"warning\" argument must be of type string or an instance of Error. Received an instance of ModuleLoadError"
446 | await fs.promises.writeFile(path.join(PROJECT_PATH, 'src/mappings/Erc721Handlers.ts'), 'zzzzzz');
447 |
> 448 | await expect(
| ^
449 | Generate.run([
450 | '-f',
451 | path.join(PROJECT_PATH, './generate-project-2.yaml'),
at Plugin.warn (node_modules/@oclif/core/lib/config/plugin.js:276:17)
at node_modules/@oclif/core/lib/config/plugin.js:256:30
at async Promise.all (index 1)
at Plugin._manifest (node_modules/@oclif/core/lib/config/plugin.js:249:24)
at Plugin.load (node_modules/@oclif/core/lib/config/plugin.js:135:25)
at PluginLoader.loadRoot (node_modules/@oclif/core/lib/config/plugin-loader.js:29:13)
at Config.load (node_modules/@oclif/core/lib/config/config.js:108:27)
at Function.load (node_modules/@oclif/core/lib/config/config.js:101:9)
at Function.run (node_modules/@oclif/core/lib/command.js:74:24)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.test.ts:448:5)
at Object.toThrow (node_modules/expect/build/index.js:210:22)
at Object.<anonymous> (packages/cli/src/controller/generate-controller.test.ts:461:15)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/node/src/configure/SubqueryProject.ts
packages/node/src/indexer/api.service.test.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/node/src/configure/SubqueryProject.ts:8:1)
at Object.<anonymous> (packages/node/src/indexer/api.service.test.ts:16:1)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/node-core/src/indexer/dictionary.service.test.ts'
4 | import assert from 'assert';
5 | import {EventEmitter2} from '@nestjs/event-emitter';
> 6 | import {SubstrateDatasourceKind, SubstrateHandlerKind} from '@subql/types';
| ^
7 | import {DictionaryQueryEntry} from '@subql/types-core';
8 | import {range} from 'lodash';
9 | import {NodeConfig} from '../configure';
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/node-core/src/indexer/dictionary.service.test.ts:6:1)
● Test suite failed to run
Your test suite must contain at least one test.
at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
at node_modules/@jest/core/build/TestScheduler.js:254:19
at node_modules/emittery/index.js:363:13
at Array.map (<anonymous>)
at Emittery.emit (node_modules/emittery/index.js:361:23)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/load.spec.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.spec.ts:4:1)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/node/src/indexer/indexer.manager.spec.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/node/src/indexer/indexer.manager.spec.ts:5:1)
● Cli can create project (mocked) › validate ethereum project manifest
expect(received).resolves.toBe(expected) // Object.is equality
Expected: true
Received: false
69 | it('validate ethereum project manifest', async () => {
70 | const projectPath_eth = path.join(__dirname, '../../test/abiTest1');
> 71 | await expect(validateEthereumProjectManifest(projectPath_eth)).resolves.toBe(true);
| ^
72 | await expect(validateEthereumProjectManifest(projectPath)).resolves.toBe(false);
73 | });
74 | it('fetch templates', async () => {
at Object.toBe (node_modules/expect/build/index.js:166:22)
at Object.<anonymous> (packages/cli/src/controller/init-controller.spec.ts:71:77)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/node/src/indexer/fetch.service.spec.ts'
2 | // SPDX-License-Identifier: GPL-3.0
3 |
> 4 | import {
| ^
5 | SubstrateBlockHandler,
6 | SubstrateCallHandler,
7 | SubstrateCustomDatasource,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/node/src/indexer/fetch.service.spec.ts:4:1)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/versioned/v1_0_0/model.ts
packages/common-substrate/src/project/versioned/v1_0_0/index.ts
packages/common-substrate/src/project/project.spec.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/versioned/v1_0_0/model.ts:24:1)
at Object.<anonymous> (packages/common-substrate/src/project/versioned/v1_0_0/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/project/project.spec.ts:7:1)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/cli/src/controller/publish-controller.spec.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/cli/src/controller/publish-controller.spec.ts:10:1)
● Manifest generation › should build ts manifest from multichain file
expect(received).resolves.toBeDefined()
Received promise rejected instead of resolved
Rejected to value: [Error: Failed to generate manifest from typescript /home/runner/work/subql/subql/packages/cli/test/tsManifestTest/subquery-multichain.ts, Failed to build /home/runner/work/subql/subql/packages/cli/test/tsManifestTest/project1.ts: Error: Cannot find module '@subql/types' from 'packages/cli/test/tsManifestTest/project1.ts'·
Require stack:
packages/cli/test/tsManifestTest/project1.ts
packages/cli/src/utils/build.ts
packages/cli/src/utils/build.spec.ts
]
45 | await expect(
46 | buildManifestFromLocation(projectPath, {log: console.log} as unknown as Command)
> 47 | ).resolves.toBeDefined();
| ^
48 | expect(existsSync(path.join(projectPath, '../project1.yaml'))).toBe(true);
49 | expect(existsSync(path.join(projectPath, '../project3.yaml'))).toBe(true);
50 | expect(existsSync(path.join(projectPath, '../subquery-multichain3.yaml'))).toBe(true);
at expect (node_modules/expect/build/index.js:105:15)
at Object.<anonymous> (packages/cli/src/utils/build.spec.ts:47:15)
● Manifest generation › allows both ts and yaml file in multichain manifest
expect(received).resolves.toBeDefined()
Received promise rejected instead of resolved
Rejected to value: [Error: Failed to generate manifest from typescript /home/runner/work/subql/subql/packages/cli/test/tsManifestTest/subquery-multichain3.ts, Failed to build /home/runner/work/subql/subql/packages/cli/test/tsManifestTest/project1.ts: Error: Cannot find module '@subql/types' from 'packages/cli/test/tsManifestTest/project1.ts'·
Require stack:
packages/cli/test/tsManifestTest/project1.ts
packages/cli/src/utils/build.ts
packages/cli/src/utils/build.spec.ts
]
59 | it('should build ts manifest from yaml multichain file', async () => {
60 | const projectPath = path.join(__dirname, '../../test/tsManifestTest/subquery-multichain4.yaml');
> 61 | await expect(
| ^
62 | buildManifestFromLocation(projectPath, {log: console.log} as unknown as Command)
63 | ).resolves.toBeDefined();
64 | expect(existsSync(path.join(projectPath, '../project1.yaml'))).toBe(true);
at expect (node_modules/expect/build/index.js:105:15)
at Object.<anonymous> (packages/cli/src/utils/build.spec.ts:61:15)
● Manifest generation › should build ts manifest from yaml multichain file
expect(received).resolves.toBeDefined()
Received promise rejected instead of resolved
Rejected to value: [Error: Failed to generate manifest from typescript /home/runner/work/subql/subql/packages/cli/test/tsManifestTest/subquery-multichain4.yaml, Failed to build /home/runner/work/subql/subql/packages/cli/test/tsManifestTest/project1.ts: Error: Cannot find module '@subql/types' from 'packages/cli/test/tsManifestTest/project1.ts'·
Require stack:
packages/cli/test/tsManifestTest/project1.ts
packages/cli/src/utils/build.ts
packages/cli/src/utils/build.spec.ts
]
69 | readFileSync(path.join(projectPath, '../subquery-multichain4.yaml'), 'utf8')
70 | ) as MultichainProjectManifest;
> 71 | multichainContent.projects.forEach((project) => expect(project.endsWith('.yaml')).toBe(true));
| ^
72 |
73 | //revert yaml to ts
74 | multichainContent.projects = multichainContent.projects.map((project) => project.replace('.yaml', '.ts'));
at expect (node_modules/expect/build/index.js:105:15)
at Object.<anonymous> (packages/cli/src/utils/build.spec.ts:71:15)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/node/src/configure/SubqueryProject.ts
packages/node/src/configure/SubqueryProject.spec.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/node/src/configure/SubqueryProject.ts:8:1)
at Object.<anonymous> (packages/node/src/configure/SubqueryProject.spec.ts:15:1)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/cli/src/controller/codegen-controller.ts
packages/cli/src/controller/codegen-controller.test.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/cli/src/controller/codegen-controller.ts:24:1)
at Object.<anonymous> (packages/cli/src/controller/codegen-controller.test.ts:9:1)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/node/src/configure/SubqueryProject.ts
packages/node/src/indexer/api.service.ts
packages/node/src/indexer/runtime/base-runtime.service.ts
packages/node/src/indexer/runtime/runtime.service.spec.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/node/src/configure/SubqueryProject.ts:8:1)
at Object.<anonymous> (packages/node/src/indexer/api.service.ts:19:1)
at Object.<anonymous> (packages/node/src/indexer/runtime/base-runtime.service.ts:10:1)
at Object.<anonymous> (packages/node/src/indexer/runtime/runtime.service.spec.ts:11:1)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/node/src/configure/SubqueryProject.ts
packages/node/src/indexer/api.service.spec.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/node/src/configure/SubqueryProject.ts:8:1)
at Object.<anonymous> (packages/node/src/indexer/api.service.spec.ts:13:1)
● Able to generate cosmos types from protobuf › Able to generate ts types from protobufs
TypeError: (0 , common_cosmos_1.generateProto) is not a function
48 | export type SwapAmountInRouteMessage = CosmosMessage<SwapAmountInRoute>;
49 | `;
> 50 | await generateProto(MOCK_CHAINTYPES, PROJECT_PATH, prepareDirPath, renderTemplate, upperFirst, tempProtoDir);
| ^
51 | const codegenResult = await fs.promises.readFile(path.join(PROJECT_PATH, '/src/types/CosmosMessageTypes.ts'));
52 | expect(fs.existsSync(`${PROJECT_PATH}/src/types/CosmosMessageTypes.ts`)).toBeTruthy();
53 | expect(codegenResult.toString()).toBe(expectedGeneratedCode);
at Object.<anonymous> (packages/cli/src/controller/codegen-cosmos.test.ts:50:24)
● Able to generate cosmos types from protobuf › On missing protobuf dependency should throw
TypeError: (0 , common_cosmos_1.tempProtoDir) is not a function
54 | });
55 | it('On missing protobuf dependency should throw', async () => {
> 56 | const tmpDir = await tempProtoDir(PROJECT_PATH);
| ^
57 | const badChainTypes = [
58 | {
59 | 'osmosis.gamm.v1beta1': {
at Object.<anonymous> (packages/cli/src/controller/codegen-cosmos.test.ts:56:38)
● Able to generate cosmos types from protobuf › create temp dir with all protobufs
TypeError: (0 , common_cosmos_1.tempProtoDir) is not a function
75 | // user Protobufs should not be overwritten
76 | const preFile = await fs.promises.readFile(path.join(PROJECT_PATH, 'proto/osmosis/gamm/v1beta1/tx.proto'));
> 77 | const tmpDir = await tempProtoDir(PROJECT_PATH);
| ^
78 | const afterFile = await fs.promises.readFile(path.join(tmpDir, 'osmosis/gamm/v1beta1/tx.proto'));
79 | expect(preFile.toString()).toBe(afterFile.toString());
80 | await promisify(rimraf)(tmpDir);
at Object.<anonymous> (packages/cli/src/controller/codegen-cosmos.test.ts:77:38)
● Able to generate cosmos types from protobuf › tmpDirectory should be removed after codegen
TypeError: (0 , common_cosmos_1.tempProtoDir) is not a function
81 | });
82 | it('tmpDirectory should be removed after codegen', async () => {
> 83 | const tmpDir = await tempProtoDir(PROJECT_PATH);
| ^
84 | await generateProto(MOCK_CHAINTYPES, PROJECT_PATH, prepareDirPath, renderTemplate, upperFirst, () =>
85 | Promise.resolve(tmpDir)
86 | );
at Object.<anonymous> (packages/cli/src/controller/codegen-cosmos.test.ts:83:38)
● Worker Store Service › can make a request with an object
thrown: "Exceeded timeout of 5000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
70 | });
71 |
> 72 | it('can make a request with an object', async () => {
| ^
73 | const spy = jest.spyOn(store, 'getByField');
74 |
75 | await worker.callStoreFunction('getByField', ['Entity', 'field', '1', {offset: 0, limit: 1}]);
at packages/node-core/src/indexer/worker/worker.store.service.test.ts:72:3
at Object.<anonymous> (packages/node-core/src/indexer/worker/worker.store.service.test.ts:42:1)
● Worker Store Service › can make a respone with an object
thrown: "Exceeded timeout of 5000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
78 | });
79 |
> 80 | it('can make a respone with an object', async () => {
| ^
81 | const spy = jest.spyOn(store, 'set');
82 |
83 | const entity = new EntityCls('1', '1');
at packages/node-core/src/indexer/worker/worker.store.service.test.ts:80:3
at Object.<anonymous> (packages/node-core/src/indexer/worker/worker.store.service.test.ts:42:1)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/node/src/indexer/ds-processor.service.spec.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/node/src/indexer/ds-processor.service.spec.ts:5:1)
● ApiPromiseConnection › should not cache requests if there are no args
thrown: "Exceeded timeout of 5000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
14 | let httpProvider: HttpProvider;
15 |
> 16 | beforeEach(async () => {
| ^
17 | wsProvider = await new WsProvider(
18 | 'wss://kusama.api.onfinality.io/public-ws',
19 | ).isReady;
at packages/node/src/indexer/apiPromise.connection.spec.ts:16:3
at Object.<anonymous> (packages/node/src/indexer/apiPromise.connection.spec.ts:12:1)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/cli/src/controller/publish-controller.spec.ts
packages/cli/src/commands/publish.test.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/cli/src/controller/publish-controller.spec.ts:10:1)
at Object.<anonymous> (packages/cli/src/commands/publish.test.ts:8:1)
● ConnectionPoolService › handleApiDisconnects › should call handleApiDisconnects only once when multiple connection errors are triggered
expect(jest.fn()).toHaveBeenCalledTimes(expected)
Expected number of calls: 1
Received number of calls: 0
114 | await delay(5);
115 |
> 116 | expect(handleApiDisconnectsSpy).toHaveBeenCalledTimes(1);
| ^
117 | }, 15000);
118 | });
119 | });
at Object.<anonymous> (packages/node-core/src/indexer/connectionPool.service.spec.ts:116:39)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/cli/src/controller/codegen-controller.ts
packages/cli/src/controller/codegen-controller.spec.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/cli/src/controller/codegen-controller.ts:24:1)
at Object.<anonymous> (packages/cli/src/controller/codegen-controller.spec.ts:7:1)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/node/src/configure/SubqueryProject.ts
packages/node/src/indexer/dictionary.service.test.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/node/src/configure/SubqueryProject.ts:8:1)
at Object.<anonymous> (packages/node/src/indexer/dictionary.service.test.ts:7:1)
● Test suite failed to run
Cannot find module '@subql/types' from 'packages/common-substrate/src/project/models.ts'
Require stack:
packages/common-substrate/src/project/models.ts
packages/common-substrate/src/project/load.ts
packages/common-substrate/src/project/index.ts
packages/common-substrate/src/index.ts
packages/node/src/indexer/fetch.service.ts
packages/node/src/indexer/fetch.service.test.ts
4 | import {RegisteredTypes, RegistryTypes, OverrideModuleType, OverrideBundleType} from '@polkadot/types/types';
5 | import {BaseDataSource, BlockFilterImpl, ProcessorImpl} from '@subql/common';
> 6 | import {
| ^
7 | SubstrateBlockFilter,
8 | SubstrateBlockHandler,
9 | SubstrateCallFilter,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (packages/common-substrate/src/project/models.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/load.ts:6:1)
at Object.<anonymous> (packages/common-substrate/src/project/index.ts:4:1)
at Object.<anonymous> (packages/common-substrate/src/index.ts:4:1)
at Object.<anonymous> (packages/node/src/indexer/fetch.service.ts:9:1)
at Object.<anonymous> (packages/node/src/indexer/fetch.service.test.ts:6:1)
Report generated by 🧪jest coverage report action from 81b6a84
Replaced by #2312 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.