2.0 Parallelism with Nodejs and Tape


#1

I’m currently unable to figure out Parallelism as described in https://circleci.com/docs/2.0/parallelism-faster-jobs/

With the config I am using it seems to spin up the 4 containers, but it seems to be running ALL of the tests in each container instead of splitting them up.

My current config is as follows

version: 2
jobs:
  build:
    parallelism: 4
    docker:
      - image: nousdefions/circleci-lambda:latest
    steps:
      - add_ssh_keys:
          fingerprints:
          - "2f:46:eb:b2:58:72:4e:f1:d4:51:56:eb:67:51:8a:41"
          - "d5:6c:68:40:8e:28:98:9c:f3:16:77:17:f5:20:83:3d"

      - checkout

      - run:
          name: update-npm
          command: npm install -g npm@latest

      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}

      - run:
          name: install
          command: npm install

      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - node_modules

      - run:
          name: Tests 
          command: npm run tape $(circleci tests glob "./test/test-*.js")

What could I be missing?


#2

I think I solved it. I was missing circleci tests split

      - run:
          name: Tests 
          command: npm run tape $(circleci tests glob "./test/test-*.js" | circleci tests split)

#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.