From ca3b513c64c05a29ae0f530c91b04349417c4fa0 Mon Sep 17 00:00:00 2001 From: Steffen Hauf <haufs@max-exfl027.desy.de> Date: Fri, 16 Nov 2018 18:46:49 +0100 Subject: [PATCH] Add report copy to docs --- .gitignore | 1 + docs/source/conf.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 968dac8ff..e0414e68b 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ docs/build docs/source/_notebooks/* docs/source/test_rsts/* docs/source/test_results.rst +docs/source/_static/reports diff --git a/docs/source/conf.py b/docs/source/conf.py index c7af5401a..43dbf24bc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -586,16 +586,16 @@ with open("test_results.rst", "w") as f: # copy reports pdfs = glob.glob("{}/{}/*/*.pdf".format(test_artifact_dir, commit)) - if not os.path.exists("./_static/{}".format(commit)): - os.makedirs("./_static/{}".format(commit)) + if not os.path.exists("./_static/reports/{}".format(commit)): + os.makedirs("./_static/reports/{}".format(commit)) reports = {} for pdf in pdfs: ppath = "{}/{}.pdf".format(commit, uuid4()) - shutil.copyfile(pdf, "./_static/{}".format(ppath)) + shutil.copyfile(pdf, "./_static/reports/{}".format(ppath)) rloc = pdf.split("/")[-2] rlist = reports.get(rloc, []) rname = os.path.basename(pdf).split(".")[0] - rlist.append((rname, ppath)) + rlist.append((rname, "../_static/reports/{}".format(ppath))) reports[rloc] = rlist xmls = glob.glob("{}/{}/*/TEST*.xml".format(test_artifact_dir, commit)) -- GitLab