Skip to content

Instantly share code, notes, and snippets.

@kumbasar
Created January 7, 2019 08:07
Show Gist options
  • Select an option

  • Save kumbasar/bec239e854fd76475518e08a264a8c0e to your computer and use it in GitHub Desktop.

Select an option

Save kumbasar/bec239e854fd76475518e08a264a8c0e to your computer and use it in GitHub Desktop.
A python script to get the junit data
#!/usr/bin/env python3
import requests
import urllib3
import json
from requests.auth import HTTPBasicAuth
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
JENKINS_URL = os.environ['JENKINS_URL']
JENKINS_API_TOKEN = os.environ['JENKINS_API_TOKEN']
JENKINS_USER = os.environ['JENKINS_USER']
resp = requests.get(JENKINS_URL, auth=HTTPBasicAuth(JENKINS_USER, JENKINS_API_TOKEN),verify=False)
data = resp.json()
print(str(data['failCount']))
print(str(data['passCount']))
print(str(data['skipCount']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment