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

Error: You must specify a number of files greater than 1 to split your tests across. #69

Closed
Frozenfire92 opened this issue Nov 22, 2016 · 8 comments

Comments

@Frozenfire92
Copy link

Trying to integrate this (without setting parallel on circle first) causes this error. However I think this is undesired as circle may only provision 1 container for you if they are being used elsewhere

You must specify a number of files greater than 1 to split your tests across.
Error: You must specify a number of files greater than 1 to split your tests across.
    at TestsOptionsValidator._getShouldSplit (/home/ubuntu/platform/node_modules/ember-exam/lib/utils/tests-options-validator.js:26:13)
    at CoreObject.module.exports.TestCommand.extend.run (/home/ubuntu/platform/node_modules/ember-exam/lib/commands/exam.js:63:23)
    at CoreObject.superWrapper [as run] (/home/ubuntu/platform/node_modules/core-object/lib/assign-properties.js:32:18)
    at CoreObject.<anonymous> (/home/ubuntu/platform/node_modules/ember-cli/lib/models/command.js:224:19)
    at tryCatch (/home/ubuntu/platform/node_modules/rsvp/dist/rsvp.js:538:12)
    at invokeCallback (/home/ubuntu/platform/node_modules/rsvp/dist/rsvp.js:553:13)
    at publish (/home/ubuntu/platform/node_modules/rsvp/dist/rsvp.js:521:7)
    at flush (/home/ubuntu/platform/node_modules/rsvp/dist/rsvp.js:2370:5)
    at _combinedTickCallback (node.js:370:9)
    at process._tickDomainCallback (node.js:425:11)

ember exam --silent --reporter "xunit" --split=$CIRCLE_NODE_TOTAL --partition=`expr $CIRCLE_NODE_INDEX + 1` > $CIRCLE_TEST_REPORTS/junit/junit.xml returned exit code 1

Here is part of my circle.yml

test:
  override:
    - mkdir -p $CIRCLE_TEST_REPORTS/junit:
        parallel: true
    - ember exam --silent --reporter "xunit" --split=$CIRCLE_NODE_TOTAL --partition=`expr $CIRCLE_NODE_INDEX + 1` > $CIRCLE_TEST_REPORTS/junit/junit.xml:
        parallel: true
@trentmwillis
Copy link
Member

I don't have much familiarity with Circle. The number of nodes available to run your tests is variable per-run?

If so, I would recommend parallelizing within a given node instead of across the variable number of nodes. It will give you more consistent results and make debugging easier (less environmental variables).

@Frozenfire92
Copy link
Author

I'm not super familiar with it either, but this is my understanding.

You pay for containers, and all of your projects share these. If one is used it waits until another opens up. You can set it on a per repo(project) setting to use more if available. I only have 2 containers available, if a different project uses one (and is only provisioned one) then my ember project only has one available and this will happen (I think)

I found this blog post so hopefully someone else will run into this with circle who is more familiar

If so, I would recommend parallelizing within a given node instead of across the variable number of nodes. It will give you more consistent results and make debugging easier (less environmental variables).

How would I go about this?

@Frozenfire92
Copy link
Author

After working with the author of that blog post we confirmed that it is indeed working (once I switched to 2 containers for my project) and it is splitting the tests up correctly. To check this open the Artifacts tab in circle and click on the xml files to verify they are running different tests

image

However the issue still arises, I think if split does get passed 1, it should just run it as if it wasn't split rather than failing the tests

@trentmwillis
Copy link
Member

I think if split does get passed 1, it should just run it as if it wasn't split rather than failing the tests

I suppose I can relax this to just be a warning. The intent was to make sure developers know when they're actually splitting/reducing the number of tests being run, but an exception may be a bit too disruptive.

How would I go about this?

Use the --parallel option. In general I recommend this over trying to use multiple node/boxes/processes as it is overall less resource intensive.

@ghost
Copy link

ghost commented Jan 4, 2017

@Frozenfire92 we haven't had any issues using exam on Circle. Here's our circle.yml:

general:
  branches:
    only:
      - master 
      - /.*_ci$/
machine:
  node:
    version: 4.7.0
dependencies:
  cache_directories:
    - "/opt/circleci/nodejs/v4.7.0/lib/node_modules"
    - "/opt/circleci/nodejs/v4.7.0/bin"
    - "node_modules"
    - "bower_components"
  pre:
    - type ember || npm -g install ember-cli
    - type bower || npm -g install bower
  override:
    - npm install
    - bower install
test:
  override:
    - mkdir -p $CIRCLE_TEST_REPORTS/ember:
        parallel: true
    - node_modules/ember-cli/bin/ember exam ci --split=$CIRCLE_NODE_TOTAL --partition=$((CIRCLE_NODE_INDEX+1)) --reporter xunit --silent > $CIRCLE_TEST_REPORTS/ember/junit$CIRCLE_NODE_INDEX.xml:
        parallel: true
        timeout: 1200

@ghost
Copy link

ghost commented Jan 4, 2017

Ah you're saying the error message is unhelpful? I think it's fine, as you'd configure the circle.yml per project, and you'd add containers per project anyway based on your Circle plan?

Basically in the case of single containers you'd just use ember test ci anyway?

@dwickern
Copy link

dwickern commented Apr 7, 2017

👍 to make this a warning, so that we can do e.g.
ember exam --parallel --split=$NUMBER_OF_PROCESSORS
without extra conditional logic

@trentmwillis
Copy link
Member

This has been changed in 0.6.2.

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

No branches or pull requests

3 participants