# How to run rspec tests in Logstash 5.0.0

**URL:** <https://discuss.elastic.co/t/how-to-run-rspec-tests-in-logstash-5-0-0/64895>\
**Category:** Logstash\
**Created:** [November 3, 2016, 3:26pm UTC](https://discuss.elastic.co/t/how-to-run-rspec-tests-in-logstash-5-0-0/64895 "2016-11-03T15:26:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcanzanese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rcanzanese/32/12626_2.png) [@rcanzanese](https://discuss.elastic.co/u/rcanzanese)\
**Post date:** [November 3, 2016, 3:26pm UTC](https://discuss.elastic.co/t/how-to-run-rspec-tests-in-logstash-5-0-0/64895/1 "2016-11-03T15:26:12Z")

</div>

In Logstash 2.4.0, I had ran `rpspec` tests by installing the development plugins:

```
./bin/logstash-plugin install --development

```

And then running rspec:

```
./bin/rspec

```

In Logstash 5.0.0 installing the development plugins does not create a ./bin/rspec. Instead I see `./vendor/bundle/jruby/1.9/bin/rspec`, but running this gives me

```
env: jruby: No such file or directory

```

How do I run my rspec tests in Logstash 5.0.0

---

<div class="post-metadata">

**Author:** ![tvid](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@tvid](https://discuss.elastic.co/u/tvid)\
**Post date:** [February 28, 2017, 2:30pm UTC](https://discuss.elastic.co/t/how-to-run-rspec-tests-in-logstash-5-0-0/64895/2 "2017-02-28T14:30:32Z")

</div>

May be elastic folks can comment but I didn't find an easy way to install rspec and dependency on top of 5.x deployment. Possible workaround would be (the way we did) is to build logstash from sources. It required minimal changes to our test suite.

Here is an example docker file which wraps everything:

FROM debian

RUN apt-get -y update  
RUN apt-get -y install oracle-java8-set-default ruby-full git  
RUN git clone -b 5.2 [https://github.com/elastic/logstash.git](https://github.com/elastic/logstash.git)  
WORKDIR /logstash  
RUN gem install rake  
RUN gem install bundler  
RUN rake bootstrap  
RUN rake test:install-core  
RUN bin/logstash-plugin install --development

COPY /pattern /etc/logstash/pattern  
COPY /filter project\_spec/filter  
COPY /test project\_spec/test  
COPY /suite\_runner.rb project\_spec

CMD ["/logstash/bin/rspec", "/logstash/project\_spec/suite\_runner.rb"]

---

<div class="post-metadata">

**Author:** ![rcanzanese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rcanzanese/32/12626_2.png) [@rcanzanese](https://discuss.elastic.co/u/rcanzanese)\
**Post date:** [June 23, 2017, 2:29pm UTC](https://discuss.elastic.co/t/how-to-run-rspec-tests-in-logstash-5-0-0/64895/3 "2017-06-23T14:29:44Z")

</div>

Thanks @tvid this looks a reasonable approach that we will give a shot in our environment.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 4:31am UTC](https://discuss.elastic.co/t/how-to-run-rspec-tests-in-logstash-5-0-0/64895/4 "2022-11-04T04:31:31Z")

</div>


