Skip to content

Commit ff7cc32

Browse files
BeyondEvilgnikonorovpre-commit-ci[bot]
authored
Update next-gen with recent changes to master (#494)
* remove phantomjs dependency (#424) * properly classify all npm dependencies (#425) * Move the changelog to read the docs (#423) * split plugin.py into smaller files (#427) * Implement the visible URL query parameter to control visibility of test results on page load. (#433) * enable control of test result visability via query params * Allow for redacting of environment table values (#431) * Disable Codecov (#480) * Disable Codecov * Disable pypy3 on mac * Add Tests.yml reusable workflow (#484) * Use the tests reusable workflow (#486) * Migrate to precommit.ci (#487) * Separate Nightly workflow (#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 ff08751 commit ff7cc32

File tree

12 files changed

+404
-164
lines changed

12 files changed

+404
-164
lines changed

.github/workflows/actions.yml

+7-140
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: gh
1+
name: Main
22

33
on:
44
create: # is used for publishing to PyPI and TestPyPI
@@ -12,163 +12,30 @@ on:
1212
- >-
1313
**
1414
pull_request:
15-
schedule:
16-
- cron: 1 0 * * * # Run daily at 0:01 UTC
1715

1816
jobs:
1917
build_docs:
2018
name: Build Docs
21-
runs-on: ubuntu-18.04
19+
runs-on: ubuntu-latest
2220
steps:
2321
- uses: actions/checkout@master
2422
- name: Set up Python
2523
uses: actions/setup-python@v2
2624
with:
2725
python-version: 3.6
2826
- name: Install tox
29-
run: |
30-
python -m pip install --upgrade tox
27+
run: python -m pip install --upgrade tox
3128
- name: Build docs with tox
32-
run: |
33-
python -m tox -e docs
34-
build_python:
35-
name: ${{ matrix.name }}
36-
runs-on: ${{ matrix.os }}
37-
strategy:
38-
matrix:
39-
include:
40-
- os: ubuntu-18.04
41-
name: py36-ubuntu
42-
python-version: 3.6
43-
44-
- os: windows-latest
45-
name: py36-windows
46-
python-version: 3.6
47-
48-
- os: macOS-latest
49-
name: py36-mac
50-
python-version: 3.6
51-
52-
- os: ubuntu-18.04
53-
name: py37-ubuntu
54-
python-version: 3.7
55-
56-
- os: windows-latest
57-
name: py37-windows
58-
python-version: 3.7
59-
60-
- os: macOS-latest
61-
name: py37-mac
62-
python-version: 3.7
63-
64-
- os: ubuntu-18.04
65-
name: py38-ubuntu
66-
python-version: 3.8
67-
68-
- os: windows-latest
69-
name: py38-windows
70-
python-version: 3.8
71-
72-
- os: macOS-latest
73-
name: py38-mac
74-
python-version: 3.8
29+
run: python -m tox -e docs
7530

76-
- os: ubuntu-18.04
77-
name: py39-ubuntu
78-
python-version: 3.9
31+
tests:
32+
uses: pytest-dev/pytest-html/.github/workflows/tests.yml@master
7933

80-
- os: windows-latest
81-
name: py39-windows
82-
python-version: 3.9
83-
84-
- os: macOS-latest
85-
name: py39-mac
86-
python-version: 3.9
87-
88-
- os: ubuntu-18.04
89-
name: pypy3-ubuntu
90-
python-version: pypy3
91-
92-
- os: windows-latest
93-
name: pypy3-windows
94-
python-version: pypy3
95-
96-
- os: macOS-latest
97-
name: pypy3-mac
98-
python-version: pypy3
99-
100-
- os: ubuntu-18.04
101-
name: devel-ubuntu
102-
python-version: 3.8
103-
104-
steps:
105-
- name: Set Newline Behavior
106-
run : |
107-
git config --global core.autocrlf false
108-
- uses: actions/checkout@master
109-
- name: Set up Python
110-
uses: actions/setup-python@v2
111-
with:
112-
python-version: ${{ matrix['python-version'] }}
113-
- name: Install tox
114-
run: |
115-
python -m pip install --upgrade tox
116-
- name: Get Tox Environment Name From Matrix Name
117-
uses: rishabhgupta/split-by@v1
118-
id: split-matrix-name
119-
with:
120-
string: '${{ matrix.name }}'
121-
split-by: '-'
122-
- name: Test with tox
123-
run: |
124-
python -m tox -e ${{ steps.split-matrix-name.outputs._0}}-cov
125-
- name: Upload coverage to codecov
126-
uses: codecov/codecov-action@v1
127-
with:
128-
fail_ci_if_error: true
129-
file: ./coverage.xml
130-
flags: tests
131-
name: ${{ matrix.py }} - ${{ matrix.os }}
132-
verbose: true
133-
build_javascript:
134-
name: grunt
135-
runs-on: ubuntu-18.04
136-
steps:
137-
- uses: actions/checkout@v2
138-
- name: Use Node.js ${{ matrix.node-version }}
139-
uses: actions/setup-node@v1
140-
with:
141-
node-version: '12.x'
142-
- name: Install Dependencies
143-
run: |
144-
npm install
145-
- name: QUnit Tests
146-
run: |
147-
npm test
148-
env:
149-
CI: true
150-
linting:
151-
name: linting
152-
runs-on: ubuntu-18.04
153-
steps:
154-
- uses: actions/checkout@master
155-
- name: Set up Python
156-
uses: actions/setup-python@v2
157-
with:
158-
python-version: 3.6
159-
- name: Install tox
160-
run: |
161-
python -m pip install --upgrade tox
162-
- name: Lint with tox
163-
run: |
164-
python -m tox -e linting
16534
publish:
16635
name: Publish to PyPI registry
16736
needs:
168-
- build_python
169-
- build_javascript
37+
- tests
17038
runs-on: ubuntu-latest
171-
17239
env:
17340
PY_COLORS: 1
17441
TOXENV: packaging

.github/workflows/nightly.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Nightly tests
2+
3+
on:
4+
schedule:
5+
- cron: '1 0 * * *' # Run daily at 0:01 UTC
6+
7+
jobs:
8+
tests:
9+
uses: pytest-dev/pytest-html/.github/workflows/tests.yml@master

.github/workflows/tests.yml

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
test_python:
8+
name: ${{ matrix.name }}
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
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+
25+
- os: ubuntu-latest
26+
name: py37-ubuntu
27+
python-version: 3.7
28+
29+
- os: windows-latest
30+
name: py37-windows
31+
python-version: 3.7
32+
33+
- os: macOS-latest
34+
name: py37-mac
35+
python-version: 3.7
36+
37+
- os: ubuntu-latest
38+
name: py38-ubuntu
39+
python-version: 3.8
40+
41+
- os: windows-latest
42+
name: py38-windows
43+
python-version: 3.8
44+
45+
- os: macOS-latest
46+
name: py38-mac
47+
python-version: 3.8
48+
49+
- os: ubuntu-latest
50+
name: py39-ubuntu
51+
python-version: 3.9
52+
53+
- os: windows-latest
54+
name: py39-windows
55+
python-version: 3.9
56+
57+
- os: macOS-latest
58+
name: py39-mac
59+
python-version: 3.9
60+
61+
- os: ubuntu-latest
62+
name: pypy3-ubuntu
63+
python-version: pypy3
64+
65+
- os: windows-latest
66+
name: pypy3-windows
67+
python-version: pypy3
68+
69+
# https://github.com/pytest-dev/pytest-html/issues/482
70+
# - os: macOS-latest
71+
# name: pypy3-mac
72+
# python-version: pypy3
73+
74+
- os: ubuntu-latest
75+
name: devel-ubuntu
76+
python-version: 3.9
77+
78+
steps:
79+
- name: Set Newline Behavior
80+
run : git config --global core.autocrlf false
81+
- uses: actions/checkout@master
82+
- name: Set up Python
83+
uses: actions/setup-python@v2
84+
with:
85+
python-version: ${{ matrix['python-version'] }}
86+
- name: Install tox
87+
run: python -m pip install --upgrade tox
88+
- name: Get Tox Environment Name From Matrix Name
89+
uses: rishabhgupta/split-by@v1
90+
id: split-matrix-name
91+
with:
92+
string: '${{ matrix.name }}'
93+
split-by: '-'
94+
- name: Test with tox
95+
run: python -m tox -e ${{ steps.split-matrix-name.outputs._0}}-cov
96+
# TODO: https://github.com/pytest-dev/pytest-html/issues/481
97+
# - name: Upload coverage to codecov
98+
# if: github.event.schedule == ''
99+
# uses: codecov/codecov-action@v2
100+
# with:
101+
# fail_ci_if_error: true
102+
# file: ./coverage.xml
103+
# flags: tests
104+
# name: ${{ matrix.py }} - ${{ matrix.os }}
105+
# verbose: true
106+
107+
test_javascript:
108+
name: grunt
109+
runs-on: ubuntu-latest
110+
steps:
111+
- uses: actions/checkout@v2
112+
- name: Use Node.js ${{ matrix.node-version }}
113+
uses: actions/setup-node@v1
114+
with:
115+
node-version: '12.x'
116+
- name: Install Dependencies
117+
run: npm install
118+
- name: QUnit Tests
119+
run: npm test

.pre-commit-config.yaml

+7-7
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

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ build-backend = "setuptools.build_meta"
1111
[tool.setuptools_scm]
1212
local_scheme = "no-local-version"
1313
write_to = "src/pytest_html/__version.py"
14-

src/pytest_html/html_report.py

+1-1
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

+1-1
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

+7-7
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>

0 commit comments

Comments
 (0)