We are working on a project and Im involved in continuous integration testing.
I need to
deploy the new project code on a staging server, not using Jenkins, but ftp;
after the deploy an email is sent to indicate successfull deploy and we need it to start my integration tests;
integration tests, if successfull, will start a deploy on integration server.
I am going to write a java program that will login to Jenkins and execute the integration tests.
Question is: how can the email message activate the java program?
EDIT: Normally, jenkins offers a feature that starts a job after getting an email, but we are having a security problem with that
Make a program or script which will peridically poll a mail server box and upon getting an appropirate email will run another java program.
Please read Jenkins documentation thoroughly. If you are using a version control system, Jenkins can automatically pull the code and run test cases on it. You can notify Jenkins using various methods... including webhooks.
Do go through various plugins for Jenkins.
Update:
I have not used this myself. But looks like this is what you want: Mail Commander Plugin
And the command you send can be something like this:
curl --data '' http://<server>:<port>/job/<projectname>/build
Related
I'm just learning cucumber for test automation, and would like to know if it's possible to use it to debug the application the automation is for?
So basically I'd like to know if it can be used to debug the application being developed?
Thanks.
Les
Yes, as long as your running the instance of the application under test in debug mode you can set breakpoints and debug as you normally would when interacting with it manually. Cucumber does nothing that would prevent this.
You can start any java application (say you have prepared build for testing) with remote debugging enabled. So that your steps would be:
Start app you would like to test with remote debugging enabled (see docs here)
In IDE open that app sources and connect to that debugger port you have set up on step 1
Put some breakpoints
Run your cucumber tests
Since now as soon as your Cucumber tests will make your app hit break-point the service will stop and you will be able to manipulate the state through IDE.
P.S. - Since your Cucumber tests will be running separately in regular way, stopping the service at the breakpoint will lead to timeout error on client side after certain time of connection inactivity. Possible solution is to configure your client to accept longer pauses.
I have two Azure functions linked together. I want to test them locally using Rest Assured. But to do this, I have to manually run them every time before the tests. Is there any way to automate this moment? So that when the test starts, the service starts automatically.
You would have to include a step to start your application (function app) using Azure Functions Core CLI. If you do not have that already you have to set it up: https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Ccsharp%2Cportal%2Cbash%2Ckeda.
To start your application with command line you can use func host start. Posting a documentation for reference: https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Ccsharp%2Cportal%2Cbash%2Ckeda#start.
what is the easiest method to run a Java program inside a gear on OpenShift?
I don't need a complex framework or web server. I just need a container to which I can upload my Java Files, compile and execute them in the cloud. The application I have in mind is very simple, a program that gathers some information and that I can connect to via RMI and just ask for the data.
Thanks.
If you don't need an application server you'd better take a look at DIY cartridge. You'd just have to create it from your code:
rhc app-create yourapp diy-0.1 --from-code git://github.com/(...).git
You could even use git hooks to launch it. Take a look at the hooks I use at my Wedding Tables Planner web, based in this template.
I think easiest is tu run a jbossas app and stop the jbossas cart if necessary. Otherwise you may play with the diy app type.
I have java code (that generates jasper reports) and I couldn't convert it to .net and I want to run it on a "Cloud Services" how can I run java code into cloud service ?
any help will be appreciated
#Dhana provided a link to a tutorial for pushing a Java app to Azure in Cloud Services (worker role). You could also push to a Web role but it makes less sense since IIS runs in a Web role, and you'll probably want Jetty, Tomcat, or JBoss for your web server.
If you're running a console app, that's fine too - just launch it from a startup script or the OnStart() in your workerrole.cs.
You'll need to install the tooling into Eclipse. At this point, you'll be able to build Azure deployment packages, in a similar way to Visual Studio (The Azure plugin for Eclipse only works on Windows though). Part of the packaging sets up links to the appropriate JVM and web server package, as well as your own jar files.
If, say, you have a console app that listens on a port, you'll just need to make sure you have an input endpoint set up for the port you want to expose.
Can I use Jenkins to test to see if a VM(server) is up and running? We have alot of VMs(servers) with JBoss, LDAP, MySQL etc on them and I would like to know if I can somehow have Jenkins ping a server to see if the SA shut it down or something..
I was thinking of using a selenium test. I was going to have a Maven project with a selenium java test in it to check of the server is up. but how can I tell Jenkins to run the test every hour and do you think this is the right way to go?
I would say the simplest possible solution is to use Site Monitor plug-in.
It is simple, reliable and it also allows to reuse build status notifications, provided by your jenkins instance. The only limitation is you should have some http server up and running, but I bet you have at least default page available.
Configuration is simple:
Jenkins does not have a plugin for managing (or monitoring) VMs, AFAIK, but you can use Perl or PowerShell for that - both have a good set of tools for that.
Let that tool return error when the server is not available, and you can even use the API to boot a hosted machine.
Cheers