-
Notifications
You must be signed in to change notification settings - Fork 59
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
Provide support to read files from directory like Directory Listing Config #247
Comments
This is really interesting, thank you for asking for this. I have a question: are the SQLs part of setup/teardown logic or are they part of actual load/performance test? If they are part of setup/teardown logic you might use existing test framework methods (like In the other case we might add String sqlFileVar = "SQL_FILE";
String queryVar = "QUERY";
String poolName = "pool";
testPlan(
// using directory listing plugin (https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/directory-listing/DirectoryListing.md)
directoryFilesDataSet(new TestResource("sqls"), sqlFileVar),
jdbcConnectionPool(poolName, Driver.class, "jdbc:postgresql://localhost/my_db")
.user("user")
.password("pass"),
threadGroup(1, 1,
jdbcSampler(poolName, "${" + queryVar + "}")
.children(jsr223PreProcessor(s ->
s.vars.put(queryVar, new TestResource(s.vars.get(sqlFileVar)).rawContents())))
)
).run(); If you have different query types (not just selects), you could use PS: as with |
Thank you for your quick and fast responses.
Attached Test Plan for reference: I run this as below using properties file as below: jmeter -t Test_Plan_Scale_UP_down_UTG.jmx -q connection.properties -q test.properties connection.properties: test.properties #Change below for Report dir path #Change below for concurrancy and test control QUERY_TIMEOUT=10 Note : The test plan i don't think fully converts to a valid DSL using the jmx converter |
Great, thank you for the detailed example and explanation! If you would like to try to implement and contribute the Another potential implementation might be something like:
This would make resulting test plan simpler but more effort to implement since it requires implementation of new JMeter test element. Regards |
We need support to read files from directory. The use case is to read sql files from a directory and execute it iteratively.
It will be great to make the support such that it provides similar properties to iterate only once or continue on EoF based on a flag.
This feature helps to create data driven testing, where the data files and possibly the expected results are in a directory. We can then create a test plan to read and compare the files based on the files present in the directory.
The text was updated successfully, but these errors were encountered: