Run " build" on all capable agents
In addition to using TeamCity for our builds and deployments, we are also using it as a scheduler to run Test Complete automated testing.
Here is how we have things set up right now:
- Build Occurs on develop
- This triggers a deployment as a dependency which builds our product installer (NSIS)
- This then triggers a dependency “build” to run Test Complete script to do a basic test of our installer to ensure the product installs correctly.
We then have a bunch of other scheduled tests that are run throughout the week on this installed version of our product.
This all works fine when we have only 1 build agent capable of running the Test Complete tests, as it's the same agent that had the installer test run on it.
The issue is when we need to scale up to more agents capable of running tests. We need to have the installer test (which deploys the code for the other tests to run against) run on all capable agents.
The application we are testing with Test Complete, its a Windows desktop application.
I've pondered how this can be achieved, but didn't really come up with anything. Anyone have any ideas?
Thanks.
Please sign in to leave a comment.
As I understand, you have a build configuration that installs software on the machine where it runs, and another build configuration that utilizes (tests) this installed software.
I suggest adding the build steps that install the software to the tests build configuration, and finding a way to skip these installation steps if the software is already installed. So, if it's not installed on the agent, it will be installed.
For example, the installation script may modify an environment variable on the agent and record the version of the installed product there. This environment variable may then be used in the step execution condition to decide if the installation step should be skipped or executed: https://www.jetbrains.com/help/teamcity/build-step-execution-conditions.html
Will it work for your scenario?
Best regards,
Anton
Many thanks for the suggestion. This could work, however I can see a potential issue, which I am unsure if there is a way forward.
Best regards,
Anton
Thanks, looked at that page, but it's unclear how I would set a value in the root project via a plan, so it can be read later by a unrelated plan.
Is this via Output parameters? Or do I need to create a placeholder variable in a common ancestor project (e.g. Root) and set it via script as a build step?
I think I understood the problem you encountered.
I will update my initial idea with some details. I think that it should work for your case:
1. A build configuration installs software. The installation script modifies an environment variable on the agent and records the version of the installed product in that variable.
2. The test build configuration has a parameter 'version' defined.
3. The version that is being tested should be in the repository.
4. In the first build step of the test build configuration, the value of the parameter 'version' may be set with a service message: https://www.jetbrains.com/help/teamcity/service-messages.html#set-parameter
The value is taken from the repository.
5. Next, the test build configuration has the same steps that install the software.
6. They are conditional, and the condition compares the value of the 'version' parameter with the environment variable on the agent.
Please let me know if my understanding is correct and if it suits your scenario.
Best regards,
Anton