Commit c241017d authored by Laurent Peuch's avatar Laurent Peuch
Browse files

feat(qa): add readthedocs testing

parent bf47aea9b45d
Pipeline #12905 passed with stages
in 3 minutes and 28 seconds
......@@ -109,4 +109,13 @@ table.qa .true {
table.qa .false {
background-color: lightsalmon;
}
table.qa td.readthedocs {
text-align: center;
}
table.qa td.readthedocs a {
text-decoration: none;
font-style: italic;
}
\ No newline at end of file
#!/usr/bin/env python3
import os
import requests
import gitlab
import jinja2
import tempfile
......@@ -31,6 +32,10 @@ for number, cube in enumerate(all_cubes):
has_readme_rst = bool({"README.rst", "README.md"} & cube_files) # set intersection
has_doc = bool({"doc", "docs"} & cube_files) # set intersection
if cube.name.startswith("cubicweb-"):
has_readthedocs = requests.get(f"https://{cube.name}.readthedocs.io").status_code == 200
else:
has_readthedocs = requests.get(f"https://cubicweb-{cube.name}.readthedocs.io").status_code == 200
if has_tox:
tox_content = cube.files.get("tox.ini", ref="branch/default").decode().decode("Utf-8")
......@@ -63,6 +68,7 @@ for number, cube in enumerate(all_cubes):
context["cubes"].append({
"cube": cube.attributes,
"has_doc": has_doc,
"has_readthedocs": has_readthedocs,
"has_tox": has_tox,
"has_gitlab_ci": has_gitlab_ci,
"has_readme_rst": has_readme_rst,
......
......@@ -5,6 +5,7 @@
<th>gitlab-ci</th>
<th>README.rst/md</th>
<th>doc</th>
<th>readthedocs</th>
<th>py2 tests</th>
<th>py3 tests</th>
<th>check manifest</th>
......@@ -22,6 +23,15 @@
<td class="{{ "true" if cube["has_gitlab_ci"] else "false" }}"></td>
<td class="{{ "true" if cube["has_readme_rst"] else "false" }}"></td>
<td class="{{ "true" if cube["has_doc"] else "false" }}"></td>
{% if cube["has_readthedocs"] %}
<td class="true readthedocs">
<a href="https://{{ "cubicweb-" + cube["cube"]["name"] if not cube["cube"]["name"].startswith("cubicweb-") else cube["cube"]["name"] }}.readthedocs.io" target="_blank">
link
</a>
</td>
{% else %}
<td class="{{ "false" if cube["has_doc"] else "" }}"></td>
{% endif %}
{% if cube["has_tox"] %}
<td class="{{ "true" if cube["has_py2_tests"] else "" }}"></td>
<td class="{{ "true" if cube["has_py3_tests"] else "false" }}"></td>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment