Has anyone any experience of setting up a CI server (team city for preference) to manage the creation of a virtual machine, deploying a package to the machine, getting the database to a known configuration then running integration tests. Tearing down the whole thing and reporting back to Team city the test status?
Continuous integration in five stepsGet a CI service to run those tests automatically on every push to the main repository. Make sure that your team integrates their changes everyday. Fix the build as soon as it's broken. Write tests for every new story that you implement.
Here's some quick definitions. Continuous Integration is the practice of testing each change done to your codebase automatically and as early as possible. Continuous Deployment follows the testing that happens during Continuous Integration and pushes changes to a staging or production system.
For Continuous Integration testing, open source tools like Selenium and Appium are most popular for automating tests. Additionally, tools like CrossBrowserTesting can also be used to execute test automation and create an environment for continuous testing in the cloud.
Jenkins. Jenkins is a well-known and most common Continuous Integration tool that is easily available. Based on various comparisons, Jenkins tops the list. Jenkins is an open-source continuous Integration server-based application that allows developers to build, automate and test any software project at a faster pace.
We do something like this, we have three types of tests. Unit tests which I am sure you are aware of but we also run a number of Acceptance Tests and Integration Tests and it is the latter to that are relevant.
In our integration tests we run a series of WatiN tests against our QA environment which is known to have an environment already running on it, these are usually run after TeamCity runs a deployment build to the QA environment. These tests do a full integration against all our external third parties.
What you might be more interested in is our Acceptance Tests but point to note we do not spin up a virtual environment (more on that later). We have a series of acceptance tests that spin up all the services in their own application domains and deploy database using visual studio database projects. Because these are acceptance tests all third party interfaces are mocked. Since the services are spun up in process the only thing to clean up at the end are the databases.
This works for us but I have been considering taking it to the next level with out integration tests and spinning up a virtual environment that looks exactly like our live environment down to domain names and IP addresses and this is entirely feasible but will be time consuming to do but will depend on the flavor of virtual environment you plan on using.
Here is an answered SO question on how to spin up Hyper-V servers using MSBuild but I am sure there are other examples using Ant/Nant/Rake for Hyper-V/VMWare etc.
How can I create virtual machines as part of a build process using MSBuild and MS Virtual Server and/or Hyper-V Server Virtualization?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With