I would like to be able to assign a specific number of licenses to two Jenkins installations.
For example:
* Jenkins server 1 (Final software tests) gets 10 licences to run at night
* Jenkins server 2 (Beta software tests) gets 8 licences to run at night
We use a floating licensing configuration. Can this be done?
How to distibute licenses.
- WilcoRakhorst
- Posts: 6
- Joined: Tue Nov 04, 2014 2:20 pm
How to distibute licenses.
A test employee does not break it. He only proves it was already broken.
Re: How to distibute licenses.
Hi,
Generally, the machines on which the tests get executed, need access to your license server where the floating licenses are installed.
If you run one test after the other, you will only need one floating runtime license. If you want to execute multiple tests at the same time, each test needs its own floating runtime license.
You can simply download the license manager on one of your machines in your network and install all your floating licenses on this machine.
All machines in the same network will be able to lease licenses for running tests. As soon as a test ends, the license will be released.
regards, qwertzu
Generally, the machines on which the tests get executed, need access to your license server where the floating licenses are installed.
If you run one test after the other, you will only need one floating runtime license. If you want to execute multiple tests at the same time, each test needs its own floating runtime license.
You can simply download the license manager on one of your machines in your network and install all your floating licenses on this machine.
All machines in the same network will be able to lease licenses for running tests. As soon as a test ends, the license will be released.
regards, qwertzu
Re: How to distibute licenses.
Hi,
Additionally, to what qwertzu suggested, I would suggest to implement WaitForValidLicense to all your projects. See this post:
web-license-manager-t10286.html#p41281
This will assure that the test will not fail (immediately) if there is currently no license available
Additionally, to what qwertzu suggested, I would suggest to implement WaitForValidLicense to all your projects. See this post:
web-license-manager-t10286.html#p41281
This will assure that the test will not fail (immediately) if there is currently no license available
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
- WilcoRakhorst
- Posts: 6
- Joined: Tue Nov 04, 2014 2:20 pm
Re: How to distibute licenses.
Thank you both for replying.
We have 1 licensing server available. On this machine are all our licenses (RT + premium) installed. Our Jenkins configuration is running multiple scripts simultaneously. So when a script is executed it will wait if a license is available. And yes Odklizec, we have the WaitForValidLicense implemented, which is very useful!
What I would like to achieve is that each Jenkins configuration can only use 50% of the licences. I don't want a Jenkins configuration to use all the licenses during the night. If it does, I don't know my test results for the other Jenkins configuration in the morning.
We run our tests nightly on Final and Beta software. In the morning the test results are reviewed. And this is why I don't want a Jenkins configuration to take up all of the licenses. Because when it does, the other Jenkins configuration will not be ready in the morning.
For your information, each Jenkins configuration runs around 200 test scripts. We have this configured so it runs a lot of tests simultaneously, because we have multiple licenses for this.
I hope I made my case clear (enough).
We have 1 licensing server available. On this machine are all our licenses (RT + premium) installed. Our Jenkins configuration is running multiple scripts simultaneously. So when a script is executed it will wait if a license is available. And yes Odklizec, we have the WaitForValidLicense implemented, which is very useful!
What I would like to achieve is that each Jenkins configuration can only use 50% of the licences. I don't want a Jenkins configuration to use all the licenses during the night. If it does, I don't know my test results for the other Jenkins configuration in the morning.
We run our tests nightly on Final and Beta software. In the morning the test results are reviewed. And this is why I don't want a Jenkins configuration to take up all of the licenses. Because when it does, the other Jenkins configuration will not be ready in the morning.
For your information, each Jenkins configuration runs around 200 test scripts. We have this configured so it runs a lot of tests simultaneously, because we have multiple licenses for this.
I hope I made my case clear (enough).
A test employee does not break it. He only proves it was already broken.
Re: How to distibute licenses.
Hi,
In my opinion, you will have to use two license servers and instruct each Jenkins machine to use one of them? I don't think there is a way to achieve what you want, with single license server.
In my opinion, you will have to use two license servers and instruct each Jenkins machine to use one of them? I don't think there is a way to achieve what you want, with single license server.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
- WilcoRakhorst
- Posts: 6
- Joined: Tue Nov 04, 2014 2:20 pm
Re: How to distibute licenses.
I already thought it would come to that. Thanks for your advice!
A test employee does not break it. He only proves it was already broken.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to distibute licenses.
Hi guys,
We recently faced an issue using the WaitForValidLicense() when triggering the test executable via CMD and the "/agent:" parameter. This causes the WaitForValidLicense() method to be called twice. Once before the actual deployment to your remote machine (agent) and once on the remote machine itself.
Here's the solution:
Robert
We recently faced an issue using the WaitForValidLicense() when triggering the test executable via CMD and the "/agent:" parameter. This causes the WaitForValidLicense() method to be called twice. Once before the actual deployment to your remote machine (agent) and once on the remote machine itself.
Here's the solution:
//You could use the following code to limit the license check to your agent machine: public static int Main(string[] args) { bool licenseAvailable = false; var commandParams = CommandLine.EnvironmentCommandLine.Parameters; if (!commandParams.ContainsKey("a") && !commandParams.ContainsKey("agent")) { Console.WriteLine("License check ..."); licenseAvailable = ElementEngine.WaitForValidLicense(new Duration((int)600E+3), new Duration((int)5E+3)); if(licenseAvailable) { Console.WriteLine("License available..."); } }Sincerely,
Robert
Re: How to distibute licenses.
I believe that I have exactly the problem described above.
Here are some key data:
- I got one Floating License
- Ranorex Version: 9.0.1
I've tried to add the license check with "WaitForValidLicense(), until i found this post. Then i tried to implement the solution from above, but that doesn't work... maybe I'm doing something wrong.
I can run the test on my VM development machine using a batch script , but I can't run a test with an Agent on my test VM mashine.
And I can run the tests on the VM test mashine with a batch script too.
Here are some key data:
- I got one Floating License
- Ranorex Version: 9.0.1
I've tried to add the license check with "WaitForValidLicense(), until i found this post. Then i tried to implement the solution from above, but that doesn't work... maybe I'm doing something wrong.
I can run the test on my VM development machine using a batch script , but I can't run a test with an Agent on my test VM mashine.
And I can run the tests on the VM test mashine with a batch script too.
Re: How to distibute licenses.
Hi,
So have you tried the workaround code posted by Robert? This code should fix the problem with license check, while using /agent parameter.
So have you tried the workaround code posted by Robert? This code should fix the problem with license check, while using /agent parameter.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to distibute licenses.
Yes, I tried.
I am not an expert on coding, I've tried this Code to add :
I am not an expert on coding, I've tried this Code to add :
Code: Select all
[STAThread]
public static int Main(string[] args)
{
bool licenseAvailable = false;
var commandParams = CommandLine.EnvironmentCommandLine.Parameters;
if (!commandParams.ContainsKey("a") && !commandParams.ContainsKey("agent"))
{
Console.WriteLine("License check ...");
licenseAvailable = ElementEngine.WaitForValidLicense(new Duration((int)600E+3), new Duration((int)5E+3));
if(licenseAvailable)
{
Console.WriteLine("License available...");
}
}
....
Re: How to distibute licenses.
I found the problem. It's my Popupwatcher, if i uncomment Popupwatcher, my Tests works...
can someone please check it?
can someone please check it?
Code: Select all
namespace TEST
{
class Program
{
// repository
public static TEST.TESTRepository repo = TEST.TESTRepository.Instance;
[STAThread]
public static int Main(string[] args)
{
// License check
bool licenseAvailable = false;
var commandParams = CommandLine.EnvironmentCommandLine.Parameters;
if (!commandParams.ContainsKey("a") && !commandParams.ContainsKey("agent"))
{
Console.WriteLine("License check ...");
licenseAvailable = ElementEngine.WaitForValidLicense(new Duration((int)600E+3), new Duration((int)5E+3));
if(licenseAvailable)
{
Console.WriteLine("License available...");
}
}
// PopupWatcher
PopupWatcher myPopupWatcher = new PopupWatcher();
myPopupWatcher.Watch(repo.Main.Titlebar.MaximierenInfo, PopupHandler);
myPopupWatcher.Watch(repo.Main.VorhandenInfo, PopupHandler);
myPopupWatcher.Watch(repo.Main.BankInfo, PopupHandler);
myPopupWatcher.Watch(repo.Main.TitleMeldungInfo, PopupHandler);
myPopupWatcher.Start();
Keyboard.AbortKey = System.Windows.Forms.Keys.Pause;
int error = 0;
try
{
error = TestSuiteRunner.Run(typeof(Program), Environment.CommandLine);
}
catch (Exception e)
{
Report.Error("Unexpected exception occurred: " + e.ToString());
error = -1;
}
return error;
}
/// <summary>
/// Popupwatcher
/// </summary>
/// <param name="myInfo"></param>
/// <param name="myElement"></param>
public static void PopupHandler(Ranorex.Core.Repository.RepoItemInfo myInfo, Ranorex.Core.Element myElement)
{
if(myInfo == repo.Main.Titlebar.MaximierenInfo)
{
repo.Main.Titlebar.Maximieren.MoveTo();
Delay.Duration(100);
repo.Main.Titlebar.Maximieren.Click();
}
else if(myInfo == repo.Main.VorhandenInfo)
{
repo.Main.ButtonOK.MoveTo();
Delay.Duration(100);
repo.Main.ButtonOK.Click();
}
else if(myInfo == repo.Main.BankverbindungInfo)
{
repo.Main.ButtonOK.MoveTo();
Delay.Duration(100);
repo.Main.ButtonOK.Click();
}
else if (myInfo == repo.Main.TitleMeldungInfo)
{
repo.Main.ButtonOK.MoveTo();
Delay.Duration(100);
repo.Main.ButtonOK.Click();
}
}
}
}
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to distibute licenses.
Hi Johann,
I would recommend to start the popup watcher as part of your test suite.
Simply add a code module to your SETUP region within your test suite and add the code there.
Sincerely,
Robert
I would recommend to start the popup watcher as part of your test suite.
Simply add a code module to your SETUP region within your test suite and add the code there.
Sincerely,
Robert
Re: How to distibute licenses.
It helped, thank you Robert.