Discussion:
[Cucumber] I need to stage data before tests run...
(too old to reply)
Mark Juchems
2018-09-17 13:11:28 UTC
Permalink
New to Cucumber and think it's great.

I work for a Large Yellow tractor company in our Telematics group. We get
messages from tractors and they process through our system (Storm) and then
end up on a database/REST service. This can take over a minute or so. We
also have a lot of tests. Currently we run each test individually, but, as
you can imagine, the tests take forever. We have 1200 tests now and each
must wait for the message to process. (1200 X 1 minute = way too long).

We have a large system and we want to use Cucumber, but we need to:


1. Add data to a queue
2. Wait 60 seconds (or more)
3. Run the test.

We cannot use Cucumber because there is no "stage" phase. We have
researched parallel tests but this seems to be unstable AND we frankly just
have too much stuff going on (1200 tests?). I have a system using Junit 4
(we are using Java) using @BeforeClass and a method that goes through and
runs any method with a certain annotation (@Stager) This works great but
it cannot work with Cucumber.


*What I want is a way to run ALL the "Given" methods first, then wait, then
run the rest.*

I don't think we need any parallelism. The data is staged fast and the
tests themselves are fast. I have not found anything on the web and was
wondering if anyone has come across a tool that would do this, or direct me
to "hacking" Cucumber to do this. (BTW, this seems to be a common problem.
I have found a few other posts with this request. The JUnit 5 guys are
actually working on something but who knows?)

Any help from the gurus? Maybe a @RunWith(CucumberStage.class)?
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andrew Premdas
2018-09-17 15:55:21 UTC
Permalink
Running all the Givens first is not the answer. What you want to do is make
each scenario faster by removing the time it takes to get the messages from
the tractors through your system.

A couple of things to think about are

- system boundaries (break your overall system into parts and think about
the boundaries between them)
- recording responses
- simulating the bit of the chain that takes along time
- what you are trying to test

For example if you are testing a UI that interacts with your database/REST
service, there is no need to involve the tractors and Storm. You can either

1. Put the data directly into the database
2. Treat Storm as an external resource and record the response/request it
makes when you get data into the database.

If you are testing what the tractors do, there is no need to involve
anything further down the chain.

If you are testing Storm you can treat the tractors as an external resource
and record request/responses.

Most of this will involve making testing environments that focus on each
piece of the chain, not the whole thing e.g. a tractor test environment, a
storm test environment, an environment centred on the database/REST service.

You have the power to choose your boundaries. At the moment I suspect that
your problems are all focused on having made less than optimum choices so
far.

Hope that helps (its alot of speculation from a short post)

All best

Andrew
Post by Mark Juchems
New to Cucumber and think it's great.
I work for a Large Yellow tractor company in our Telematics group. We get
messages from tractors and they process through our system (Storm) and then
end up on a database/REST service. This can take over a minute or so. We
also have a lot of tests. Currently we run each test individually, but, as
you can imagine, the tests take forever. We have 1200 tests now and each
must wait for the message to process. (1200 X 1 minute = way too long).
1. Add data to a queue
2. Wait 60 seconds (or more)
3. Run the test.
We cannot use Cucumber because there is no "stage" phase. We have
researched parallel tests but this seems to be unstable AND we frankly just
have too much stuff going on (1200 tests?). I have a system using Junit 4
it cannot work with Cucumber.
*What I want is a way to run ALL the "Given" methods first, then wait,
then run the rest.*
I don't think we need any parallelism. The data is staged fast and the
tests themselves are fast. I have not found anything on the web and was
wondering if anyone has come across a tool that would do this, or direct me
to "hacking" Cucumber to do this. (BTW, this seems to be a common problem.
I have found a few other posts with this request. The JUnit 5 guys are
actually working on something but who knows?)
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...