We currently have automated tests that are run using MSTest and a .testsetting file that specifies the files to deploy with the automated test run category. Everything works fine, but now we are looking at using more than 1 resource (which is described by a file to be deployed with the automated test run category), and the difficulty that comes is that we do not know in advance what resource might be needed (will be decided at run time).
So, for example, we have a loop that goes through all the test category and asks a resource manager entity what resource is available (pending some attributes, number of required resource, etc). If the resource is available, then it gives it, if not, it waits until it is free and carries on to the next request for another test category.
If a test category only needs a resource, there is no problem as we have 1 .testsettings file per resource. So for that test category and that resource, we can just use that .testsettings file to deploy.
Unfortunately, this does not work for when we would need 2 resources for a test run: we would get back the 2 files describing that resource, and 2 .testsettings file (one for each of those resources). We would either need to:
- For each resource we have, create 1 .testsetting file for each (we already have that), and ON TOP of that, create 1 testsetting file for each combination of resources, which is not very scalable, and would create problems if we eventually need 3, 4, 5, 6, resources per test category.
- Dynamically create a .testsettings file once the resource manager has returned us the 2 (or more) available resources we need. a .testsettings file after all is just an xml file, so we could manually write the deployment section to include the right resource description files once we know which one will be used. The only part which I am unsure is that there are some IDs in a .testsettings file and I am unsure if just creating a random one ourselves would cause problems? With this solution, our workflow would be something like:
parse test category requirements -> ask resource manager for resource matching those requirements -> we get resources required -> write dynamically a .testsettings file -> launch mstest with that dynamically created .testsettings file.
I wanted to know if solution 2) would create any problems, and if there is another solution to which I have not thought of in our current situation?
Aucun commentaire:
Enregistrer un commentaire