How to integrate pycharm with jenkins? - python-2.7

I want to run my test suite from pycharm to run automatically whenever new build is released . We are using jenkins for CI. I want to integrate pycharm with jenkins but not sure how to do it.

What kind of test suite do you have? What kind of version control are you using? Where are you hosting your code?
PyCharm's Jenkins plugin will show you the status of your builds. But you'll still need to configure Jenkins to run your test suite. (There's a tutorial for setting up Jenkins for Python testing here: http://www.alexconrad.org/2011/10/jenkins-and-python.html)

Related

How to set up cypress run for TypeScript in WebStorm

I have a project build in TypeScript and I would like to use cypress run to run my unit test. Everything works when I trigger command line from terminal, but how can I set up cypress run with WebStorm IDE under Run/Debug Configuration? The only possibility is to set up npm command but my project is using pnpm not npm.
So how can I set up cypress run under Run/Debug configuration?
WebStorm doesn't provide any special support for Cypress (feel free to upvote and comment WEB-32819 to increase its priority and to be notified on updates). But you can still use Node.js run configurations to start your scripts.
I'd also suggest trying a third-party Cypress-Pro plugin

Can't run 'ng' from VSTS agent

I'm trying to run unit tests against our AngularCLI project using our hosted VSTS build agents however it keeps running into trouble when it tries to run 'ng test'.
To resolve this I have tried to make the agent use the ng tool directly by providing the path to the tool. This hasn't worked as it looks like it's trying to run 'ng test' where the tool is rather than in the specified current working directory:
I've also tried to add it as an environment variable in Windows (we're using Windows Server 2012 to host the VSTS agent) and setting the tool in the VSTS agent as just ng however it doesn't appear to be finding the ng tool:
How can I get the VSTS agent to make use of the ng tool to run tests? We have got #angular/cli installed on the server hosting the agent.
The thing is that you won't get angular cli installed on VSTS globally as its build server is not supporting that. But the good thing you not even need cli globally installed on your agent.
All you need is npm run ng build -- prod - this way it will always run the local version. Also this way you won't need to take care of updating your global package at all.
Use npm run ng test to run tests, npm run ng e2e to run protractor. If you need to pass any more params to any of these just use --
As mentioned by #Kuncevic, to use the Angular CLI without installing it globally, you will need to use the npm run command.
To run an Angular build using Azure Devops:
Add an npm task to install dependencies (choose install for the command)
Add another npm task, but choose custom for the command. Then add your command and arguments:
run ng -- build --output-path=dist --configuration=prod
Note how npm is not a part of the command and arguments since this will be provided by the task. Also note how -- separates the command to be run and the arguments to be passed to the command.

How to run selenium tests in jenkins?

I have selenium tests written in python 3.4. How to run them from jenkins after success build ?
Process is :
1. pull from git repository
2. python setup.py build
3. python setup.py install
After that i need to run server and selenium tests.
How to run them from jenkins after success build ?
- You can add a trigger to your selenium job so it runs after the build job runs successfully
To answer your question accurately, I need to know whether you are planning in running selenium tests in jenkins box...
Assuming you aren't planning in running the tests in jenkins (which IMO is something you dont want to) you can take 2 different directions:
1:. add a "execute shell" step to your build with the ssh to the machine you want to fire your tests on along with the command you need to run your tests in that machine. This would mean your pull from git to get latest code from selenium would have to happen in this step
2:. if you are outsourcing your browser execution to browserstack, sauce labs etc, add a "execute shell" step with the command needed to trigger your tests (firing from jenkins). This is assuming your tests know that it should point to outsourced env etc... You will most likely have a step to start a tunnel between your CI box and outsourced env...
Try using Selenium and Seleniumhq plugins for the same.
To add plugin : Manage Jenkins/ Manage Plugins/Available

How do I test django with gitlab ci

I have a gitlab-ci server that works fine and can connect with my gitlab server,Please can any one point me in the right directing on how to run my django unittest/builds using gitlab-ci runner thanks.
Sorry if answering a bit of an old question, but it seems that the general way to run a build is using a gitlab-ci runner; which seems to be an application which interacts with gitlab-ci API.
The way some people are running runners is with docker images (to "freeze" the build/test environment). See these links for basic information on how this works:
https://github.com/sameersbn/docker-gitlab-ci-runner
https://github.com/sameersbn/docker-runner-gitlab
https://github.com/sameersbn/docker-gitlab-ci
Finally see this python runner image for running builds on your python projects.

How to use python build script with teamcity CI?

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.