Skip to content

Update next-gen with recent changes to master #494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 7 additions & 140 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: gh
name: Main

on:
create: # is used for publishing to PyPI and TestPyPI
Expand All @@ -12,163 +12,30 @@ on:
- >-
**
pull_request:
schedule:
- cron: 1 0 * * * # Run daily at 0:01 UTC

jobs:
build_docs:
name: Build Docs
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install tox
run: |
python -m pip install --upgrade tox
run: python -m pip install --upgrade tox
- name: Build docs with tox
run: |
python -m tox -e docs
build_python:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-18.04
name: py36-ubuntu
python-version: 3.6

- os: windows-latest
name: py36-windows
python-version: 3.6

- os: macOS-latest
name: py36-mac
python-version: 3.6

- os: ubuntu-18.04
name: py37-ubuntu
python-version: 3.7

- os: windows-latest
name: py37-windows
python-version: 3.7

- os: macOS-latest
name: py37-mac
python-version: 3.7

- os: ubuntu-18.04
name: py38-ubuntu
python-version: 3.8

- os: windows-latest
name: py38-windows
python-version: 3.8

- os: macOS-latest
name: py38-mac
python-version: 3.8
run: python -m tox -e docs

- os: ubuntu-18.04
name: py39-ubuntu
python-version: 3.9
tests:
uses: pytest-dev/pytest-html/.github/workflows/tests.yml@master

- os: windows-latest
name: py39-windows
python-version: 3.9

- os: macOS-latest
name: py39-mac
python-version: 3.9

- os: ubuntu-18.04
name: pypy3-ubuntu
python-version: pypy3

- os: windows-latest
name: pypy3-windows
python-version: pypy3

- os: macOS-latest
name: pypy3-mac
python-version: pypy3

- os: ubuntu-18.04
name: devel-ubuntu
python-version: 3.8

steps:
- name: Set Newline Behavior
run : |
git config --global core.autocrlf false
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix['python-version'] }}
- name: Install tox
run: |
python -m pip install --upgrade tox
- name: Get Tox Environment Name From Matrix Name
uses: rishabhgupta/split-by@v1
id: split-matrix-name
with:
string: '${{ matrix.name }}'
split-by: '-'
- name: Test with tox
run: |
python -m tox -e ${{ steps.split-matrix-name.outputs._0}}-cov
- name: Upload coverage to codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
file: ./coverage.xml
flags: tests
name: ${{ matrix.py }} - ${{ matrix.os }}
verbose: true
build_javascript:
name: grunt
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install Dependencies
run: |
npm install
- name: QUnit Tests
run: |
npm test
env:
CI: true
linting:
name: linting
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install tox
run: |
python -m pip install --upgrade tox
- name: Lint with tox
run: |
python -m tox -e linting
publish:
name: Publish to PyPI registry
needs:
- build_python
- build_javascript
- tests
runs-on: ubuntu-latest

env:
PY_COLORS: 1
TOXENV: packaging
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Nightly tests

on:
schedule:
- cron: '1 0 * * *' # Run daily at 0:01 UTC

jobs:
tests:
uses: pytest-dev/pytest-html/.github/workflows/tests.yml@master
119 changes: 119 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Tests

on:
workflow_call:

jobs:
test_python:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
name: py36-ubuntu
python-version: 3.6

- os: windows-latest
name: py36-windows
python-version: 3.6

- os: macOS-latest
name: py36-mac
python-version: 3.6

- os: ubuntu-latest
name: py37-ubuntu
python-version: 3.7

- os: windows-latest
name: py37-windows
python-version: 3.7

- os: macOS-latest
name: py37-mac
python-version: 3.7

- os: ubuntu-latest
name: py38-ubuntu
python-version: 3.8

- os: windows-latest
name: py38-windows
python-version: 3.8

- os: macOS-latest
name: py38-mac
python-version: 3.8

- os: ubuntu-latest
name: py39-ubuntu
python-version: 3.9

- os: windows-latest
name: py39-windows
python-version: 3.9

- os: macOS-latest
name: py39-mac
python-version: 3.9

- os: ubuntu-latest
name: pypy3-ubuntu
python-version: pypy3

- os: windows-latest
name: pypy3-windows
python-version: pypy3

# https://github.com/pytest-dev/pytest-html/issues/482
# - os: macOS-latest
# name: pypy3-mac
# python-version: pypy3

- os: ubuntu-latest
name: devel-ubuntu
python-version: 3.9

steps:
- name: Set Newline Behavior
run : git config --global core.autocrlf false
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix['python-version'] }}
- name: Install tox
run: python -m pip install --upgrade tox
- name: Get Tox Environment Name From Matrix Name
uses: rishabhgupta/split-by@v1
id: split-matrix-name
with:
string: '${{ matrix.name }}'
split-by: '-'
- name: Test with tox
run: python -m tox -e ${{ steps.split-matrix-name.outputs._0}}-cov
# TODO: https://github.com/pytest-dev/pytest-html/issues/481
# - name: Upload coverage to codecov
# if: github.event.schedule == ''
# uses: codecov/codecov-action@v2
# with:
# fail_ci_if_error: true
# file: ./coverage.xml
# flags: tests
# name: ${{ matrix.py }} - ${{ matrix.os }}
# verbose: true

test_javascript:
name: grunt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install Dependencies
run: npm install
- name: QUnit Tests
run: npm test
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ repos:
hooks:
- id: pyupgrade
args: [--py3-plus]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v7.13.0
hooks:
- id: eslint
additional_dependencies:
- [email protected]
args: [src]
# - repo: https://github.com/pre-commit/mirrors-eslint
# rev: v7.13.0
# hooks:
# - id: eslint
# additional_dependencies:
# - [email protected]
# args: [src]
- repo: local
hooks:
- id: rst
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
local_scheme = "no-local-version"
write_to = "src/pytest_html/__version.py"

2 changes: 1 addition & 1 deletion src/pytest_html/html_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def _generate_report(self, session):
]

with open(
os.path.join(os.path.dirname(__file__), "resources", "main.js")
os.path.join(os.path.dirname(__file__), "resources", "old_main.js")
) as main_js_fp:
main_js = main_js_fp.read()

Expand Down
2 changes: 1 addition & 1 deletion src/pytest_html/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import os

import pytest
from _pytest.pathlib import Path

from . import extras # noqa: F401
from .html_report import HTMLReport
from .nextgen import NextGenReport

from _pytest.pathlib import Path

def pytest_addhooks(pluginmanager):
from . import hooks
Expand Down
14 changes: 7 additions & 7 deletions src/pytest_html/resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ <h2>Environment</h2>
<h2>Summary</h2>
<p class="run-count"></p>
<p class="filter">(Un)check the boxes to filter the results.</p>
<input checked="true" class="filter" data-test-result="error" name="filter_checkbox" type="checkbox"/><span class="error"></span>

<input checked="true" class="filter" data-test-result="error" name="filter_checkbox" type="checkbox"/><span class="error"></span>
<input checked="true" class="filter" data-test-result="failed" name="filter_checkbox" type="checkbox"/><span class="failed"></span>
<input checked="true" class="filter" data-test-result="rerun" name="filter_checkbox" type="checkbox"/><span class="rerun"></span>
<input checked="true" class="filter" data-test-result="xfailed" name="filter_checkbox" type="checkbox"/><span class="xfailed"></span>
<input checked="true" class="filter" data-test-result="xpassed" name="filter_checkbox" type="checkbox"/><span class="xpassed"></span>
<input checked="true" class="filter" data-test-result="xfailed" name="filter_checkbox" type="checkbox"/><span class="xfailed"></span>
<input checked="true" class="filter" data-test-result="xpassed" name="filter_checkbox" type="checkbox"/><span class="xpassed"></span>
<input checked="true" class="filter" data-test-result="passed" name="filter_checkbox" type="checkbox"/><span class="passed"></span>
<input checked="true" class="filter" data-test-result="skipped" name="filter_checkbox" type="checkbox"/><span class="skipped"></span>



</div>
<div class="summary__reload">
<div class="summary__reload__button" onclick="location.reload()">
Expand All @@ -86,7 +86,7 @@ <h2>Summary</h2>
</div>
<h2>Results</h2>
<table id="results-table">

</table>
</body>
<footer>
Expand All @@ -97,4 +97,4 @@ <h2>Results</h2>
<script src="index.js"></script>
<script src="main.js"></script>
</footer>
</html>
</html>
Loading