italktothewind
italktothewind

Reputation: 2195

Karate + Gatling: exitHereIfFailed not working

I have this simulation:

class TestSimulation extends Simulation {
  val protocol = karateProtocol()
  val scn = scenario("test")
    .exec(karateFeature("classpath:test1.feature"))
    .exitHereIfFailed
    .exec(karateFeature("classpath:test2.feature"))

  setUp(
    scn.inject(atOnceUsers(1)).protocols(protocol)
  )
}

test1.feature:

Feature: Test 1
  Scenario:
    * print '1'
    * assert 1 == 2

test2.feature:

Feature: Test 2
  Scenario:
    * print '2'

Because test1.feature is failing, I expect Gatling to stop the scenario there and not print '2', but in the logs I see:

Simulation simulations.TestSimulation started...
05:50:06.217 [DEBUG] i.g.c.c.i.o.OpenWorkload - Start user #1
05:50:06.219 [DEBUG] i.g.c.c.i.o.OpenWorkload - Injecting 1 users in scenario test, continue=false
05:50:06.220 [INFO ] i.g.c.c.i.Injector - StoppedInjecting
05:50:06.411 [DEBUG] c.j.j.i.p.CompiledPath - Evaluating path: $
05:50:06.425 [INFO ] c.intuit.karate - [print] 1
05:50:06.429 [ERROR] c.intuit.karate - assertion failed: assert evaluated to false: 1 == 2
05:50:06.443 [DEBUG] c.j.j.i.p.CompiledPath - Evaluating path: $
05:50:06.445 [INFO ] c.intuit.karate - [print] 2
05:50:06.445 [DEBUG] i.g.c.a.Exit - End user #1

Am I doing something wrong? Thanks!

Upvotes: 1

Views: 294

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58088

Karate (probably) doesn't support .exitHereIfFailed.

Perhaps you can contribute code.

EDIT - should work in 1.0: https://github.com/intuit/karate/issues/1382

Upvotes: 1

Related Questions