Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
143 views
in Technique[技术] by (71.8m points)

java - Gauge - Before spec running for every row in csv with -DinParallel=true

I've a spec which has

table: data/csv/a.csv
Tags: tag1

Where csv file has 49 cases and there is only 1 scenario in spec

Before spec in a StemImplementation looks like below

    @BeforeSpec(tags = {"tag1","tag2"},tagAggregation = Operator.OR)
    public static void preSpec() {
    }

When i run spec in parallel, it is running before spec 49 times. It should be run as many thread i've.

gauge -v

Gauge version: 1.1.1 Plugins
html-report (4.0.12) 
java (0.7.3) 
json-report (0.3.3) 
xml-report (0.2.3)
question from:https://stackoverflow.com/questions/65622998/gauge-before-spec-running-for-every-row-in-csv-with-dinparallel-true

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is an experimental feature on gauge - Table driven scenario. Where table can be defined at scenario level and then beforespec and afterspec will run only once. Complete spec will run in one go.

In parallel mode, all specs will run in parallel instead of scenario. This is what people mostly want

More details here https://docs.gauge.org/writing-specifications.html?os=linux&language=javascript&ide=vscode#table-driven-scenario

There are open issues with this approach.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...