Skip to content
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
wants to merge 19 commits into from
Closed

Conversation

stwiname
Copy link
Collaborator

No description provided.

@ianhe8x
Copy link
Collaborator

ianhe8x commented May 17, 2023

Coverage report

❌ An unexpected error occurred. For more details, check console

Error: The process '/usr/local/bin/yarn' failed with exit code 1
St.
Category Percentage Covered / Total
🔴 Statements 45.77% 10703/23385
🟡 Branches 77.48% 1001/1292
🔴 Functions 35.87% 382/1065
🔴 Lines 45.77% 10703/23385

Test suite run failed

Failed tests: 34/270. Failed suites: 28/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)


  ● GraphqlModule › can query all metadata fields from database

    getaddrinfo EAI_AGAIN postgres



  ● GraphqlModule › can query all metadata fields from database

    getaddrinfo EAI_AGAIN postgres



  ● GraphqlModule › wont resolve fields that arent allowed metadata

    getaddrinfo EAI_AGAIN postgres



  ● GraphqlModule › wont resolve fields that arent allowed metadata

    getaddrinfo EAI_AGAIN postgres



  ● GraphqlModule › resolve incorrect fields in db to null when queried from graphql

    getaddrinfo EAI_AGAIN postgres



  ● GraphqlModule › resolve incorrect fields in db to null when queried from graphql

    getaddrinfo EAI_AGAIN postgres




  ● 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.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)


  ● 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)


  ● 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)


  ● query limits › entity limits › unbounded query clamped to safe bound

    getaddrinfo EAI_AGAIN postgres



  ● query limits › entity limits › unbounded query clamped to safe bound

    getaddrinfo EAI_AGAIN postgres



  ● query limits › entity limits › bounded unsafe query clamped to safe bound

    getaddrinfo EAI_AGAIN postgres



  ● query limits › entity limits › bounded unsafe query clamped to safe bound

    getaddrinfo EAI_AGAIN postgres



  ● query limits › entity limits › bounded safe query remains unchanged

    getaddrinfo EAI_AGAIN postgres



  ● query limits › entity limits › bounded safe query remains unchanged

    getaddrinfo EAI_AGAIN postgres




  ● 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 make duplicate requests for state_getRuntimeVersion on wsProvider

    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."

      24 |   });
      25 |
    > 26 |   it('should not make duplicate requests for state_getRuntimeVersion on wsProvider', async () => {
         |   ^
      27 |     const cachedProvider = createCachedProvider(wsProvider);
      28 |
      29 |     await Promise.all([

      at packages/node/src/indexer/apiPromise.connection.spec.ts:26:3
      at Object.<anonymous> (packages/node/src/indexer/apiPromise.connection.spec.ts:12:1)

  ● ApiPromiseConnection › should not make duplicate requests for chain_getHeader on wsProvider

    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."

      35 |   });
      36 |
    > 37 |   it('should not make duplicate requests for chain_getHeader on wsProvider', async () => {
         |   ^
      38 |     const cachedProvider = createCachedProvider(wsProvider);
      39 |     await Promise.all([
      40 |       cachedProvider.send('chain_getHeader', [TEST_BLOCKHASH]),

      at packages/node/src/indexer/apiPromise.connection.spec.ts:37:3
      at Object.<anonymous> (packages/node/src/indexer/apiPromise.connection.spec.ts:12:1)

  ● ApiPromiseConnection › should not make duplicate requests for chain_getHeader on httpProvider

    [429]:

      204 |
      205 |       if (!response.ok) {
    > 206 |         throw new Error(`[${response.status}]: ${response.statusText}`);
          |               ^
      207 |       }
      208 |
      209 |       const result = await response.text();

      at HttpProvider._send (packages/node/src/indexer/x-provider/http.ts:206:15)

  ● 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)


  ● 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)


  ● Test suite failed to run

    Jest worker encountered 4 child process exceptions, exceeding retry limit

      at ChildProcessWorker.initialize (node_modules/jest-worker/build/workers/ChildProcessWorker.js:181:21)


  ● Test suite failed to run

    Jest worker encountered 4 child process exceptions, exceeding retry limit

      at ChildProcessWorker.initialize (node_modules/jest-worker/build/workers/ChildProcessWorker.js:181:21)

Report generated by 🧪jest coverage report action from bc157ae

Copy link

github-actions bot commented Nov 3, 2023

Coverage report for .

❌ An unexpected error occurred. For more details, check console

Error: The process '/usr/local/bin/yarn' failed with exit code 1
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

@stwiname
Copy link
Collaborator Author

Replaced by #2312

@stwiname stwiname closed this Mar 20, 2024
@stwiname stwiname deleted the ci-test-coverage branch March 21, 2024 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants