How to use python build script with teamcity CI? - c++

I am currently researching using the TeamCity CI software for our comapanies CI automation needs but have had trouble finding information about using different build scripts with TeamCity. We have C++ projects that need to have build/test automation and we currently have licenses for TeamCity. I have looked into using scons for the build automation but havent been able to find much information about using a python build script with TeamCity. If anyone could provide information about this to a CI beginner would be much appreciated.
Thanks

We use TeamCity to run our acceptance test suite (which uses Robot Framework - done in python).
Getting it to run was as simple as wrapping the python call with a very simple NAnt script. It does 2 things:
Uses an exec task to run python with the script as an argument.
Gets the xml output from the build and transforms it into something teamcity can understand.
There are probably tasks to run python scripts directly with NAnt but we've not had to use them - it was pretty easy to get up and running. You could do the same sort of thing using Ant or whatever depending on what your platform was.

Related

How do I make a testing stage in AWS codepipeline?

I am learning AWS code pipeline and code build, I have a project(Angular App) where I am building and deploying it. But I also have a testing script that I was to run at a different stage.
I am doing testing using Karma and Jasmine.
The structure/stages I want is.
Source
Test //This is what I want to have
Build
Deploy
Question is, how do I do that? I have buildspec.yml file in the code build project, but that is oriented towards building the project and not testing it, so do I create a new code build project just to test it?
It would be amazing if I could use another buildspec.yml just for testing.
Anyone who is also running testing pipelines, help me out.

What is the best practice to zip the build results, by build scripts or build tools?

I'm writing my only build scripts and setup jenkins, Jenkins provide plugins to zip the build results, meanwhile I can zip the result in my own build scripts and call that scripts from Jenkins. Which way is better?
If you are in a corporate environment where a number of teams share the same Jenkins master, each plugin you add increases the probability of a plugin failure as and when you upgrade Jenkins. In addition, a bad plugin can bring down your entire CI server. So, in a common master scenario, be very conservative on adding plugins, don't add a plugin unless it is absolutely necessary. For something as simple as creating zips, any build tool worth its salt has a task that can zip contents in a given folder. Read through Maven and Gradle for a start.

UWP unit testing with Jenkins

It is not really an issue I would like to ask today but I search best practices to unit testing a UWP application with Jenkins.
First, I created a Unit Test App for my main application and, on my development machine, I generated appx package using MSBuild command line tool. It works well and I can also execute unit tests with the VS Test console.
Then I tried to automate it with Jenkins on my build server. But the MSBuild command does not work. I have no issue but it produces no output. After lot of research (without any success), my question is the following:
What is the best way to make UWP unit testing with a result dashboard using Jenkins?
Thanks
In order to make MSBuild work correctly, I had to create two subsequent build steps, one with command line argument:
-t:restore
in order to make it restore all the nuget dependencies, and a second one with command line arguments:
/t:Rebuild /p:Configuration=Release
/p:UapAppxPackageBuildMode=StoreUpload
for the real release compilation and the creation of both sideload and storeUpload msix files

How to distinguish maven and gradle from Travis logs using regexp

Context: I'm currently working on a research tool which needs to mine on Travis API to get information on builds from thousands of projects on Github. I want to find the best way to recognize if the projects are using Maven or Gradle as building tool.
I retrieve logs from Travis Builds and parse them, for now I'm using the following pattern for maven:
^(-------------------------------------------------------|\[INFO\] Reactor Summary:)$
and this one for gradle:
^(:[\w-]+)?:test[\w-]*$
Problem is I found everyday new projects that do not fit those regexp: then do you have any idea to improve them to spot a maximum of projects without false positive?
Edit: I'm mostly interested in projects which launch tests, that's why I started with those regexp.
This might be useful to you... a project which switched from maven to gradle
tader building with maven
tader building with gradle
Perhaps you could have a regex that says
If "mvn" appears in the logs before "gradle" or "gradlew" then it's a maven project
If "gradle" or "gradlew" appears before "mvn" then it's a gradle project

Adding test cases to TeamCity

I have written some automated test cases in java (selenium IDE)for a project.The project is using ruby on rails. The project was configured in TeamCity. Now I am planning to add these test cases as a build step. How can I achieve this. Which build step should I use.
How do you run them on your local machine?
If you run them from command line you can create build configuation with Command Line runner.If you run them by running JUnit test you can create a build configuration that runs JUnit tests (using some build tools like Ant, Maven, Gradle).