The Wayback Machine - https://web.archive.org/web/20221212192804/https://github.com/apache/jmeter/pull/678
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSL for programmatic test plan generation #678

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vlsi
Copy link
Collaborator

@vlsi vlsi commented Nov 23, 2021

Description

See https://lists.apache.org/thread/52o722d7npsjj99m4k2zdz44mstl02lg

TODO

  • Should there be an intermediate test plan representation or should the current ListedHashTree and other classes represent the tree? I incline we should create a separate set of classes to avoid leaking unwanted methods to the end-user. For instance, methods like #sample(), #interrupt() do not seem to make sense during test plan generation.
  • Should DSL functions return objects or should they be no-result functions?
  • How should $ be escaped? (see https://youtrack.jetbrains.com/issue/KT-2425, https://lists.apache.org/thread/717sm4k8kx6ojmkq0j1w0fhkv41bkm8d)
  • Should the DSL incline to name-less elements or name-full elements? JMeter GUI requires names for all elements, including if and pauses, however, regular programming languages and DSLs do not require names for things like if, for, etc. Of course, the transaction controller should have a name, but is the name required for httpSampler?
  • Should there be .children() or something like that API to access all the children elements of the currently built node?

Motivation and Context

(in alphabetical order)
https://aliesbelik.github.io/awesome-jmeter/#dsl
https://github.com/abstracta/jmeter-java-dsl
https://github.com/anasoid/jmeter-as-code
https://github.com/smicyk/groovy-jmeter

anasoid/jmeter-as-code#133

https://github.com/Kotlin/kotlinx.html/wiki/Micro-templating-and-DSL-customizing

Screenshots (if appropriate):

sample screen of JMeter DSL in intellij IDEA

@kirillyu
Copy link

kirillyu commented Nov 23, 2021

Initially - thanks for the idea, this is really what the community needs.

My opinion on current issues:

  1. I am inclined more to the idea that an intermediate presentation is needed than not.
  2. Can you give details on this? I don't see any clear advantage in using no-result functions.
  3. This is an interesting point. In my opinion there is no need to escape this character. It should also be used as part of the string, and replace will happen in the jmeter engine. In other cases, the variables must be taken from the context in the vars.get style.
  4. name-less with a description is better, it is faster and takes up less space.
  5. Yes, using .children () is more convenient for implementing custom builders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants