Tag: python

ImportError: PyCapsule_Import could not import module “pyexpat”

I am using Jenkins to build a python (Flask) solution to deploy to Google App Engine. As part of the build process I run a few integration tests. One of them is failing with the following error. ERROR: Failure: ImportError (PyCapsule_Import could not import module “pyexpat”) ———————————————————————- Traceback (most recent call last): File “/usr/local/lib/python2.7/dist-packages/nose-1.3.6-py2.7.egg/nose/loader.py”, line […]

Can Jenkins handle an gui/non-gui interactive python or java program?

I want to create a build pipeline, and developers need to set up a few things into a properties file which gets populated using a front end GUI. I tried running sample CLI interactive script using python that just asked for a name and prints it out afterwards, but Jenkins just waited for ages then […]

Behave test runner has no colored output on Jenkins

I have setup jenkins on Ubuntu server 14.04 on an EC2 instance. I have some selenium tests that I execute using behave as test runner. On Jenkins I have also installed the plugin AnsiColor hoping that I can get color output on the jenkins console, however I get color for everything else except for the […]

Print out hyperlink in Jenkins console output using Python

I am triggering a python script through a Jenkins job, and would print a hyperlink in the Jenkins console output. Is there a Jenkins plugin or python module I can use to achieve this. From a test script, I tried doing this – echo ‘print “http://www.google.com>Google”‘ but on console output it simply displays that as […]

POSTing file to Jenkins fails

I’m trying to POST a file to Jenkins from Python, via multipart/form-data. The request body looks like this: –===============1849003312== Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: file; name=”file0″; filename=”meta.xml” PHhtbD4NCjwveG1sPg0K –===============1849003312==– This causes Jenkins to raise an exception on its end however, the most relevant bits of which follow: Exception: <br>Stacktrace: <pre>org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:381) […]

How to list all unused jenkins plugins?

I am looking for method to check which jenkins plugins are not used. So far I found that I can look for tags in config.xml file with attribute plugin then compare them with the ones listed in plugins directory. But that does not give me complete list. Still some are not there like role-strategy. I […]

Python script to generate JUnit report from another testing result

I have an acceptance test case, the result is plain text. I want to use Jenkins to show the result, and the JUnit format is suitable for me. So I want to check whether there is existing python code to generate JUnit-format XML, so that I can easily just add my parsing code. Related question.

Bash: how to implement locking in a multi process system?

We are running lots of jenkins projects in parallel. We are using python, and we have chosen to manage the virtual environments with pyenv. Unfortunately, pyenv has a well-known race condition. To work around the problem, I would like to implement locking at the process level. What I want to do is: lock some resource […]

How to deal with sporadic BadStatusLine, CannotSendRequest errors in python WebDriver

Since we started running selenium UI tests in jenkins, we noticed a small but annoying frequency of errors during tests. We get BadStatusLine and CannotSendRequest errors on seemingly random selenium actions (click, quit, visit, etc.). They would usually look something like: File “/usr/lib/python2.7/unittest/case.py”, line 327, in run testMethod() File “/home/jenkins/workspace/Create and Upload Functional Testing/shapeways/test_suite/Portal/CreateAndUpload/TestUploadWhenNotLoggedIn_ExpectLoginModal.py”, line […]

Fetching a URL from a basic-auth protected Jenkins server with urllib2

I’m trying to fetch a URL from a Jekins server. Until somewhat recently I was able to use the pattern described on this page (HOWTO Fetch Internet Resources Using urllib2) to create a password-manager that correctly responded to BasicAuth challenges with the user-name & password. All was fine until the Jenkins team changed their security […]

Git Baby is a git and github fan, let's start git clone.