We have application which use Cucumber framework for testing our second application, the applications runs on own processes (black box testing), currently we do following steps:
1) Run DB
2) Run main application
3) Run test application which use Cukumber framework for testing main application
Question is: how we can do this automatically by using TeamCity ?
Create a Command Line build step:
Point to the working directory
Run your Cucumber tests from the command line. Example.
Here is more info on Cucumber's CLI.
My approach would be to write a script that sets up all dependencies. I.e. starting the database, starting the second application and then run the Cucumber stuff. The script would be possible to run on the CI server, i.e. TeamCity or on a developers system so it is easy verify that they didn't break anything before committing.
Restricting the execution to TeamCity only would not be my preferred approach.
This lead toa solution taht depends on your dev and CI environment. Are you running on Windows or on Linux? The scripts will different depending on the operating system.
Related
Hello everyone I am a grader for a programming language class and i am trying to use jenkins continuous integration for running some junit tests on their code that is pushed to github.
I was able to get all the committed jobs to the jenkins, but can i run a python file in order to push a testing class to their code and then build their projects an get an xml report about their program test...??
Jenkins allows you to run any external command so you can just call your Python script afterwards
Background: I'm trying to test a Hive query as part of our testing framework. I want to create short tests that test a small subset of the data in order for the queries to return fast, and be able to run them on every computer (even private laptops). The goal is to be able to just checkout the code, build using maven and run the tests.
Question: Is there a way for me to start a standalone hadoop (or some sort of simulator) only using java code, without downloads and installations that can be ran as part of the tests?
My goal is to have a test that in its #Before method set ups hadoop inside the tests which is deleted at the end of the test.
Have you looked at the MiniCluster apis (http://wiki.apache.org/hadoop/HowToDevelopUnitTests) ?
Here is a blog post that covers how to use the this API is some detail : http://www.lopakalogic.com/articles/hadoop-articles/hadoop-testing-with-minicluster/
It looks like what you might be looking for.
Take a look at HiveQLUnit - A open source project to unit test Hive.
Fast - It runs in memory through the use of HiveContext.
Standalone - Can run from your laptop/dexktop without server installations.
Maven Integration - Included in maven central and can be included easily as a maven dependency within your project.
JUnit Integration - Fully integrates with the JUnit unit testing framework
It also solves your problem of executing standalone unit tests from your favorite IDE.
It can execute unit tests from your favorite IDE on any operating system including Windows, Linux and Mac OSX. Here is some guidance around using HiveQLUnit - Documentation.
Note: I am affiliated with the HiveQLUnit OS project.
I have an eclipse application, where in i can create projects and perform some operations. I have written a test cases using Junit for some functions. To run these test functions, i am doing Right click on test class and Run as Junit Plug-in test and it is working properly. I am unable to do both the things at the same time. What i need is to run my eclipse application and Junit plug-in test simultaneously without human intervention. Junit plug-in test has to be done at run time. If there is a way to do that, then please suggest me the solution.
When you run it as Junit plugin test, then it already launches your eclipse plugins (and application), so there is absolutely no need to try to launch an additional application.
What probably confuses you, is that the test run and the "normal" manual run use two different workspaces. So if you try to access some files in your test which you created during normal operation, they will not exist. But you should never rely on such things, instead you have to create the necessary artifacts in the test setup method.
I have some ant scripts that create various things from the command line.
My command environment is complex, and we are doing some icky things I don't really want to do in eclipse, that won't really run from an ant script invoked inside eclipse. But if there is a way to have an ant script in eclipse start the server, that would be OK too.
Sometimes they take a while to run. It would be nice if when they were done, I could start my Java EE server inside eclipse. I happen to use JBoss 1.4.2 if that matters. I would like to start it in debug mode if possible. This way I could test without having to navigate to the server and start up debug from within eclipse as soon as my code finishes building. Is there any easy way to do this?
You can always manage your Application Server externally. by calling <JBOSS_HOME>/bin/run.(sh|bat) -b <ip_address> (JBoss 5) or <JBOSS_HOME>/bin/standalone.(sh|bat) -b <ip_address>
To start and stop your server from ant and having it appear as if you started it from within eclipse, that is a harder task. You would have to create a Run/Launch Configuration from within eclipse and then call it from ant see Launch an Eclipse Run Configuration from ANT
I am trying to run an automated suite every day at the same time, so I want to create a task to open eclipse and execute the main script every day. Is there a way to do this from the command line?
Instead of using eclipse for it, use a software that is dedicated for it - continous integration servers are created for it. Check such titles like: hudson, cruiseControl, TeamCity
You are on the wrong path. Instead of trying to automate opening eclipse, executing a main... break the IDE dependency, write a portable build script using Ant or Maven and execute that build script outside the IDE (using a simple cron job or something more elaborated like a Continuous Integration tool but I'm not sure you need a CI tool for now, start with the build script).
So I am assuming that you want to automate something that you run from inside eclipse. if it's a build then I'm with the other guys that using a build script and CI is the way to go.
But in case it's not that use case...
Now, if you are using the "Run.." dialogs to do this you can actually get the command line paths, binaries and arguments that eclipse used to execute.
What you do is open up the debug perspective. Then run your script however you normally do.
Your Process should appear in the "Debug View" at this point.
Either while the process is running or after termination, right click on the process and open up the properties. (you may need to click 1 level down in the tree to get this option)
Under process info, inside of that there is a section "Command Line". This is the exact command line that eclipse executed behind the scenes to run.
you should be able to put this into a script (.bat for windows / sh for *nix) and schedule accordingly.
edit: added in assumptions, changed to use process info terms which is what is on the properties screen.