Skip to content

Commit 0b3936a

Browse files
BeyondEvilgnikonorovpre-commit-ci[bot]
committed
Update next-gen with recent changes to master (pytest-dev#494)
* remove phantomjs dependency (pytest-dev#424) * properly classify all npm dependencies (pytest-dev#425) * Move the changelog to read the docs (pytest-dev#423) * split plugin.py into smaller files (pytest-dev#427) * Implement the visible URL query parameter to control visibility of test results on page load. (pytest-dev#433) * enable control of test result visability via query params * Allow for redacting of environment table values (pytest-dev#431) * Disable Codecov (pytest-dev#480) * Disable Codecov * Disable pypy3 on mac * Add Tests.yml reusable workflow (pytest-dev#484) * Use the tests reusable workflow (pytest-dev#486) * Migrate to precommit.ci (pytest-dev#487) * Separate Nightly workflow (pytest-dev#488) Co-authored-by: Gleb Nikonorov <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 469a09e commit 0b3936a

File tree

12 files changed

+296
-70
lines changed

12 files changed

+296
-70
lines changed

.github/workflows/actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: python -m tox -e docs
3030

3131
tests:
32-
uses: ./.github/workflows/tests.yml
32+
uses: pytest-dev/pytest-html/.github/workflows/tests.yml@master
3333

3434
publish:
3535
name: Publish to PyPI registry

.github/workflows/nightly.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ on:
66

77
jobs:
88
tests:
9-
if: github.repository_owner == 'pytest-dev'
10-
uses: ./.github/workflows/tests.yml
9+
uses: pytest-dev/pytest-html/.github/workflows/tests.yml@master

.github/workflows/tests.yml

Lines changed: 25 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@ jobs:
88
name: ${{ matrix.name }}
99
runs-on: ${{ matrix.os }}
1010
strategy:
11-
fail-fast: false
1211
matrix:
1312
include:
13+
- os: ubuntu-latest
14+
name: py36-ubuntu
15+
python-version: 3.6
16+
17+
- os: windows-latest
18+
name: py36-windows
19+
python-version: 3.6
20+
21+
- os: macOS-latest
22+
name: py36-mac
23+
python-version: 3.6
24+
1425
- os: ubuntu-latest
1526
name: py37-ubuntu
1627
python-version: 3.7
@@ -47,31 +58,18 @@ jobs:
4758
name: py39-mac
4859
python-version: 3.9
4960

50-
- os: ubuntu-latest
51-
name: py310-ubuntu
52-
python-version: '3.10'
53-
54-
- os: windows-latest
55-
name: py310-windows
56-
python-version: '3.10'
57-
58-
- os: macOS-latest
59-
name: py310-mac
60-
python-version: '3.10'
61-
6261
- os: ubuntu-latest
6362
name: pypy3-ubuntu
64-
python-version: pypy-3.8
63+
python-version: pypy3
6564

66-
# TODO: This test takes 10(!) times as long as the regular py38 on Windows
67-
# - os: windows-latest
68-
# name: pypy3-windows
69-
# python-version: pypy-3.8
65+
- os: windows-latest
66+
name: pypy3-windows
67+
python-version: pypy3
7068

7169
# https://github.com/pytest-dev/pytest-html/issues/482
72-
- os: macOS-latest
73-
name: pypy3-mac
74-
python-version: pypy-3.8
70+
# - os: macOS-latest
71+
# name: pypy3-mac
72+
# python-version: pypy3
7573

7674
- os: ubuntu-latest
7775
name: devel-ubuntu
@@ -80,37 +78,21 @@ jobs:
8078
steps:
8179
- name: Set Newline Behavior
8280
run : git config --global core.autocrlf false
83-
84-
- uses: actions/checkout@v3
85-
with:
86-
fetch-depth: 0
87-
81+
- uses: actions/checkout@master
8882
- name: Set up Python
89-
uses: actions/setup-python@v3
83+
uses: actions/setup-python@v2
9084
with:
9185
python-version: ${{ matrix['python-version'] }}
92-
93-
- name: Upgrade pip
94-
run: python -m pip install --upgrade pip
95-
9686
- name: Install tox
9787
run: python -m pip install --upgrade tox
98-
9988
- name: Get Tox Environment Name From Matrix Name
10089
uses: rishabhgupta/split-by@v1
10190
id: split-matrix-name
10291
with:
10392
string: '${{ matrix.name }}'
10493
split-by: '-'
105-
106-
- name: Test with coverage
107-
if: "! contains(matrix.name, 'pypy3')"
108-
run: python -m tox -rvv -e ${{ steps.split-matrix-name.outputs._0}}-cov
109-
110-
- name: Test without coverage
111-
if: "contains(matrix.name, 'pypy3')"
112-
run: python -m tox -e ${{ steps.split-matrix-name.outputs._0}}
113-
94+
- name: Test with tox
95+
run: python -m tox -e ${{ steps.split-matrix-name.outputs._0}}-cov
11496
# TODO: https://github.com/pytest-dev/pytest-html/issues/481
11597
# - name: Upload coverage to codecov
11698
# if: github.event.schedule == ''
@@ -126,9 +108,9 @@ jobs:
126108
name: grunt
127109
runs-on: ubuntu-latest
128110
steps:
129-
- uses: actions/checkout@v3
111+
- uses: actions/checkout@v2
130112
- name: Use Node.js ${{ matrix.node-version }}
131-
uses: actions/setup-node@v3
113+
uses: actions/setup-node@v1
132114
with:
133115
node-version: '12.x'
134116
- name: Install Dependencies

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ repos:
3737
hooks:
3838
- id: pyupgrade
3939
args: [--py3-plus]
40-
- repo: https://github.com/pre-commit/mirrors-eslint
41-
rev: v7.13.0
42-
hooks:
43-
- id: eslint
44-
additional_dependencies:
45-
46-
args: [src]
40+
# - repo: https://github.com/pre-commit/mirrors-eslint
41+
# rev: v7.13.0
42+
# hooks:
43+
# - id: eslint
44+
# additional_dependencies:
45+
46+
# args: [src]
4747
- repo: local
4848
hooks:
4949
- id: rst

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ build-backend = "setuptools.build_meta"
88
[tool.setuptools_scm]
99
local_scheme = "no-local-version"
1010
write_to = "src/pytest_html/__version.py"
11-

src/pytest_html/html_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def _generate_report(self, session):
178178
]
179179

180180
with open(
181-
os.path.join(os.path.dirname(__file__), "resources", "main.js")
181+
os.path.join(os.path.dirname(__file__), "resources", "old_main.js")
182182
) as main_js_fp:
183183
main_js = main_js_fp.read()
184184

src/pytest_html/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
import os
55

66
import pytest
7+
from _pytest.pathlib import Path
78

89
from . import extras # noqa: F401
910
from .html_report import HTMLReport
1011
from .nextgen import NextGenReport
1112

12-
from _pytest.pathlib import Path
1313

1414
def pytest_addhooks(pluginmanager):
1515
from . import hooks

src/pytest_html/resources/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ <h2>Environment</h2>
6464
<h2>Summary</h2>
6565
<p class="run-count"></p>
6666
<p class="filter">(Un)check the boxes to filter the results.</p>
67-
68-
<input checked="true" class="filter" data-test-result="error" name="filter_checkbox" type="checkbox"/><span class="error"></span>
67+
68+
<input checked="true" class="filter" data-test-result="error" name="filter_checkbox" type="checkbox"/><span class="error"></span>
6969
<input checked="true" class="filter" data-test-result="failed" name="filter_checkbox" type="checkbox"/><span class="failed"></span>
7070
<input checked="true" class="filter" data-test-result="rerun" name="filter_checkbox" type="checkbox"/><span class="rerun"></span>
71-
<input checked="true" class="filter" data-test-result="xfailed" name="filter_checkbox" type="checkbox"/><span class="xfailed"></span>
72-
<input checked="true" class="filter" data-test-result="xpassed" name="filter_checkbox" type="checkbox"/><span class="xpassed"></span>
71+
<input checked="true" class="filter" data-test-result="xfailed" name="filter_checkbox" type="checkbox"/><span class="xfailed"></span>
72+
<input checked="true" class="filter" data-test-result="xpassed" name="filter_checkbox" type="checkbox"/><span class="xpassed"></span>
7373
<input checked="true" class="filter" data-test-result="passed" name="filter_checkbox" type="checkbox"/><span class="passed"></span>
7474
<input checked="true" class="filter" data-test-result="skipped" name="filter_checkbox" type="checkbox"/><span class="skipped"></span>
7575

7676

77-
77+
7878
</div>
7979
<div class="summary__reload">
8080
<div class="summary__reload__button" onclick="location.reload()">
@@ -86,7 +86,7 @@ <h2>Summary</h2>
8686
</div>
8787
<h2>Results</h2>
8888
<table id="results-table">
89-
89+
9090
</table>
9191
</body>
9292
<footer>
@@ -97,4 +97,4 @@ <h2>Results</h2>
9797
<script src="index.js"></script>
9898
<script src="main.js"></script>
9999
</footer>
100-
</html>
100+
</html>

src/pytest_html/resources/main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ function addCollapse() {
6161
const resulttable = find('table#results-table');
6262
const showhideall = document.createElement('p');
6363
showhideall.innerHTML =
64-
'<a href="javascript:showAllExtras()">Show all details</a> / ' +
65-
'<a href="javascript:hideAllExtras()">Hide all details</a>';
64+
'<a href="javascript:showAllExtras()">Show all details</a> / ' +
65+
'<a href="javascript:hideAllExtras()">Hide all details</a>';
6666
resulttable.parentElement.insertBefore(showhideall, resulttable);
6767

6868
// Add show/hide link to each result
@@ -82,9 +82,9 @@ function addCollapse() {
8282

8383
elem.addEventListener('click', function (event) {
8484
if (
85-
event.currentTarget.parentNode.nextElementSibling.classList.contains(
86-
'collapsed'
87-
)
85+
event.currentTarget.parentNode.nextElementSibling.classList.contains(
86+
'collapsed'
87+
)
8888
) {
8989
showExtras(event.currentTarget);
9090
} else {

0 commit comments

Comments
 (0)