2

It's very easy to setup parallel tests for rspec or cucumber on CircleCI:

test:
  override:
    - bundle exec rspec:
        parallel: true
        files:
          - spec/unit/sample.rb   # can be a direct path to file
          - spec/**/*.rb          # or a glob (ruby globs)

However I try to split protractor tests. It takes comma separated files as a command line argument instead of space separated files. How can I achieve this without too much work?

ciembor
  • 7,189
  • 13
  • 59
  • 100
  • That didn't quite work for me, received an error about an invalid override type from Circle. However, this did work: `test:\n override:\n - bundle exec cucumber features/deals/pay.feature` – Chuck Bergeron Jan 13 '16 at 00:10

1 Answers1

1

You can try adding the following to your circle.yml:

test:
  override:
    - run () { echo $@ | tr ' ' ',' | xargs protractor; }; run:
        parallel: true
        files: ..
ProjectFrank
  • 622
  • 1
  • 6
  • 11
  • I try with more clean way, with rake task and without using bash, but it's hard to pass arguments with spaces to rake task as well. – ciembor Jul 28 '15 at 22:40
  • Hmm, this is what I get: run () { echo $@ | tr ' ' ',' | xargs `npm run protractor-specs`; }; run 'spec/javascripts/e2e/company_spec.coffee' 'spec/javascripts/e2e/facebook_spec.coffee' 'spec/javascripts/e2e/locale_spec.coffee' /home/ubuntu/sim/node_modules/protractor/lib/cli.js:112 var patterns = list.split(','); ^ TypeError: undefined is not a function – ciembor Jul 29 '15 at 16:09