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

Eliminate Testcase Mapping for Basic Setups #544

Open
rschwietzke opened this issue Dec 30, 2024 · 0 comments
Open

Eliminate Testcase Mapping for Basic Setups #544

rschwietzke opened this issue Dec 30, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request PRIORITY: HIGH

Comments

@rschwietzke
Copy link
Contributor

rschwietzke commented Dec 30, 2024

Motivation

Right now, we have to always map test cases to scenarios. This is error prone but powerful. For most standard use cases, this is not needed.

# The normal setup in our default or project properties or similar files
com.xceptance.xlt.loadtests.CartScenario.class = com.xceptance.loadtest.site.tests.TAddToCart
com.xceptance.xlt.loadtests.TAddToCart.class = com.xceptance.loadtest.site.tests.TAddToCart
# In the load test setup for the execution
com.xceptance.xlt.loadtests = TAddToCart

This makes this class available as CartScenario and TAddToCart. The latter is the most used setup, and hence rather superfluous.

Goal

Remove the standard setup requirement and make classes available under their simple class name by default.

Non-Goal

We don't want to make intelligent choices for users. If they have a questionable setup, we bail out.

Requirements

When the load test scenario list declares an unmapped(!) test scenario, we attempt to look it up in the current classpath of the project. This data is "memorized" or better auto-mapped and supplied to the setup so that this look up has only to be done once.

Or in English: Automap the scenario to a class without the user having to do that. Keep the mapping feature as it is because there are advanced use cases of multi-mapping that are very valuable.

Steps

The logic goes like this.

com.xceptance.xlt.loadtests = TAddToCart
  • If we encounter a scenario name, check if we have a mapping
  • If we have a mapping, we stop here and things are the same as before from here
  • If the mapping is incorrect, complain but DON'T try to fix it automatically
  • If there is not mapping, assume that this scenario name is also the simple classname and search it in the classpath fully.
  • If we find it only once, auto map it and supply this information also to the agents.
  • If we dont't find it, stop the setup and complain (similar to the missing mapping right now)
  • If we find it more than once, complain too

Collisions

We bail out without trying to find out if this is a runnable test class if we find the same simple class name twice. The test setup/start is terminated with an appropriate message.

Found but incorrect

If the found class is not a test class, we fail later. Similarly to a currently incorrect setup with a mapping pointing to a non-test class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PRIORITY: HIGH
Projects
None yet
Development

No branches or pull requests

2 participants