Skip to content

Instantly share code, notes, and snippets.

@Phyks
Last active November 29, 2016 22:52
Show Gist options
  • Select an option

  • Save Phyks/893f5c15d269bfa1693fc033c4c3ae89 to your computer and use it in GitHub Desktop.

Select an option

Save Phyks/893f5c15d269bfa1693fc033c4c3ae89 to your computer and use it in GitHub Desktop.
{
"modules": {
"skipped": [
"presseurop",
"mangareader",
"edf",
"mangago",
"adecco",
"indeed",
"googletranslate",
"seloger",
"francetelevisions",
"btmon",
"apivie",
"barclays",
"t411",
"razibus",
"lyricsdotcom",
"marmiton",
"cpasbien",
"nectarine",
"caels",
"vlille",
"aum",
"chronopost",
"canalplus",
"apec",
"piratebay",
"jacquieetmichel",
"ipapi",
"simplyreadit",
"dailymotion",
"linuxjobs",
"ouifm",
"mailinator",
"wellsfargo",
"amazon",
"phpbb",
"lcl",
"fourchan",
"pastebin",
"amazonstorecard",
"mediawiki",
"jvmalin",
"champslibres",
"meteofrance",
"citibank",
"yomoni",
"pastealacon",
"dpd",
"imgur",
"inrocks",
"mangahere",
"ups",
"mangafox",
"myhabit",
"cuisineaz",
"vicsec",
"vine",
"nolifetv",
"ideel",
"kickass",
"batoto",
"jcvelaux",
"arretsurimages",
"delubac",
"axabanque",
"prixcarburants",
"bforbank",
"pariskiwi",
"mareeinfo",
"parolesnet",
"ilmatieteenlaitos",
"tinder",
"monster",
"lacentrale",
"paroles2chansons",
"btdigg",
"somafm",
"popolemploi",
"openedx",
"creditcooperatif",
"transilien",
"kiwibank",
"ameli",
"vicseccard",
"alloresto",
"senscritique",
"itella",
"boursorama",
"gls",
"geolocip",
"audioaddict",
"trictractv",
"creditmutuel",
"dlfp",
"gazelle",
"afer",
"ipinfodb",
"nettokom",
"agendaculturel",
"cragr",
"weather",
"amundi",
"hybride",
"parolesmania",
"quvi",
"poivy",
"bouygues",
"canaltp",
"liberation",
"happn",
"freemobile",
"pornhub",
"carrefourbanque",
"nova",
"amelipro",
"logicimmo",
"opensubtitles",
"leclercmobile",
"arte",
"virginradio",
"residentadvisor",
"twitter",
"bnporc",
"blablacar",
"allocine",
"caissedepargne",
"paypal",
"yahoo",
"ehentai",
"creditdunord",
"youporn",
"taz",
"sueurdemetal",
"biplan",
"feedly",
"cic",
"wordreference",
"hds",
"dresdenwetter",
"vimeo",
"guerrillamail",
"hsbc",
"ebonics",
"supertoinette",
"explorimmo",
"imdb",
"lyricsplanet",
"rmll",
"radiofrance",
"opacwebaloes",
"fortuneo",
"nihonnooto",
"allrecipes",
"americanexpress",
"cappedtv",
"creditdunordpee",
"ing",
"ina",
"attilasub",
"pap",
"voyagessncf",
"banqueaccord",
"dhl",
"leboncoin",
"s2e",
"torrentz",
"eatmanga",
"societegenerale",
"tvsubtitles",
"playme",
"groupamaes",
"entreparticuliers",
"citelis",
"ovs",
"banquepopulaire",
"pixtoilelibre",
"sfr",
"parolesmusique",
"ovh",
"n26",
"lefigaro",
"github",
"ganassurances",
"manpower",
"agendadulibre",
"lutim",
"bred",
"youtube",
"regionsjob",
"unsee",
"minutes20",
"youjizz",
"podnapisi",
"cci",
"sachsen",
"lolix",
"newsfeed",
"lyricsmode",
"funmooc",
"gdfsuez"
]
},
"others": [
"<test.SevenFiftyGramsTest testMethod=test_recipe>"
]
}
import collections
import json
import sys
import xunitparser
def main(xunit):
with open(xunit, "r") as fh:
ts, tr = xunitparser.parse(fh)
# Get test results for each module
modules = {}
other_testcases = []
for tc in ts:
if not tc.classname.startswith("modules."):
other_testcases.append(repr(tc))
continue
module = tc.classname.split(".")[1]
# In the following, we consider
# good > skipped > bad
# and only make update of a module status according to this order
if tc.good:
if tc.skipped:
# Set to skipped only if previous test was good
if module not in modules or modules[module] == "good":
modules[module] = "skipped"
else:
# Set to good only if no previous result
if module not in modules:
modules[module] = "good"
else:
# Always set to bad on failed test
modules[module] = "bad"
# Agregate results by test result rather than module
results = collections.defaultdict(list)
for module in modules:
results[modules[module]].append(module)
return {
"modules": results,
"others": other_testcases
}
if __name__ == "__main__":
if len(sys.argv) < 2:
sys.exit("Usage: %s XUNIT_FILE" % (sys.argv[0]))
print(
json.dumps(
main(sys.argv[1]),
sort_keys=True, indent=4, separators=(',', ': ')
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment