# Running specific tests only on a pull request

**URL:** <https://discuss.circleci.com/t/running-specific-tests-only-on-a-pull-request/500>\
**Category:** Build Environment\
**Created:** [November 12, 2015, 10:28pm UTC](https://discuss.circleci.com/t/running-specific-tests-only-on-a-pull-request/500 "2015-11-12T22:28:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![alexey](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/alexey/32/42_2.png) [@alexey](https://discuss.circleci.com/u/alexey)\
**Post date:** [November 12, 2015, 10:48pm UTC](https://discuss.circleci.com/t/running-specific-tests-only-on-a-pull-request/500/2 "2015-11-12T22:48:36Z")

</div>

One of the [environment variables](https://circleci.com/docs/environment-variables) we make available in every build is the `CI_PULL_REQUEST` variable which is only populated when the build is part of a PR. So checking that variable should work in this case:

```auto
test:
  override:
    - if [[! -z $CI_PULL_REQUEST]] ; then <long-running-command> ; fi

```

If the PR is coming from a fork, the [fork PR variables](https://circleci.com/docs/environment-variables#building-pull-requests-that-come-from-forks) will be set, so you might condition the test execution on that instead.

---

_[View the full topic](https://discuss.circleci.com/t/running-specific-tests-only-on-a-pull-request/500)._
