How to run feature specs only on master branch?

I would like to setup my CircleCI builds to only run specs in the features directory if the branch being built is master. For any other branch, I want to exclude this directory from my builds.

Here is how I am attempting to accomplish this:

test:
  override:
    - case $CIRCLE_BRANCH in master) bundle exec rspec ;; *) bundle exec rspec --exclude-pattern "spec/features/**/*_spec.rb" ;; esac:
        parallel: true

Unfortunately my specs do not run in parallel, and I’m not even really sure that using a case statement like this is the best way to go about things.

Could you give me a build URL?

Does the logic for the master branch work (even if not running in parallel)?

I PM’d you a build URL.

I haven’t merged my PR into master to confirm that it’s working, but it does kick off and run my specs.

1 Like