sebastiandaschner blog


Effective Test Execution With Quarkus

#productivity #quarkus #testing monday, july 24, 2023

The dev mode in Quarkus and especially the continuous testing feature is one of the fastest ways to execute tests and get feedback. Triggering your tests with a single keystroke and receiving feedback in a matter of milliseconds is a game changer in minimizing turnaround times. With Quarkus 3.2, there are more interesting ways to add to this way of testing, which I’m presenting in the following video:

 

 

Takeaways

  • quarkus:dev (or :test) excludes integration tests (test classes that end with IT) per default

  • Patterns and tags can be set per mvn invocation with -Dquarkus.test.exclude-pattern (or include or -tags, respectively).

  • The dev mode terminal (press :) can set these includes and excludes on the fly
    (test pattern|tags include|exclude)

  • Aliases can be set in the terminal (with alias) to trigger commands faster

  • Aliases with a single character can be executed with a keystroke in the dev mode, given the key doesn’t collide with existing ones

  • The JUnit tag slow is excluded in Quarkus testing per default

  • The Quarkus terminal aliases are stored under ~/.quarkus/console-aliases.txt

These are the aliases which I used in my system test project:

alias 1='test pattern include && test tags exclude slow && test pattern exclude .*UITest -r -d'
alias 2='test pattern include && test tags exclude slow && test pattern exclude -r -d'
alias 3='test pattern include && test tags exclude && test pattern exclude -r -d'

 

Found the post useful? Then you might want to have a look at my Quarkus video courses.